Nodes/BrainDead Nodes/BD Workflow Version Cache
ComfyUI Node

BD Workflow Version Cache

An undo history for your whole workflow, saved automatically

By BizaNator·Created 8 months ago·Updated 3 days ago· 15
BD Workflow Version Cache
  • trigger
  • status
  • workflow_id
  • version_count
workflow_id
max_versions50
save_on_any_changetrue
enabledtrue
description

You know the feeling: you spent three hours tuning a workflow, made "one small change," and now it's broken and you can't remember what you did. ComfyUI gives you manual save and a hand-crafted "Save As", but no timeline. This node is the timeline. BD Workflow Version Cache drops into a graph, watches the workflow, and automatically snapshots it every time something changes - version 1, version 2, version 3 - so you can always walk back to the state that worked.

It's a versioning system built from the workflow's own data: the node reads the workflow JSON (via ComfyUI's extra_pnginfo), hashes it, and whenever the hash changes, saves a clean ComfyUI-compatible JSON file to disk with a timestamp and metadata. Its siblings in the pack do the bookkeeping: BD Workflow Version List shows the history, BD Workflow Version Restore exports a version as a JSON you can drag back into ComfyUI, and BD Workflow Version Clear cleans up.

The inputs that matter

  • workflow_id - name your workflow, or leave empty and it auto-generates a stable ID from the workflow structure (wf_<hash>). If you leave it empty, the ID survives as long as the structure does; set a manual name if you want to track a workflow's evolution across structural rewrites.
  • max_versions (default 50) - how many snapshots to keep before pruning the oldest. 0 = unlimited, which means you'll eventually own a disk of JSON files.
  • save_on_any_change (default true) - save on any change (including seeds and volatile values), or only structural changes (node types and connections). For a pure "what did I break" history, structural-only is quieter; for forensics, leave it on.
  • enabled (default true) - the master kill switch. Handy when you've finished iterating and don't want every run spawning a new version.
  • description (optional) - a note attached to the saved version. If you're the organized type, this is how "v12" becomes "v12: swapped to 1536_cascade texture conditioning."

Outputs: status (what just happened - "Saved v12" or "No changes"), workflow_id (the resolved ID, wire it into the other version nodes so they all agree), and version_count.

Installation

Part of ComfyUI-BrainDead - ComfyUI Manager (search "BrainDead") or:

cd ComfyUI/custom_nodes
git clone https://github.com/BizaNator/ComfyUI-BrainDead
cd ComfyUI-BrainDead
pip install -r requirements.txt

No models, no extra dependencies. Versions are stored under output/BrainDead_Cache/workflow_versions/ - the same cache folder the pack's other cache nodes use.

Common issues

  • "No workflow data available" - the node couldn't find the workflow in extra_pnginfo. This happens when the graph is run in a way that doesn't carry workflow metadata (some API/server runs). Running from the normal ComfyUI UI works; a bare API call may not.
  • It saved a version on every run even though nothing changed - that's save_on_any_change catching volatile values like seed changes. If it's too chatty, switch to structural-only or set a fixed seed.
  • Versions vanished - check max_versions; it prunes automatically once you exceed the cap. That's the "0 = unlimited" option existing.
  • The same workflow_id keeps coming back - with auto-generated IDs it's derived from structure, so copy-paste workflows that look identical share a history. That's a feature if you want it; set a manual ID if you want separation.
Category🧠BrainDead/Cache

Inputs (6)

NameTypeDefaultDescription
workflow_idSTRINGName for this workflow (leave empty for auto-detect)
max_versionsINT500–999How many versions to keep (0 = unlimited)
save_on_any_changeBOOLEANtrue
enabledBOOLEANtrueToggle versioning on/off
triggeropt*Optional input to control execution order
descriptionoptSTRINGNote to attach to saved version

Outputs (3)

NameTypeDescription
statusSTRING
workflow_idSTRING
version_countINT