Nodes/ComfyUI-CustomNodePacks/Folder Version Control (check / set)
ComfyUI Node

Folder Version Control (check / set)

Check or move the version counter — and the one thing it can't reset

By Code2Collapse·Created 7 months ago·Updated 2 days ago· 56
Folder Version Control (check / set)
  • trigger
  • status
  • current_version
  • next_version
actioncheck
labeldefault
value1
prefixv
padding3
base_path
date_formatMM-DD-YYYY

What it is

This pack's Folder Version Incrementer writes every render into a fresh version folder - output/<label>/<date>/v001/…, then v002, and so on - by scanning the directory rather than keeping a counter file. Which is robust, but it means the only way to see or move the counter is to look at and write the filesystem. That's this node.

Two actions, one dropdown:

  • check - reads the folder, reports how many versions exist and what the next one will be. Touches nothing.
  • set - creates empty placeholder directories up to value, so the next render comes out one after it. Use it to skip ahead, reserve a range, or stake out slots before a batch.

It replaces the pack's older separate Folder Version Check and Folder Version Set nodes, which shipped as two halves of the same job sharing six settings. Those are still registered (so old workflows load) but marked deprecated and hidden from the menu - if you see both in your node search results, use this one.

Inputs

  • action - check or set.
  • label - the folder name under the output directory, e.g. a shot name or a project. Default default.
  • value - set only. Creates v001 … v<value>, and the next run produces value + 1. Ignored when checking.
  • trigger - an any-type input. Wire any upstream output into it to control when this runs, which is the trick for sequencing it inside a graph instead of letting it fire whenever a node happens to be evaluated.
  • prefix (default v), padding (default 3), date_format (default MM-DD-YYYY; also DD-MM-YYYY and YYYY-MM-DD), and base_path (empty = ComfyUI's output directory) - the tooltips on each say the same thing: these must match the incrementer's. They're not cosmetic. A padding of 2 here against a padding of 3 there means this node is counting folders that the incrementer isn't writing into, and it will cheerfully report "0 versions" while your output directory fills up.
  • base_path - point both nodes at the same absolute directory if you're writing somewhere other than ComfyUI's output.

Outputs: status (a human-readable sentence - it reads like 'shot_a/09-23-2026': 4 version(s) exist - next will be v005.), current_version (int, 0 when there are none), next_version (int). The two numbers are the ones to wire if you want a graph to branch on how many takes already exist.

The catch worth internalising

There is no "reset" action, because there's no counter to reset. The version is derived from what's on disk, so the only way to go backwards is to delete or move the date folder. The node's own description says it: "To truly reset a label, delete its date folder from disk." That's not a missing feature - it's the whole design. A counter file is a single point of failure that gets out of sync with reality the moment someone clears their output folder; a directory scan is always true.

Two consequences people hit:

  1. Versions roll over at midnight. The date segment is part of the path, so yesterday's v004 doesn't stop today starting at v001. If you want one continuous numbering across days, that's a different node arrangement (or a base_path and a label without the date).
  2. Changing date_format orphans everything. Switch from MM-DD-YYYY to YYYY-MM-DD and the node starts counting in a folder that doesn't exist yet. The old versions are still on disk, just invisible to it now.

Install

ComfyUI Manager → search "CustomNodePacks", or:

cd ComfyUI/custom_nodes
git clone https://github.com/Code2Collapse/ComfyUI-CustomNodePacks

Restart ComfyUI. This node is pure filesystem work - no models, no VRAM, no OpenCV. The pack's required dependencies (opencv-python, scipy, safetensors) are all for the masking side; you don't need them for this, though a missing required package can stop the whole pack from importing. The README's warning applies as always: check pip list before installing requirements.txt, because it lists libraries ComfyUI already ships.

Common issues

  • It reports 0 versions while files exist. prefix, padding, date_format, label or base_path doesn't match the incrementer. Line them up; the tooltips exist because this is the failure mode.
  • The node seems to re-run (or not) at odd times. IS_CHANGED includes a fingerprint of the version directory, so a new folder appearing does invalidate its cache - but if you're sequencing it deliberately, drive it from the trigger input instead of relying on evaluation order.
  • set reserved more than you wanted. It creates directories; it doesn't delete them. Delete the placeholders - or the whole date folder - if you overshot.
Categoryutils

Inputs (8)

NameTypeDefaultDescription
actionCOMBOcheckcheck -> report how many versions exist and what comes next. Reads only; touches nothing. set -> create empty placeholder directories up to `value`, so the next run produces value+1. Use it to skip ahead or to reserve a range.
labelSTRINGdefaultFolder name to inspect, under the output directory.
valueoptINT11–999999'set' only: create placeholders up to this version number. Ignored when checking.
triggeropt*Optional any-type trigger. Wire any upstream output here to control when this runs.
prefixoptSTRINGvVersion prefix. Must match the incrementer's.
paddingoptINT31–10Zero-pad width. Must match the incrementer's.
base_pathoptSTRINGOverride base directory. Empty -> ComfyUI output dir.
date_formatoptCOMBOMM-DD-YYYYMust match the incrementer's.

Outputs (3)

NameTypeDescription
statusSTRINGHuman-readable description of what was found or done.
current_versionINTHighest version that exists (0 when there are none yet).
next_versionINTWhat the next incrementer run will produce.