From 87097a11c32ac7393093055c4ed1432553995560 Mon Sep 17 00:00:00 2001 From: Jairo Correa Date: Fri, 13 Oct 2023 12:26:54 -0300 Subject: [PATCH 1/2] Fix FeatherMask --- comfy_extras/nodes_mask.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/comfy_extras/nodes_mask.py b/comfy_extras/nodes_mask.py index 9b0b289c..3cc4cfd7 100644 --- a/comfy_extras/nodes_mask.py +++ b/comfy_extras/nodes_mask.py @@ -282,10 +282,10 @@ class FeatherMask: def feather(self, mask, left, top, right, bottom): output = mask.reshape((-1, mask.shape[-2], mask.shape[-1])).clone() - left = min(left, output.shape[1]) - right = min(right, output.shape[1]) - top = min(top, output.shape[0]) - bottom = min(bottom, output.shape[0]) + left = min(left, output.shape[-1]) + right = min(right, output.shape[-1]) + top = min(top, output.shape[-2]) + bottom = min(bottom, output.shape[-2]) for x in range(left): feather_rate = (x + 1.0) / left From b5fa3d28d7a9242a73c40b3b37e526267cbd67fd Mon Sep 17 00:00:00 2001 From: Jairo Correa Date: Fri, 13 Oct 2023 13:40:53 -0300 Subject: [PATCH 2/2] Fix MaskComposite --- comfy_extras/nodes_mask.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/comfy_extras/nodes_mask.py b/comfy_extras/nodes_mask.py index 3cc4cfd7..d8c65c2b 100644 --- a/comfy_extras/nodes_mask.py +++ b/comfy_extras/nodes_mask.py @@ -240,8 +240,8 @@ class MaskComposite: right, bottom = (min(left + source.shape[-1], destination.shape[-1]), min(top + source.shape[-2], destination.shape[-2])) visible_width, visible_height = (right - left, bottom - top,) - source_portion = source[:visible_height, :visible_width] - destination_portion = destination[top:bottom, left:right] + source_portion = source[:, :visible_height, :visible_width] + destination_portion = destination[:, top:bottom, left:right] if operation == "multiply": output[:, top:bottom, left:right] = destination_portion * source_portion