Nodes/ComfyUI_DAO_master/Folder File Pro (dir → file_path)
ComfyUI Node

Folder File Pro (dir → file_path)

Folder File Pro

By orion4d·Created about a year ago·Updated 12 months ago· 11
Folder File Pro (dir → file_path)
    • file_path
    • filename
    • dir_used
    • files_json
    • file_info
    directoryinput
    extensions
    name_regex
    regex_modeinclude
    regex_ignore_casetrue
    sort_byname
    descendingfalse
    seed_modemanual
    seed0
    index0

    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 (default input) - relative to ComfyUI's working directory, so input = ComfyUI/input.
    • extensions - filter list; empty means everything. The node classifies .svg separately 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 only tile_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.

    CategoryDAO_master

    Inputs (10)

    NameTypeDefaultDescription
    directorySTRINGinput
    extensionsSTRING
    name_regexSTRING
    regex_modeCOMBOinclude2 options: include, exclude
    regex_ignore_caseBOOLEANtrue
    sort_byCOMBOname3 options: name, mtime, size
    descendingBOOLEANfalse
    seed_modeCOMBOmanual5 options: manual, fixed, increment, decrement, randomize
    seedINT0-2147483648–2147483647
    indexINT00–1000000000

    Outputs (5)

    NameTypeDescription
    file_pathSTRING
    filenameSTRING
    dir_usedSTRING
    files_jsonSTRING
    file_infoSTRING