BD Workflow Version Cache
An undo history for your whole workflow, saved automatically
- trigger
- status
- workflow_id
- version_count
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_changecatching 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_idkeeps 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.
Inputs (6)
| Name | Type | Default | Description |
|---|---|---|---|
| workflow_id | STRING | Name for this workflow (leave empty for auto-detect) | |
| max_versions | INT | 500–999 | How many versions to keep (0 = unlimited) |
| save_on_any_change | BOOLEAN | true | — |
| enabled | BOOLEAN | true | Toggle versioning on/off |
| triggeropt | * | Optional input to control execution order | |
| descriptionopt | STRING | Note to attach to saved version |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| status | STRING | — |
| workflow_id | STRING | — |
| version_count | INT | — |