Nodes/ComfyUI-ClipProj/ClipProj Free VRAM
ComfyUI Node

ClipProj Free VRAM

The free button that actually frees it

By nicolab28·Created 16 days ago·Updated 9 days ago· 115
ClipProj Free VRAM
  • after
  • after
  • info
scopeClipProj encoders

The ClipProj loaders have a resident mode that pins a text encoder to a GPU so ComfyUI's memory manager can't move it. That pinning is load-bearing - without it, ComfyUI would think it had freed VRAM that's still occupied and quietly OOM you. But it has a side effect the README states in plain terms: pinned encoders never leave on their own.

Sooner or later you'll want the VRAM back. Maybe you're switching from MiniMax H3 to another family mid-session. Maybe you loaded a big encoder just to render a reference and the diffusion model now needs the whole card. That's what this node is for: a forced release, on demand, placed where you need it in the graph.

What it frees

The single input that matters is scope:

  • ClipProj encoders (default) - unpins and moves every encoder this pack loaded back to RAM, and clears the projection caches. The caches matter more than you'd think: each loaded projection keeps the matrix, the statistics, and the residual network on the card, and no one else frees those. The author measured a 9.33 GB encoder failing to load onto a 12 GB card that had 1.85 GB of leftovers - so this isn't cosmetic.
  • all models - the same, plus ComfyUI's global unload, including the diffusion model and the VAEs.

There's also an optional after input, which accepts anything. It's there purely for execution order: wire whatever has to finish first into it, and the purge happens after that node runs. The outputs are after (the same value passed through, so you can keep chaining) and info, a STRING that reports how much got freed - N encoder(s) freed, X.XX GB, plus a note when the global unload ran. If you want to see the number, wire info into a text display node.

Where you'd actually use it

Two honest use cases. The first: you're running a workflow that loads a resident encoder, and a later workflow in the same session loads another big model - stick a ClipProjFree between them with all models and you skip the OOM dance. The second: the pack's own "Free model and node cache" button now reaches pinned encoders too (it unpins them first, since they ignore the global unload by design), but that button is for you to click; this node does the same job inside the graph, at a defined point in execution. If you never leave resident mode, you may never need it - streaming and dynamic fold back to RAM on their own.

Install

cd ComfyUI/custom_nodes
git clone https://github.com/nicolab28/ComfyUI-ClipProj

Restart ComfyUI (Manager: search "ComfyUI-ClipProj"). No requirements.txt, no pip install - torch and ComfyUI's own modules only. Needs ComfyUI 0.31.0+. There are no model files to download for this node; it just cleans up after the rest of the pack.

What to check when it looks wrong

The info string is your diagnostic. If it reports a small number and you're sure you loaded an encoder, check that you're on a recent version of the pack - early releases didn't clear the projection caches, so the freed total lied low by half a GB or more. And remember the honest limit: this node only frees what the pack knows about. A model loaded by a stock ComfyUI loader won't show up in the "ClipProj encoders" scope; that's what all models is for.

CategoryClipProj

Inputs (2)

NameTypeDefaultDescription
scopeCOMBOClipProj encoders'all models' also calls ComfyUI's global unload, including the diffusion model and the VAEs.
afteropt*What must finish before the purge

Outputs (2)

NameTypeDescription
after*
infoSTRING