filter image files in load image dropdown (#7573)

This commit is contained in:
Christian Byrne 2025-04-13 06:27:59 +08:00 committed by GitHub
parent 22ad513c72
commit 73ecb75a3d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1654,6 +1654,7 @@ class LoadImage:
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"])
return {"required":
{"image": (sorted(files), {"image_upload": True})},
}