ComfyUI Node

Walk Folder

Hand files to a workflow one at a time

By Conor-Collins·Created 2 years ago·Updated about a year ago· 33
Walk Folder
    • file_path
    • file_info
    folder_path
    seed0
    file_extension*

    ComfyUI is great at processing one thing. Feeding it a whole folder of things is where it gets awkward. Walk Folder (class WalkFolderNode) is the pack's fix: point it at a directory and it hands you a file path, one per execution, so you can loop a folder of images through a loader, process each, save, and move on.

    The name is doing real work - "walk" means it traverses the folder structure, so subdirectories count too. Add a seed and an extension filter and you've got a batch-processing engine: reproducible order when you want it, shuffling when you want it, and no junk files getting mixed in.

    How it works

    Three inputs:

    • folder_path - the directory to walk
    • seed - controls the order the files come back in. Same seed, same order; change it and the iteration shuffles.
    • file_extension - filter by extension (default *, which means everything). Set it to .png (or whatever you're after) so you only get the files you actually want to process.

    Two outputs per step:

    • file_path (STRING) - the full path of the current file, ready to feed into a loader or a saver
    • file_info (STRING) - a companion string with basic details about the file - name, extension, the kind of thing you want when you're logging which file you just processed

    Where it fits

    This is a dataset-prep and batch-pipeline node. You've got 400 reference images in a folder; you want each one loaded, resized or processed, and saved out. Core ComfyUI can technically do that with a folder input, but this gives you the per-file control and a string output you can route into a saver's filename. It's also handy when the folder contents change between runs - the walker re-scans, so you don't hard-code a list that goes stale.

    The seed is the subtle part and it's worth understanding: for a reproducible batch (same order every run, so results line up with the same file numbers) keep the seed fixed. If you're deliberately randomizing your dataset order for variety, bump the seed.

    Installing it

    This node ships in ComfyUI-CoCoTools, which is deprecated - the README marks it unmaintained and the original repo URL has been 404ing on GitHub since at least August 2026. The successor repo (ComfyUI-CoCoTools_IO) doesn't carry this node. Install via ComfyUI Manager (search ComfyUI-CoCoTools) if it resolves, or manually:

    cd ComfyUI/custom_nodes
    git clone https://github.com/Conor-Collins/coco_tools
    

    Then the pack's requirements (Windows portable, from python_embeded/):

    python.exe -m pip install -r ./ComfyUI/custom_nodes/ComfyUI-CoCoTools/requirements.txt
    

    Restart ComfyUI after installing.

    Gotchas

    • The default extension is *, which pulls in everything - random files in the folder will get processed too. Set the filter unless you really want every file.
    • The seed controls order, not selection. If you're expecting the seed to skip files, it won't - that's what the extension filter is for.
    • Because the pack is abandoned, a folder-walker from a maintained utility pack is the sensible choice for long-lived batch jobs. For a one-off data prep pass, this one is fine.
    CategoryCOCO Tools/File Logistics

    Inputs (3)

    NameTypeDefaultDescription
    folder_pathSTRING
    seedINT0
    file_extensionSTRING*

    Outputs (2)

    NameTypeDescription
    file_pathSTRING
    file_infoSTRING