From 9a52b7dfd28b8079e6c63636fd2e2d1dff37d403 Mon Sep 17 00:00:00 2001 From: kijai <40791699+kijai@users.noreply.github.com> Date: Thu, 29 May 2025 20:35:18 +0300 Subject: [PATCH] Update image_nodes.py --- nodes/image_nodes.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/nodes/image_nodes.py b/nodes/image_nodes.py index 52aec6b..f910251 100644 --- a/nodes/image_nodes.py +++ b/nodes/image_nodes.py @@ -2662,8 +2662,8 @@ class LoadImagesFromFolderKJ: return { "required": { "folder": ("STRING", {"default": ""}), - "width": ("INT", {"default": 1024, "min": 64, "step": 1}), - "height": ("INT", {"default": 1024, "min": 64, "step": 1}), + "width": ("INT", {"default": 1024, "min": -1, "step": 1}), + "height": ("INT", {"default": 1024, "min": -1, "step": 1}), "keep_aspect_ratio": (["crop", "pad", "stretch",],), }, "optional": { @@ -2721,6 +2721,9 @@ class LoadImagesFromFolderKJ: i = ImageOps.exif_transpose(i) # Resize image to maximum dimensions + if width == -1 and height == -1: + width = i.size[0] + height = i.size[1] if i.size != (width, height): i = self.resize_with_aspect_ratio(i, width, height, keep_aspect_ratio)