Folder File Pro (dir → file_path)
Folder File Pro
- file_path
- filename
- dir_used
- files_json
- file_info
The stock ComfyUI Load Image has you scroll a dropdown and click. Fine for a one-off. Useless when you want a workflow to march through 500 files by itself. Folder File Pro is the pack's answer: it lists a directory, filters and sorts the files, and picks one - by index, by seed, by pattern - then hands you the chosen path plus a JSON dump of everything else in the folder. Feed its file_path into Path To Image or Load Image Pro and you've got a proper batch loop without any scripting.
How it works
The node lists files in directory, optionally filters them by extension and a filename regex, sorts them (name, mtime, or size, ascending or descending), and then selects one file. The selection mode is where the automation lives:
- manual - pick by
index(the default; safe, predictable). - fixed / increment / decrement - seed-driven selection.
- randomize - seeded random pick, so it's reproducible given the same seed.
The node also spins up a small web interface (it hooks into ComfyUI's server API) that gives you a real folder browser, thumbnails for images, an index resolver, and even an "open in explorer" button - the web/ UI this pack ships. That's a genuinely nice touch: you can visually find the file you want and the node resolves its index for you.
Inputs that matter
directory(defaultinput) - relative to ComfyUI's working directory, soinput=ComfyUI/input.extensions- filter list; empty means everything. The node classifies.svgseparately from images/video/audio, so this is a real filter, not just a string match.name_regex+regex_mode(include/exclude) +regex_ignore_case- filter filenames by pattern. The "include" mode is how you grab onlytile_r01_c03.png-style names.sort_by,descending- ordering.seed_mode,seed,index- the selection mechanism above.
Outputs
Five outputs: file_path (the chosen file's path - the one that matters), filename, dir_used (the resolved absolute directory), files_json (JSON of every listed file's name/path/size/mtime), and file_info (JSON metadata for the chosen file). If the directory is empty, the file outputs come back empty rather than erroring, so your workflow can keep running.
How to install
Part of the orion4d/ComfyUI_DAO_master pack:
cd ComfyUI/custom_nodes
git clone https://github.com/orion4d/ComfyUI_DAO_master.git
pip install -r requirements.txt
Restart ComfyUI. The interactive UI needs ComfyUI's server (aiohttp, which ships with ComfyUI), and thumbnails use Pillow - both standard.
Common issues
The #1 confusion is relative paths: directory resolves against ComfyUI's working directory, not your last-saved folder. If the node returns empty and you know the folder has files, check whether you meant an absolute path or input-relative. Also, increment and decrement seed modes don't actually advance per run in the shipped code - they resolve to the same seed-based selection as fixed - so for a genuine "next file each run" behavior, drive index from a counter node instead of expecting the seed modes to do it for you.
Inputs (10)
| Name | Type | Default | Description |
|---|---|---|---|
| directory | STRING | input | — |
| extensions | STRING | — | |
| name_regex | STRING | — | |
| regex_mode | COMBO | include | 2 options: include, exclude |
| regex_ignore_case | BOOLEAN | true | — |
| sort_by | COMBO | name | 3 options: name, mtime, size |
| descending | BOOLEAN | false | — |
| seed_mode | COMBO | manual | 5 options: manual, fixed, increment, decrement, randomize |
| seed | INT | 0-2147483648–2147483647 | — |
| index | INT | 00–1000000000 | — |
Outputs (5)
| Name | Type | Description |
|---|---|---|
| file_path | STRING | — |
| filename | STRING | — |
| dir_used | STRING | — |
| files_json | STRING | — |
| file_info | STRING | — |