Nodes/arkennemasis Nodes/arkennemasis Run Folder (auto-numbered)
ComfyUI Node

arkennemasis Run Folder (auto-numbered)

One numbered output folder per run, wired into every save node

By Hishamahmer·Created 2 months ago·Updated 9 days ago· 9
arkennemasis Run Folder (auto-numbered)
    • folder_path
    • run_number
    • save_prefix
    parent_dir
    folder_namedataset
    padding3
    create_nowtrue

    You type a folder name. Each queued run resolves to the next free number - dataset_001, dataset_002 - and every save node wired to the output writes into that same folder. ArkRunFolder exists because "just put [time(%H-%M)] in the filename" doesn't work at scale: save nodes that support time tokens evaluate them at save time, so a graph writing 24 images over an hour scatters them across a half-dozen folders. This node resolves the path once per run, and every save reads the same string off one link.

    For the arkennemasis character-LoRA workflow - one photo in, a 25-image captioned dataset out, ready for kohya or ai-toolkit - it's the difference between a training folder and a crime scene. One run, one folder, _001 through the batch.

    How it works

    The node scans the parent directory for existing <folder_name>_NNN siblings and picks the next free number, so a manual _009 correctly yields _010. IS_CHANGED returns NaN, meaning ComfyUI never serves the path from cache - each queued run recomputes it and gets a fresh folder. Crucially, only the save nodes downstream re-execute: upstream generators stay cached, so re-running doesn't re-bill a paid API node. That's the property that makes it safe to re-queue a run you want to re-save.

    Inputs and outputs

    • parent_dir - where the run folders live. Relative paths resolve inside ComfyUI's output directory; blank = the output directory.
    • folder_name - the base name, default dataset.
    • padding - digits in the run number, 3_001.
    • create_now (true) - make the folder immediately; off returns just the path and lets the save node create it.
    • folder_path - the absolute path, if a node wants that.
    • run_number - the _001 number, if you want it in filenames or logs.
    • save_prefix - this is the one SaveImage/SaveVideo actually want. It's the same folder expressed relative to ComfyUI's output dir with forward slashes, because those nodes build their own path from filename_prefix and mangle an absolute one. Wire save_prefix into them, not folder_path.

    Install and gotchas

    Part of the arkennemasis pack:

    cd ComfyUI/custom_nodes
    git clone https://github.com/Hishamahmer/comfyui-arkennemasis
    pip install -r ComfyUI/custom_nodes/comfyui-arkennemasis/requirements.txt
    

    Restart, or install via ComfyUI Manager by repo URL.

    The one trap is wiring folder_path into SaveImage/SaveVideo and wondering why the files land somewhere weird - those nodes need save_prefix. And remember the cache caveat that comes with every NaN node: the folder node itself always runs, so don't hang anything expensive behind it directly. Use it the way it's meant to be used, as the one link all your saves share, and re-queuing a run costs you a re-save, not a re-bill.

    Categoryarkennemasis/Utility

    Inputs (4)

    NameTypeDefaultDescription
    parent_dirSTRINGWhere the run folders live. Relative paths resolve inside ComfyUI's output directory. Blank = the output directory.
    folder_nameSTRINGdatasetBase name you choose. Each run appends the next free number, so the same name never overwrites a previous run.
    paddingINT31–9Digits in the run number: 3 -> _001.
    create_nowBOOLEANtrueCreate the folder immediately. Off = only return the path and let the save node create it.

    Outputs (3)

    NameTypeDescription
    folder_pathSTRING
    run_numberINT
    save_prefixSTRING