From 68fee005ec891bc08af80ab5c314c22842824647 Mon Sep 17 00:00:00 2001 From: malkuthro <166633396+malkuthro@users.noreply.github.com> Date: Sat, 18 Oct 2025 23:38:23 +0200 Subject: [PATCH] Color_panel - seq out --- k_easy_resize.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/k_easy_resize.py b/k_easy_resize.py index 53477d0..b25a167 100644 --- a/k_easy_resize.py +++ b/k_easy_resize.py @@ -175,11 +175,12 @@ When selecting 'Custom' for pad_color_mode or panel_color_mode, enter the color out_mask = out_mask.movedim(1, -1).squeeze(-1) # Squeeze last dim (channel=1) -> [B, H', W'] # Create color panel - # Create panel tensor (B=1, C=3, H=target_height, W=target_width) + # Create panel tensor (B, H, W, 3) panel_channels = 3 # RGB, no alpha color_panel = torch.zeros((1, panel_channels, target_height, target_width), dtype=image.dtype, device=device) color_panel[0, :, :, :] = torch.tensor(panel_color_list, dtype=image.dtype, device=device).view(panel_channels, 1, 1) - color_panel = color_panel.movedim(1, -1) # to [1, H, W, 3] + color_panel = color_panel.expand(B, -1, -1, -1) # Expand to match batch size B + color_panel = color_panel.movedim(1, -1) # to [B, H, W, 3] return (out_image, out_mask, target_width, target_height, color_panel, original_W, original_H, original_aspect_ratio)