WanVideo VAE Loader
The small file that decodes your Wan latents
- compile_args
- vae
Wan generates in latent space - a compressed representation - and something has to turn those latents back into actual pixels. That's the VAE, and this node loads it. It reads the Wan VAE file from ComfyUI/models/vae (the node says so itself) and outputs a WANVAE that feeds the decode node at the end of your graph and the image-to-video encode node at the start.
It's a tiny node for a tiny file, but it's not optional and it's a separate download. People who grabbed the big diffusion checkpoint and the T5 encoder sometimes forget the VAE and then wonder why the graph won't complete.
How it works
Wan uses a 3D causal VAE - "3D" because it compresses across time as well as space, which is what lets a video model keep temporal coherence in latent space. That temporal compression is roughly 4x, which is the origin of Wan's famous "4n+1" frame-count quirk: frame counts that don't line up with the VAE's stride come back a couple of frames short. The VAE itself is the same small model regardless of whether you're running 14B or 5B, so you download it once.
The inputs and outputs that matter
model_name- the VAE file frommodels/vae. Kijai packages the Wan VAE alongside the rest of the weights; grab it and drop it in.precision(optional) -bf16by default, which is fine.fp32is available if you ever suspect the VAE of introducing artifacts, but you rarely need it.use_cpu_cache(optional) - keeps the VAE cached in system RAM. Useful when you're tight on VRAM and want the GPU handed fully to the diffusion model.compile_args(optional) - you can torch.compile the VAE too, via WanVideoTorchCompileSettings, for a little extra decode speed if you already have Triton set up.
Output is a single WANVAE, which both WanVideoDecode and WanVideoImageToVideoEncode consume.
How to install it
Comes with the pack. Via ComfyUI Manager: search WanVideo Wrapper, install, restart. Manually:
cd ComfyUI/custom_nodes
git clone https://github.com/kijai/ComfyUI-WanVideoWrapper
pip install -r ComfyUI-WanVideoWrapper/requirements.txt
then restart. The node is nothing; the Wan VAE file is the download, and it lives in models/vae.
Common issues & troubleshooting
Empty dropdown. The VAE file isn't in ComfyUI/models/vae, or ComfyUI hasn't rescanned. Add it and restart.
Colors or contrast look wrong after decode. Make sure you're using the Wan VAE, not a VAE from a different model family. Wan's VAE isn't interchangeable with SD/SDXL/Flux VAEs; a mismatched VAE decodes to garbage or washed-out output.
VAE step runs out of memory on long or high-res clips. That's not this loader's problem to solve - it's the decode node's. Enable tiling on WanVideoDecode (enable_vae_tiling) to decode in chunks. The loader just hands over the model; how it's used at decode time is where OOM gets fixed.
Your clip is a couple of frames shorter than you asked for. That's the 4x temporal compression, not a bug. Ask for frame counts that fit the VAE's stride (the 4n+1 pattern - 81, 77, etc.) and you'll get back exactly what you requested.
Inputs (5)
| Name | Type | Default | Description |
|---|---|---|---|
| model_name | COMBO | These models are loaded from 'ComfyUI/models/vae' | |
| precisionopt | COMBO | bf16 | 3 options: fp16, fp32, bf16 |
| compile_argsopt | WANCOMPILEARGS | — | |
| use_cpu_cacheopt | BOOLEAN | false | Reduces VRAM usage, but slows the VAE down a lot |
| verboseopt | BOOLEAN | false | Enables memory usage logging when using the model |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| vae | WANVAE | — |