Compare commits

...

3 Commits

Author SHA1 Message Date
rewolf
b2db16fac9
Merge d29145c3e8 into c4a14df9a3 2026-01-21 09:19:53 +08:00
rewolf
d29145c3e8
Merge branch 'master' into rewolf/LoadImage-subdir_traversal 2025-05-01 16:49:52 +09: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

@ -1651,7 +1651,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]
files = folder_paths.filter_files_content_types(files, ["image"])
return {"required":
{"image": (sorted(files), {"image_upload": True})},