ComfyUI Node

Preload VAE To GPU

Have the VAE waiting before you need to decode

By xmarre·Created 5 months ago·Updated 5 months ago· 2
Preload VAE To GPU
  • vae
  • VAE
stickytrue
priority0

Preload VAE To GPU forces a tracked VAE fully onto the GPU immediately - load_models_gpu(..., force_full_load=True) - marks it sticky with a priority, and passes the same VAE back out. It's the VAE arm of the pack's preload trio, and the use case is a specific one: make sure the encode/decode path is warm before the run actually needs it.

The situation it's built for is the graph where the VAE gets loaded lazily right when your decode step fires, at the end of a long generation. That's a small stall at the worst possible moment, and on a card already near its VRAM limit it can cascade into shuffling other models around. Preload the VAE early, pin it with a priority, and decode starts with the weights already resident. It pairs naturally with the pack's sticky_gpu policy, under which VAE offload stays on the GPU side and the patched VAE.encode/VAE.decode path works to protect that residency - capping batch when needed, falling back to tiled encode/decode on OOM.

The inputs, same shape as the other preload nodes:

  • vae - the VAE to force onto the GPU.
  • sticky - true marks it sticky after preloading. Default true.
  • priority - -100 to 100, default 0. Higher priority is protected first.

Output is the same VAE, passed through.

Honest calibration: a VAE is a few hundred MB, so preloading one is rarely a dramatic win. But VRAM churn is about more than raw bytes - an evicted-and-reloaded VAE can trigger a re-shuffle of everything else on a tight card, and preloading it flattens that whole class of problem. If you're running a video or high-res workflow where encode/decode happens multiple times per run, this is the node that makes each pass not start cold.

Same pack caveats as ever: preloads are process-lifetime, there's no cross-process persistence, and a force-load reserves memory you might have wanted lazy - so preload the VAE you actually reuse, and don't bother if your decode step never stalls. This is one of the lower-impression nodes in the pack, and honestly it's a niche tool; but in a workflow where the VAE keeps getting evicted, it's the exact right fix.

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 (3)

NameTypeDefaultDescription
vaeVAE
stickyBOOLEANtrue
priorityINT0-100–100

Outputs (1)

NameTypeDescription
VAEVAE