1
mirror of https://github.com/comfyanonymous/ComfyUI.git synced 2025-08-02 15:04:50 +08:00

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

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})},
}