mirror of
https://git.datalinker.icu/kijai/ComfyUI-KJNodes.git
synced 2025-12-20 02:04:35 +08:00
Update image_nodes.py
This commit is contained in:
parent
843805b1fb
commit
91bdcfdf60
@ -3209,9 +3209,11 @@ class ImagePadKJ:
|
|||||||
|
|
||||||
|
|
||||||
if mask is not None:
|
if mask is not None:
|
||||||
out_masks = torch.zeros((BM, padded_height, padded_width), dtype=mask.dtype, device=mask.device)
|
out_masks = torch.nn.functional.pad(
|
||||||
for m in range(BM):
|
mask,
|
||||||
out_masks[m, pad_top:pad_top+H, pad_left:pad_left+W] = mask[m]
|
(pad_left, pad_right, pad_top, pad_bottom),
|
||||||
|
mode='replicate'
|
||||||
|
)
|
||||||
else:
|
else:
|
||||||
out_masks = torch.ones((B, padded_height, padded_width), dtype=image.dtype, device=image.device)
|
out_masks = torch.ones((B, padded_height, padded_width), dtype=image.dtype, device=image.device)
|
||||||
for m in range(B):
|
for m in range(B):
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user