From 287997120bcf3ee644ba5e0001710ef884f4ade2 Mon Sep 17 00:00:00 2001 From: aria1th <35677394+aria1th@users.noreply.github.com> Date: Sun, 2 Mar 2025 14:54:43 +0900 Subject: [PATCH] uhhhh --- io_node.py | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/io_node.py b/io_node.py index e192226..6402d43 100644 --- a/io_node.py +++ b/io_node.py @@ -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: