This commit is contained in:
aria1th
2025-03-02 14:54:43 +09:00
parent 29630d22e4
commit 287997120b
+1 -6
View File
@@ -301,13 +301,8 @@ class SaveImageWebpCustomNode:
for image in images:
i = 255. * image.cpu().numpy()
clipped = np.clip(i, 0, 255).astype(np.uint8)
if clipped.shape[0] == 3:
if clipped.shape[0] <= 3:
clipped = np.transpose(clipped, (1, 2, 0)) #[1216, 832, 3]
# if 2-channel image, we don't have to clip but we have to convert to 3-channel (RGB)
elif clipped.shape[0] == 2:
single_channel = clipped[0:1, :, :]
repeated = np.repeat(single_channel, 3, axis=0)
clipped = np.transpose(repeated, (1, 2, 0)) #[1216, 832, 3] # ummmm anyway
img = Image.fromarray(clipped)
metadata = None
if not args.disable_metadata: