Load Images From Folder YC
Load a whole folder of images — single, batch, random, or stepping through one by one
- image
- filename
ComfyUI's built-in Load Image wants one file from its dropdown, which is maddening when you're trying to process a directory of frames or a batch of crops. Load Images From Folder YC fixes the actual complaint: point it at a folder and it pulls images in single, batch, incremental, or random mode, and hands you the filename alongside so you can keep track of what you're looking at.
The killer feature is incremental. You set a label (default "batch 001"), and every time the graph runs, it advances to the next image in the folder, wrapping around at the end. No manual index bumping. That's the difference between "run 40 images by hand" and "queue the workflow 40 times and check the results later." Pair it with a batch-processor or an upscaler and you have a poor man's batch pipeline.
How it works
It scans the target directory for files matching image_pattern (default *.png;*.jpg;*.jpeg;*.webp, semicolon-separated), sorts them, and then the mode decides what happens:
single- load the file atimage_index.incremental- load the next one each run, keyed to yourlabel. Change the path or pattern and the index resets.random- pick one usingseed, so you can reproduce a pick.batch- load all matching images into one batched tensor at once.
path_type picks the source: input_dir (your ComfyUI input folder, with folder_name letting you choose a subfolder, including <root>), or custom_path for an arbitrary absolute path. output_filename toggles whether the filename output carries a value, and allow_RGBA keeps the alpha channel instead of flattening.
Outputs
image (IMAGE) and filename (STRING). In batch mode the filename output is all names joined with semicolons, which is rough but readable. The filename is also cached per-label internally, so it survives even when you turn the output off.
Install
From the ComfyUI-YCNodes pack. ComfyUI Manager → search "ComfyUI-YCNodes", or:
cd ComfyUI/custom_nodes
git clone https://github.com/yichengup/ComfyUI-YCNodes
Restart ComfyUI. Only standard deps (torch, numpy, pillow, opencv-python, scipy), no models to download.
Where people get burned
Three traps, all real. First: batch mode does a torch.cat across all images, so if your folder mixes resolutions, it errors out. Sort by size or normalize first. Second: allow_RGBA produces 4-channel tensors, and most ComfyUI image nodes expect 3 - leave it off unless you genuinely need alpha. Third: the default custom_path is a Windows path (C:/Users/Pictures); on Linux that folder won't exist, and the node silently returns a 64×64 black image as a sentinel rather than erroring. That silent black frame is the kind of thing that wastes an hour, so check your path. Also note incremental state lives per-label, not per-folder - two workflows sharing a label will step on each other.
Inputs (10)
| Name | Type | Default | Description |
|---|---|---|---|
| path_type | COMBO | 2 options: input_dir, custom_path | |
| mode | COMBO | 4 options: single, incremental, random, batch | |
| seed | INT | 00–18446744073709550000 | — |
| image_indexopt | INT | 00–99999 | — |
| folder_nameopt | COMBO | 2 options: <root>, 3d | |
| custom_pathopt | STRING | C:/Users/Pictures | — |
| labelopt | STRING | batch 001 | — |
| output_filenameopt | COMBO | 2 options: true, false | |
| allow_RGBAopt | COMBO | 2 options: false, true | |
| image_patternopt | STRING | *.png;*.jpg;*.jpeg;*.webp | — |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| image | IMAGE | — |
| filename | STRING | — |