From 585fb0475bbaf919bd340c72d339752bbb93ef55 Mon Sep 17 00:00:00 2001 From: MoonRide303 Date: Sat, 23 Sep 2023 13:19:42 +0200 Subject: [PATCH] Adding default alpha when splitting RGB images --- comfy_extras/nodes_compositing.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/comfy_extras/nodes_compositing.py b/comfy_extras/nodes_compositing.py index 6899e4a8..b0ae2dfa 100644 --- a/comfy_extras/nodes_compositing.py +++ b/comfy_extras/nodes_compositing.py @@ -153,7 +153,7 @@ class SplitImageWithAlpha: def split_image_with_alpha(self, image: torch.Tensor): out_images = [i[:,:,:3] for i in image] - out_alphas = [i[:,:,3] for i in image] + out_alphas = [i[:,:,3] if i.shape[2] > 3 else torch.ones_like(i[:,:,0]) for i in image] result = (torch.stack(out_images), torch.stack(out_alphas)) return result