🔥LoadImageFromDir
Hand ComfyUI a list of image paths from a folder
- image_paths
LoadImageFromDir is the front door of the pack's auxiliary "image plumbing" chain. It doesn't load images into ComfyUI's image space - instead it returns a list of file paths from a directory, sorted by filename. That sounds like a minor distinction, but it's the whole point: this pack is built around working with files on disk, and a path list is what the other auxiliary nodes consume (ImageCopy to organize them, ImagePath2Tensor to turn them into actual IMAGE tensors). Think of it as the file-browser node that ComfyUI's built-in LoadImage never was, because it grabs everything in a folder in one go.
How it works
It lists the directory, filters for image extensions (.jpg, .jpeg, .png, .gif, .bmp, .tiff), sorts by filename, and slices a range out based on your start_index and length. It's pure filesystem work - no decoding, no GPU, instant. The result is a Python list of full paths passed out as a LIST type.
The inputs that matter
- images_path - the directory to scan.
- start_index - skip this many images from the start of the sorted list (default
0). - length - how many to take. Default
0means everything - which is a small trap if you were hoping0meant "nothing." To pull a specific window, setlengthand, if needed,start_index. Slicing is by filename sort order, not by any notion of "first N frames."
Outputs
One output: image_paths, a LIST of strings. Feed it into ImageCopy (to stage files into an output folder) or ImagePath2Tensor (to turn them into an IMAGE batch for processing).
Install
This node lives in the ComfyUI-FFmpeg pack under the "auxiliary tool" category. Install via ComfyUI Manager (search "ComfyUI-FFmpeg") or:
cd ComfyUI/custom_nodes
git clone https://github.com/MoonHugo/ComfyUI-FFmpeg
cd ComfyUI-FFmpeg
pip install -r requirements.txt
Restart ComfyUI. (And yes - FFmpeg on PATH, same as every node here.)
Gotchas
- It sorts by filename string, not numerically - so
frame_2.pngsorts afterframe_19.png. If your frames come from the pack's own Video2Frames (zero-paddedframe_%08d.png), you're fine. Third-party exports may not be. - The path list is only as useful as the paths are real - if you move or delete files mid-graph, downstream nodes fail at load time.
- There's no validation that the directory has images; an empty list comes back silently. If your downstream suddenly does nothing, check the folder.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| images_path | STRING | C:/Users/Desktop/ | — |
| start_index | INT | 0 | — |
| length | INT | 0 | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| image_paths | LIST | — |