Nodes/ComfyUI-LoaderUtils/Load VAE (Any)
ComfyUI Node

Load VAE (Any)

The codec loader, and the one this pack is basically built to demo

By lrzjason·Created 8 months ago·Updated 8 months ago· 88
Load VAE (Any)
  • any
  • VAE
vae_name

The VAE is the codec between the compressed latent space where diffusion actually happens and the pixels you see on screen - it decodes your sampler's output into an image, and encodes images back into latents for img2img and inpainting. VAELoader_Any loads one, and it's the node the pack's own README uses as its flagship example of why this whole thing exists.

What it loads

One input that matters: vae_name, picked from your models/vae folder. There's a special entry worth knowing about - pixel_space. As of 2026 a handful of models (HiDream-O1, and pixel-space conversions of Z-Image Base) diffuse directly on pixels and have no VAE at all; ComfyUI's stock accommodation for that is this pixel_space choice, which acts as a pass-through since there's nothing to decode. If you're running one of those models, that's what you want here - not a missing-node error, just this option.

Why this node gets staged first in the README

The pack's own worked example connects VAELoader_Any after the KSampler, so the VAE only loads once sampling is actually finished and something needs decoding. That's the pattern the any input exists to enable: every loader in this pack adds one optional input beyond the stock version, which accepts anything and does nothing with the value - it's a pure ordering trick. ComfyUI's executor otherwise runs a loader the moment nothing blocks it, which for a node with no required upstream inputs is typically immediately, front-loading every model in the graph before the first real computation happens. Wire the KSampler's output (or anything downstream of it) into any, and the VAE simply won't occupy VRAM until decode time - genuinely useful, since a VAE you don't need until the very last step has no reason to sit loaded through the entire denoising run.

Installing it

ComfyUI Manager: search ComfyUI-LoaderUtils, install, restart. By hand:

cd ComfyUI/custom_nodes
git clone https://github.com/lrzjason/ComfyUI-LoaderUtils

Restart. No extra dependencies - it wraps ComfyUI's own VAE loader class. Drop your VAE file in models/vae as usual.

Where people get burned

Grey, washed-out output is the classic VAE complaint, and it's almost always a missing or mismatched VAE - but it's largely an SD 1.5-era problem now. Modern checkpoints bake their own VAE in, so on a current-generation model attaching an unrelated one is more likely to cause trouble than fix it. The rule that holds regardless of era: the right VAE is the one your checkpoint was actually trained against, not the one with the best reputation.

Black images or NaN output during decode is the other classic, specific to SDXL running in fp16 - the original SDXL VAE overflows because its internal activation values are too large for half precision. The fix is sdxl-vae-fp16-fix (a rescaled refit that keeps outputs identical while staying in fp16 range) or forcing fp32 decode. Don't reach for --disable-nan-check - it just skips the check while the model keeps producing NaN, and you still get black images, now with no warning.

And a small VRAM note in the other direction: every encode/decode round trip costs a little quality, which is why chained img2img and inpainting passes visibly grind an image down over several rounds - worth remembering if you're staging this node to run more than once in a workflow.

Categoryloaders

Inputs (2)

NameTypeDefaultDescription
vae_nameCOMBO1 options: pixel_space
anyopt*

Outputs (1)

NameTypeDescription
VAEVAE