FREE VRAM (u5)
The node that actually clears the card between passes
- Any
- Bypass(Relay)
FREE VRAM (u5) is the flagship of the u5 FreeVRAM pack, and its pitch is refreshingly blunt: drop it anywhere in a workflow and it unloads every model, empties the CUDA cache, and runs garbage collection - without breaking the graph around it. ComfyUI already manages memory on its own, and for a single-pass job on a comfortable card this node buys you nothing. But there's a class of workflow where "automatic" isn't good enough: two-pass jobs on 8GB, long batches that slowly accumulate junk, shared GPUs where the previous tenant's models are still resident. That's the case this node was built for.
How it actually works
Under the hood it's a small orchestration around ComfyUI's own memory API, not some hacky fork. On execution it calls comfy.model_management.unload_all_models(), soft_empty_cache(True), torch.cuda.empty_cache() plus ipc_collect, cleanup_models_gc(), and gc.collect(2), then flags the prompt queue to unload models and free memory on the next idle tick. It even polls memory for a few seconds afterward to catch the delayed frees ComfyUI does in the background, and prints a report to the console ending in something like:
VRAM FREE (u5): Cleared: Models, Cache, GC | Freed: X.XX GB
One detail worth knowing: the node's IS_CHANGED returns NaN, which forces ComfyUI to re-run it on every queue rather than caching the result away. A memory cleaner that silently skips itself would be useless, and the author clearly agreed.
The two inputs that matter
- Any (optional) - a passthrough that accepts any data type. Leave it disconnected and the node works fine as the start of a workflow; wire something in and it comes out the other side unchanged.
- MinFreeVRAMGB - default
0.0. If free VRAM is already above this threshold, cleanup is skipped entirely. Set it to0.0to always force cleanup.
The one output, Bypass(Relay), just hands back whatever you fed into Any (or None). That's the trick that lets you use it as a gate: [rough pass output] → [FREE VRAM] → [next stage] guarantees the cleanup runs between the two.
Installing it
Through ComfyUI Manager, search "u5 FreeVRAM" and hit Install, or clone it manually:
cd ComfyUI/custom_nodes
git clone https://github.com/u5dev/comfyUI_u5_VramFREE
# restart ComfyUI
There are no model downloads and no heavy dependencies - the only optional one is psutil (for detailed RAM reporting, pip install psutil). Everything else is ComfyUI's own API, which is both the appeal and the ceiling: it can only free what ComfyUI and the driver can free.
Where people get burned
- The threshold is fuzzy. VRAM freeing is asynchronous, so the value you see in
nvidia-smilags reality and the README says so outright. Don't setMinFreeVRAMGBto your exact card size and expect precision - give yourself margin, or just use0.0. - Other processes eat your headroom. If a browser with hardware acceleration or a second ComfyUI instance is holding VRAM, this node can't conjure space you don't own. Check
nvidia-smibefore blaming it. - It's a surgical tool, not a magic box. The name overpromises slightly: it frees what ComfyUI and the GPU driver can free, which is a lot on a cramped card, but it won't make a model that doesn't fit suddenly fit. For the two-pass workflows below it's exactly the right tool; for a single pass on a 24GB card you're adding a no-op.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| Anyopt | IMAGE,LATENT,MODEL,CONDITIONING,CLIP,VAE,MASK,INT,FLOAT,STRING,BOOLEAN | — | |
| MinFreeVRAMGBopt | FLOAT | 0.0 | Skip cleanup when free VRAM is already above this threshold (GB) |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| Bypass(Relay) | IMAGE,LATENT,MODEL,CONDITIONING,CLIP,VAE,MASK,INT,FLOAT,STRING,BOOLEAN | — |