Compare commits

...

4 Commits

Author SHA1 Message Date
molbal
575ec198ad
Merge 382c20809b into 29011ba87e 2026-01-26 23:10:39 +01:00
molbal
382c20809b
Restore whitespace 2026-01-26 22:13:50 +01:00
molbal
27f40af5f5
Restore search aliases 2026-01-26 22:06:14 +01:00
molbal
25d4954b10
Enable recursive image loading in LoadImage node
The LoadImage node now recursively scans the input directory and all its subdirectories for images, similar to the behavior of the Load Checkpoint node.

Previously, the node only displayed images located in the root of the input folder. This made organizing and managing a large number of input images difficult.
2026-01-26 22:05:11 +01:00

View File

@ -1695,19 +1695,24 @@ class PreviewImage(SaveImage):
"hidden": {"prompt": "PROMPT", "extra_pnginfo": "EXTRA_PNGINFO"},
}
class LoadImage:
@classmethod
def INPUT_TYPES(s):
input_dir = folder_paths.get_input_directory()
files = [f for f in os.listdir(input_dir) if os.path.isfile(os.path.join(input_dir, f))]
files = folder_paths.filter_files_content_types(files, ["image"])
image_paths = []
for root, _, files in os.walk(input_dir, followlinks=True):
image_files = folder_paths.filter_files_content_types(files, ["image"])
for image_file in image_files:
path_relative = os.path.relpath(os.path.join(root, image_file), input_dir)
path_relative = path_relative.replace('\\', '/')
image_paths.append(path_relative)
return {"required":
{"image": (sorted(files), {"image_upload": True})},
{"image": (sorted(list(set(image_paths))), {"image_upload": True})},
}
CATEGORY = "image"
SEARCH_ALIASES = ["load image", "open image", "import image", "image input", "upload image", "read image", "image loader"]
RETURN_TYPES = ("IMAGE", "MASK")
FUNCTION = "load_image"
def load_image(self, image):