From 730eeec5d3ece25f5fae9940447245261e3d7602 Mon Sep 17 00:00:00 2001 From: gambletan Date: Wed, 11 Mar 2026 10:18:26 +0800 Subject: [PATCH] fix(FeatherMask): correct negative zero indexing for right/bottom feathering In the FeatherMask node, when applying right and bottom feathering, the loop variable starts at 0, making `-x` and `-y` equal to `-0`, which in Python indexes the first element (index 0) instead of the last. This causes the first column/row to be incorrectly modified while the last column/row is left untouched. Fix by using `-(x + 1)` and `-(y + 1)` so the loop correctly starts from the last element (index -1) and works inward, matching the behavior of the left/top feathering loops which start from index 0 and work outward. --- 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 c44602597..ef649c37c 100644 --- a/comfy_extras/nodes_mask.py +++ b/comfy_extras/nodes_mask.py @@ -322,7 +322,7 @@ class FeatherMask(IO.ComfyNode): for x in range(right): feather_rate = (x + 1) / right - output[:, :, -x] *= feather_rate + output[:, :, -(x + 1)] *= feather_rate for y in range(top): feather_rate = (y + 1) / top @@ -330,7 +330,7 @@ class FeatherMask(IO.ComfyNode): for y in range(bottom): feather_rate = (y + 1) / bottom - output[:, -y, :] *= feather_rate + output[:, -(y + 1), :] *= feather_rate return IO.NodeOutput(output)