Update nodes.py

added numpy array possibility in method save_images.
This commit is contained in:
Grégory Howard 2025-08-15 20:08:02 +02:00 committed by GitHub
parent e08ecfbd8a
commit f84a6a7bb8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1586,7 +1586,10 @@ class SaveImage:
full_output_folder, filename, counter, subfolder, filename_prefix = folder_paths.get_save_image_path(filename_prefix, self.output_dir, images[0].shape[1], images[0].shape[0])
results = list()
for (batch_number, image) in enumerate(images):
i = 255. * image.cpu().numpy()
if hasattr(image, "cpu"): # torch tensor
i = 255. * image.cpu().numpy()
else:
i = 255. * image
img = Image.fromarray(np.clip(i, 0, 255).astype(np.uint8))
metadata = None
if not args.disable_metadata: