From 6c997afd5f2d1d31d8d4c30d0526e04b982139f4 Mon Sep 17 00:00:00 2001 From: kijai <40791699+kijai@users.noreply.github.com> Date: Sat, 5 Apr 2025 20:32:34 +0300 Subject: [PATCH] Update image_nodes.py --- nodes/image_nodes.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/nodes/image_nodes.py b/nodes/image_nodes.py index 8d201bc..e1d1e3e 100644 --- a/nodes/image_nodes.py +++ b/nodes/image_nodes.py @@ -3180,6 +3180,10 @@ class ImagePadKJ: # Calculate padding sizes with extra padding if target_width is not None and target_height is not None: + if extra_padding > 0: + image = common_upscale(image.movedim(-1, 1), W - extra_padding, H - extra_padding, "lanczos", "disabled").movedim(1, -1) + B, H, W, C = image.shape + padded_width = target_width padded_height = target_height pad_left = (padded_width - W) // 2