Skip to content

Conversation

@molbal
Copy link

@molbal molbal commented Jan 26, 2026

This pull request addresses the limitation of the LoadImage node, which currently only searches for images in the root of the input directory.

The LoadImage node was enhanced to recursively scan the input directory and all of its subdirectories for image files. This brings its behavior in line with other loader nodes (like Load Checkpoint) and allows users to better organize their input files into folders.

The implementation was changed from using os.listdir to os.walk within the INPUT_TYPES method to build the file list. The file paths displayed in the dropdown menu now include their relative path from the input directory (e.g., mydirectory/myimage.png), making them easy to identify.

I tested this change by:

  1. Creating a new folder structure inside my ComfyUI/input directory.
  2. Placing image files at the root level and within the new subdirectories.
  3. Reloading the ComfyUI web UI and verifying that the LoadImage node's dropdown list correctly showed all images from both the root and the subdirectories.
  4. Selecting an image from a subdirectory and confirming it was correctly loaded and processed in a simple workflow.

This simply expands the search scope for files and uses existing path-handling functions. Performance impact should be negligible unless the input directory contains an exceptionally large number of files and folders.

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.
@molbal
Copy link
Author

molbal commented Jan 27, 2026

image Tested on Windows 11 (both running natively and in WSL2) and also in Ubuntu 24.04.3 LTS

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant