Emu 3.5 VRAM Cleanup
The kitchen-sink memory janitor, with receipts
- any_input
- model
- vq_model
- passthrough
- status_report
- memory_diff
If Emu 3.5 Clear Cache is the "free my VRAM" button, Emu 3.5 VRAM Cleanup is the version that shows its work. It's the pack's most comprehensive memory node: four cleanup depths, before/after telemetry on both RAM and every GPU, a pass-through so you can wire it anywhere, and a status report you can actually read instead of guessing whether it did anything.
The mechanism is exactly what you'd hope: it snapshots your RAM usage plus per-GPU allocated/reserved/free memory (via psutil and torch), runs the cleanup level you picked, then snapshots again and hands you both reports plus a diff. The levels go:
- light (cache only) - just
torch.cuda.empty_cache(). Fast, low-stakes. - standard (cache + gc) - adds a garbage-collection pass and IPC buffer flush.
- aggressive (deep clean) - three GC rounds, CUDA synchronization across all devices, cache flush, and peak-memory-stat resets. For when something leaked and the normal pass isn't cutting it.
- nuclear (unload all models) - moves the wired model and VQ model to CPU and then runs the aggressive pass on top.
The inputs that matter
- cleanup_level - the four-option dropdown above.
- trigger -
BOOLEAN, defaults totrue. Set it to false and the node returns"Cleanup skipped"- a handy way to toggle cleanup without rewiring. - any_input - optional
*pass-through, so you can chain the node into a wire and get whatever came through back out ofpassthrough. - model / vq_model - optional; needed only if you want
nuclearorunload_modelsto actually move them. - unload_models -
BOOLEAN, defaults false. Force-unloads the models even at non-nuclear levels.
Outputs
- passthrough (
*) - whatever you fed in viaany_input. - status_report (
STRING) - the full before/after memory report, RAM and all GPUs. - memory_diff (
STRING) - the "here's what you freed" summary, with signed GB numbers.
Install
Same pack, same ritual:
cd ComfyUI/custom_nodes
git clone --recursive https://github.com/EricRollei/Emu35-Comfyui-Nodes.git emu35
cd emu35
pip install -r requirements.txt
Where you actually want it
Two placements. Before an Emu node, to start with a clean slate - which matters on 24GB cards where a crashed previous run leaves the allocator holding memory it shouldn't. And after an OOM error, as the first thing you run to claw back VRAM so you can relaunch without restarting ComfyUI. The memory_diff output is genuinely useful there: it tells you in GB whether the cleanup recovered what you thought it would, or whether the model is still sitting on the card and you need nuclear.
The honest caveat is the same one that applies to all memory nodes in this pack: cleanup recovers allocator state, it doesn't conjure headroom that a resident 34B model is legitimately using. If you're consistently OOMing mid-inference on a 24GB card, the actual fix is NF4 weights, the VQ model on CPU, and ComfyUI's --lowvram / --reserved-vram flags - this node just makes the crash-landing softer.
Inputs (6)
| Name | Type | Default | Description |
|---|---|---|---|
| cleanup_level | COMBO | 4 options: light (cache only), standard (cache + gc), aggressive (deep clean), nuclear (unload all models) | |
| trigger | BOOLEAN | true | — |
| any_inputopt | * | — | |
| modelopt | EMU_MODEL | — | |
| vq_modelopt | EMU_VQ | — | |
| unload_modelsopt | BOOLEAN | false | — |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| passthrough | * | — |
| status_report | STRING | — |
| memory_diff | STRING | — |