Update image_nodes.py

This commit is contained in:
kijai 2025-04-05 20:32:34 +03:00
parent 5f16aeec88
commit 6c997afd5f

View File

@ -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