Nodes/BrainDead Nodes/BD Workflow Version Clear
ComfyUI Node

BD Workflow Version Clear

The workflow-history janitor (with a safety catch)

By BizaNator·Created 8 months ago·Updated 3 days ago· 15
BD Workflow Version Clear
    • status
    workflow_id
    keep_latest0
    confirm_clearfalse

    Every version of your workflow the Cache node saves is a JSON file sitting in output/BrainDead_Cache/workflow_versions/. Save-on-every-change with a generous max_versions and you will eventually own a small pile of them - each one a full copy of the graph. That pile is exactly why this node exists: BD Workflow Version Clear deletes saved versions to free up space, with a two-step safety catch so you don't nuke your entire history by accident.

    It's the cleanup end of the four-node versioning family (Cache, List, Restore, Clear), and it's the boring one - which is a compliment. You'll reach for it when a project is wrapped and you don't need forty snapshots of a workflow you've moved past.

    The inputs

    • workflow_id - whose history to clear. Wire from the Cache node's workflow_id output (or the List node) rather than typing it, for the same auto-ID-mismatch reasons as the other version nodes.
    • keep_latest (default 0) - keep the N most recent versions and delete the rest. 0 means delete all of them. If you're clearing to reclaim space but want to keep a couple of checkpoints, this is the dial to set.
    • confirm_clear (default false) - the safety catch. Nothing is deleted until this is set to true. If it's off, the node runs in dry-run mode and tells you how many versions it would delete.

    Output is a single status string: in dry-run it reports "Would delete X of Y versions. Set confirm_clear=True to proceed." With confirmation on, it says how many it deleted.

    That default-false confirm_clear is genuinely well designed, by the way. It's the difference between "oops, I clicked the wrong thing and lost my history" and "oops, I clicked the wrong thing and nothing happened." Both of us have been the first version; this node insists on the second.

    Installation

    Standard BrainDead pack install:

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

    Or ComfyUI Manager → search "BrainDead". No models, no extra dependencies - it just deletes JSON files from the cache directory.

    Common issues

    • "Nothing happened" - confirm_clear is false, which is the designed behavior. Flip it to true and run again. If you keep it wired to a constant false value, you're permanently in dry-run; that's the node doing its job.
    • "No versions found" - wrong workflow_id, or you already cleared it. Check the ID against what the Cache node outputs.
    • I deleted too much - this one's on you, but it's why keep_latest exists. If you find yourself clearing aggressively, set it to 3-5 so you always keep recent checkpoints.
    Category🧠BrainDead/Cache

    Inputs (3)

    NameTypeDefaultDescription
    workflow_idSTRING
    keep_latestINT00–999Keep N most recent versions (0 = delete all)
    confirm_clearBOOLEANfalseMust be True to actually delete

    Outputs (1)

    NameTypeDescription
    statusSTRING