🎈VRAM-Cleanup
VRAM-Cleanup
- anything
- output
If you've ever chained two big models in one graph - image-to-video and then an upscale, or a Flux pass followed by a second model - and watched ComfyUI throw an out-of-memory error on the second stage even though each one runs fine alone, this node is for that exact moment. VRAM-Cleanup forces your GPU to let go of what the last stage was holding, so the next stage starts with a clean tank instead of tripping over leftovers.
Why you'd reach for it
ComfyUI usually manages VRAM on its own - it loads and unloads models as the graph needs them, and most of the time you never think about it. But "most of the time" isn't "always." When you stack multiple large models in a single workflow, or run back-to-back generations after enabling something like sage attention, VRAM doesn't always get handed back between stages. It piles up until the card OOMs or the whole machine crawls. The community fix is boring and reliable: drop a clear-VRAM node at the seam and force the release yourself.
This isn't a unique node - KJNodes, Easy-Use, and a handful of other packs ship their own version, and LAOGOU-666's Memory_Cleanup is one more option in that category rather than a category-definer. They all do roughly the same job. If you already have one you like, you don't need this. If you don't, this one's fine.
How it works
The node exposes two switches, both on by default:
- offload_model - unloads the model(s) from the GPU. Worth knowing: "offload" means moved to system RAM, not deleted outright. That's deliberate - the model can reload faster next time - but it's why some people notice the model bouncing to RAM rather than truly vanishing. It frees VRAM, which is the point.
- offload_cache - clears the cached GPU memory (the CUDA allocator's reserved-but-idle pool), which is often the sneaky chunk that OOMs the next stage.
There's also an anything input (type *, accepts literally anything) and a matching output. This is the part beginners miss. VRAM-Cleanup is a pass-through: you wire the result of the stage you want finished into anything, and continue your graph from the node's output. That forces ComfyUI's execution order to run the cleanup between the two stages instead of at some arbitrary time. Plug it in dangling and it may fire too early or not where you meant.
Installing it
Easiest path is ComfyUI Manager - open it, search the pack title Comfyui-Memory_Cleanup, install, restart. The node shows up under the Memory Management category.
Manual install, from the README:
cd ComfyUI/custom_nodes
git clone https://github.com/LAOGOU-666/Comfyui-Memory_Cleanup.git
pip install -r requirements.txt
Then restart ComfyUI. There's a requirements.txt, so don't skip the pip step. No model files to download - it's a pure utility node.
Common issues
- "I added it but nothing changed." Almost always placement. It has to be in the execution path between the two stages, via the
anything→outputpassthrough, or ComfyUI won't run it when you expect. Route your latent/image through it. - It offloads to RAM, so watch your system memory. If your RAM is also tight, pushing the model there can shove you into swap and tank speed. On a healthy machine it's a non-issue.
- It won't fix a model that doesn't fit at all. Clearing VRAM between stages solves multi-stage OOM. It does nothing for "this single model is too big for my card" - that's a job for GGUF/fp8 quantization or
--lowvram, not a cleanup node. - Standard custom-node caveat: like every ComfyUI extension, this is arbitrary Python running with full OS access. It's a tiny, readable utility, so low risk - but it's why the install asks for a pip step.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| offload_model | BOOLEAN | true | — |
| offload_cache | BOOLEAN | true | — |
| anythingopt | * | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| output | * | — |