Compare commits

...

2 Commits

Author SHA1 Message Date
Alvin Tang
fcc11f7f42
Merge 730eeec5d3 into af7b4a921d 2026-03-13 08:16:25 +08:00
gambletan
730eeec5d3 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.
2026-03-11 10:18:26 +08:00

View File

@ -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)