MCPcopy
hub / github.com/kohya-ss/sd-scripts / get

Method get

tools/dev/visualize_masks.py:110–117  ·  view source on GitHub ↗
(self, index: int, width: int, height: int)

Source from the content-addressed store, hash-verified

108 print(" No real images found — using synthetic images.")
109
110 def get(self, index: int, width: int, height: int) -> Image.Image:
111 if self._pool:
112 path = self._pool[index % len(self._pool)]
113 try:
114 return Image.open(path).convert("RGB").resize((width, height), Image.LANCZOS)
115 except Exception as e:
116 print(f" Warning: could not open {path}: {e} — using synthetic fallback")
117 return _synthetic_image(width, height, seed=index)
118
119
120# ---------------------------------------------------------------------------

Callers 15

sample_image_inferenceFunction · 0.80
load_dit_modelFunction · 0.80
trainFunction · 0.80
trainFunction · 0.80
prepare_text_inputsFunction · 0.80
trainFunction · 0.80
trainFunction · 0.80
__call__Method · 0.80
__call__Method · 0.80

Calls 1

_synthetic_imageFunction · 0.85

Tested by 3