Nodes/ComfyUI-DonutNodes/DonutManualCleanup
ComfyUI Node

DonutManualCleanup

The 'free my VRAM and reset caches' button

By DonutsDelivery·Created about a year ago·Updated about 15 hours ago· 25
DonutManualCleanup
    • status

    ComfyUI has a way of accumulating state the longer you work: the pack's model-merge machinery keeps caches around, memory pressure builds, and suddenly your next run is slower or OOMs. DonutManualCleanup is a single node with no inputs that does exactly what its name says - it triggers the pack's manual cleanup path and reports back. Think of it as the "have you tried turning it off and on again" button, but without the restart.

    It's not a workflow node. It's a maintenance utility from the pack's model-merging internals (it lives alongside the merge cache debug nodes in DonutWidenMerge.py), and it's aimed at the pack's own heavy machinery rather than ComfyUI in general. When you've been running merge-heavy workflows and things start misbehaving, this is the first lever to pull.

    How it works

    The node has no inputs, one status STRING output, and on execution it calls two internal routines: clear_merge_cache() - which wipes the pack's cached merge results - and force_cleanup(), the memory-management teardown that tries to free what the merge path was holding. The console prints a big "MANUAL MEMORY CLEANUP INITIATED … COMPLETE" block so you can watch it happen, and the returned status string is Memory cleanup completed at <timestamp>.

    Because it's a FUNCTION node with no inputs, wiring it into a graph means it runs whenever that part of the graph executes. The pragmatic way to use it is a dead-end branch with a trigger - or just double-click it in the graph and run.

    Install

    Standard pack install:

    cd ComfyUI/custom_nodes
    git clone https://github.com/DonutsDelivery/ComfyUI-DonutNodes.git donutnodes
    cd donutnodes
    python -m pip install -r requirements.txt
    

    or ComfyUI Manager → "DonutNodes," then restart.

    When to actually use it

    Reach for this when: a merge or stack-apply result isn't changing after you changed inputs (the pack's own cache-invalidation history says stale merges happen), or when you've been chaining heavy model-merging nodes and the GPU starts thrashing. It's the cheap first step in a debugging session - run cleanup, then re-run, before you restart ComfyUI. It won't fix everything (it can't clear ComfyUI's own caches, and it won't free VRAM that the sampler itself is holding), but for the pack's merge state it's exactly the reset you want. If a restart is still needed after, you've at least ruled out the pack's cache as the culprit.

    Categorydonut/utils

    Inputs (0)

    No inputs

    Outputs (1)

    NameTypeDescription
    statusSTRING