Compare commits

...

2 Commits

Author SHA1 Message Date
rewolf
32aa3ab807
Merge ad1102fc1d into e346d8584e 2025-04-10 00:23:07 +02:00
rewolf
ad1102fc1d Modify LoadImage node to also traverse subdirectories of the input directory
Previously the LoadImage node only displayed direct file contents.

This change traverses the full directory tree under the `input_dir` using `os.walk`, including symlinks.
2025-03-12 16:03:25 +09:00

View File

@ -1653,7 +1653,8 @@ 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))]
strip_inputdir = lambda path: path[len(input_dir)+1:]
files = [strip_inputdir(os.path.join(dir,f)) for (dir, subdirs, files) in os.walk(input_dir, followlinks=True) for f in files]
return {"required":
{"image": (sorted(files), {"image_upload": True})},
}