From 684afdf5e6223b66bca02a13275f9dd46db785c6 Mon Sep 17 00:00:00 2001 From: "Salvador E. Tropea" Date: Mon, 13 Oct 2025 18:24:30 -0300 Subject: [PATCH] [ImageResize][Fixed] Mask processing for modes others than edge_pixel Avoid replicating the edge for other modes. --- src/nodes/nodes_img.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/nodes/nodes_img.py b/src/nodes/nodes_img.py index 1e1161c..a23f9ec 100644 --- a/src/nodes/nodes_img.py +++ b/src/nodes/nodes_img.py @@ -872,7 +872,8 @@ class ImagePad: out_masks = torch.nn.functional.pad( mask, (pad_left, pad_right, pad_top, pad_bottom), - mode='replicate' + mode='replicate' if pad_mode == "edge_pixel" else 'constant', + value=None if pad_mode == "edge_pixel" else 1.0, ) else: out_masks = torch.ones((B, padded_height, padded_width), dtype=image.dtype, device=image.device)