Iterator List Files
The node that turns a folder into a batch queue
- file_paths
The whole "Iterator" pack hangs off this one node. Iterator List Files scans a directory, keeps the files whose extensions you asked for, and hands you a sorted list of full paths. That doesn't sound like much until you remember what ComfyUI does with a list: wire a list into a single-value input and the graph executes once per item. This node is what converts "a folder of stuff" into "a queue of jobs."
It's a genuinely small trick, and that's the point. There's no loop engine here, no scheduler, no Iterator control flow node. The pack leans entirely on ComfyUI's native list expansion - OUTPUT_IS_LIST is set in the source, so the moment you connect file_paths into something, the downstream node fires for every entry. That's why the pack is a few hundred lines and zero dependencies. The flip side: it lives and dies with that native behavior. If a ComfyUI update ever changes how list expansion works, this is the kind of pack that breaks first (the community has seen exactly that with the older, heavier comfyui-job-iterator).
Inputs that actually matter
Three fields, and only two you'll touch:
directory(required, STRING) - the path to scan. You can type it straight into the widget. Use an absolute path; a relative one resolves against wherever you launched ComfyUI, which is almost never where you think it is.extension(optional, STRING) - comma-separated, case-insensitive, no dots needed:png, jpg, txt. Defaults topng, jpg, jpeg, webp, bmp, txt, json, csv, md- note it lists text files too, not just images.limit(optional, INT) - cap how many files come back.0means all of them.
The node doesn't recurse into subfolders - it's a flat os.listdir, one level deep. Results are sorted alphabetically before the limit is applied, so a given folder always produces the same order. For batch work that's a small blessing: reproducible runs.
Output
file_paths- a list of STRING, the full path of every matching file. Wire this intoIterator Load ImageorIterator Load String, or any other node that eats a STRING.
Install
Boring in the best way. No model downloads, no requirements.txt beyond an empty file - the nodes only use PIL, numpy, and torch, all already inside ComfyUI. Install via ComfyUI Manager (search "ComfyUI Iterator Nodes" or "Iterator"), or:
cd ComfyUI/custom_nodes
git clone https://github.com/AIMovieStudio/comfyui-iterator
Then restart ComfyUI. That's it.
Where people get burned
- Directories get listed too. The filter only checks the extension, not that the path is actually a file. A folder literally named
logo.pngpasses the filter, then crashes your loader downstream withFileNotFoundError. - No recursion. Nested folders are invisible. If your images live in subfolders, you'll need one List Files per folder, or flatten them.
- Relative paths bite. Absolute path in
directory, or expect confusion. - It's not magic. Nearly zero search impressions, tiny repo, a small studio behind it. Don't expect a big ecosystem or long support thread - expect exactly what it says on the tin.
Honest take: if all you want is to shove a whole folder through the same pipeline as one big batch, ComfyUI's built-in batch image loader may already be enough. This pack earns its keep when you need per-file runs with per-file results - a separate save per image, or behavior that branches on which file you're looking at. For that, List Files plus one of the loader nodes below is the whole workflow.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| directory | STRING | — | |
| extensionopt | STRING | png, jpg, jpeg, webp, bmp, txt, json, csv, md | — |
| limitopt | INT | 00–18446744073709550000 | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| file_paths | STRING | — |