mirror of
https://git.datalinker.icu/kijai/ComfyUI-KJNodes.git
synced 2025-12-24 12:14:35 +08:00
Update mask_nodes.py
This commit is contained in:
parent
4d411c4593
commit
fb253119ed
@ -1005,11 +1005,8 @@ class GrowMaskWithBlur:
|
|||||||
decay = decay_factor
|
decay = decay_factor
|
||||||
if flip_input:
|
if flip_input:
|
||||||
mask = 1.0 - mask
|
mask = 1.0 - mask
|
||||||
c = 0 if tapered_corners else 1
|
|
||||||
kernel = np.array([[c, 1, c],
|
growmask = mask.reshape((-1, mask.shape[-2], mask.shape[-1]))
|
||||||
[1, 1, 1],
|
|
||||||
[c, 1, c]])
|
|
||||||
growmask = mask.reshape((-1, mask.shape[-2], mask.shape[-1])).cpu()
|
|
||||||
out = []
|
out = []
|
||||||
previous_output = None
|
previous_output = None
|
||||||
current_expand = expand
|
current_expand = expand
|
||||||
@ -1040,7 +1037,6 @@ class GrowMaskWithBlur:
|
|||||||
current_expand += abs(incremental_expandrate)
|
current_expand += abs(incremental_expandrate)
|
||||||
|
|
||||||
if fill_holes:
|
if fill_holes:
|
||||||
# For fill_holes, you might need to keep using scipy or implement GPU version
|
|
||||||
binary_mask = output > 0
|
binary_mask = output > 0
|
||||||
output_np = binary_mask.cpu().numpy()
|
output_np = binary_mask.cpu().numpy()
|
||||||
filled = scipy.ndimage.binary_fill_holes(output_np)
|
filled = scipy.ndimage.binary_fill_holes(output_np)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user