Preview only the first image in batch
This commit is contained in:
@@ -167,13 +167,11 @@ class CompassImageLoader:
|
|||||||
|
|
||||||
temp_dir = folder_paths.get_temp_directory()
|
temp_dir = folder_paths.get_temp_directory()
|
||||||
prefix = "_compass_" + "".join(random.choice("abcdefghijklmnopqrstupvxyz") for _ in range(5))
|
prefix = "_compass_" + "".join(random.choice("abcdefghijklmnopqrstupvxyz") for _ in range(5))
|
||||||
results = []
|
i = 255.0 * image_batch[0].cpu().numpy()
|
||||||
for batch_number, img_tensor in enumerate(image_batch):
|
pil_img = Image.fromarray(np.clip(i, 0, 255).astype(np.uint8))
|
||||||
i = 255.0 * img_tensor.cpu().numpy()
|
file = f"{prefix}_00000_.png"
|
||||||
pil_img = Image.fromarray(np.clip(i, 0, 255).astype(np.uint8))
|
pil_img.save(os.path.join(temp_dir, file), compress_level=1)
|
||||||
file = f"{prefix}_{batch_number:05}_.png"
|
results = [{"filename": file, "subfolder": "", "type": "temp"}]
|
||||||
pil_img.save(os.path.join(temp_dir, file), compress_level=1)
|
|
||||||
results.append({"filename": file, "subfolder": "", "type": "temp"})
|
|
||||||
|
|
||||||
return {
|
return {
|
||||||
"ui": {"images": results},
|
"ui": {"images": results},
|
||||||
|
|||||||
Reference in New Issue
Block a user