ComfyUI Node

Evict VAE From GPU

Free the VAE's VRAM after the last decode

By xmarre·Created 5 months ago·Updated 5 months ago· 2
Evict VAE From GPU
  • vae
  • vae
  • eviction_status
unpatch_weightstrue

Evict VAE From GPU unloads a VAE from the current loaded-model set on demand and tells you whether it worked. VAE in, same VAE out, plus an eviction_status string: evicted or not_loaded.

The VAE is the classic "burst then idle" component. It's needed for encode at the front of a workflow and decode at the back, and between those two moments it just sits in VRAM. If you're about to load a big model into the middle of that gap, the idle VAE is dead weight - and on a tight card, dead weight is what makes an OOM. This node lets you give the memory back the moment the last decode is done, so the next heavy load doesn't have to evict things reactively.

The inputs:

  • vae - the VAE to evict.
  • unpatch_weights - default true, full unload path. Leave it on; the pack's patched unload redirects through a CPU offload target when a plain unload wouldn't actually reclaim VRAM.

Outputs: the same vae and eviction_status (evicted / not_loaded).

Like the other evict nodes, not_loaded isn't an error - it means the VAE wasn't in the loaded set, either because it was already unloaded or because it was never tracked (loaded through a path the pack's registry doesn't see). Reading the status is how an automated graph knows whether it actually freed anything.

Realistic expectations: evicting a VAE frees only a few hundred megabytes, so this is a precision tool, not a memory-management strategy. Its value is sequencing - reclaiming the VAE between the encode/decode phases so a heavy UNet load in between starts with maximum headroom. If you're on a 24 GB card with room to spare, you almost certainly don't need this node. If you're squeezing a big video model onto a smaller card and watching it OOM mid-run, clearing the VAE at the right moment is a legitimate lever.

The trap mirrors the other evict nodes: evict something you still need and you pay the reload, so place it after the last use. And eviction is process-lifetime - it frees VRAM in the running ComfyUI, not disk space, and nothing survives a restart.

Install with the pack:

cd ComfyUI/custom_nodes
git clone https://github.com/xmarre/ComfyUI-GPU-Resident-Loader
cd ComfyUI-GPU-Resident-Loader
pip install -r requirements.txt

Restart ComfyUI, or search "comfyui-gpu-resident-loader" in ComfyUI Manager.

CategoryGPU Resident Loader/residency

Inputs (2)

NameTypeDefaultDescription
vaeVAE
unpatch_weightsBOOLEANtrue

Outputs (2)

NameTypeDescription
vaeVAE
eviction_statusSTRING