VAE Decode
The same job as core, with a log that tells you the truth
- samples
- vae
- ui_widget
- image
- image_list
Let's be straight: ComfyUI already has a core VAE Decode node, and if all you're doing is decoding one SDXL latent into one image, you don't need this one. LF_VAEDecode is the lf-nodes version of the same job, and its reasons to exist are the details - it accepts lists, reshapes 5D video latents automatically, and logs exactly what it did (shapes, compression factors) into a readable widget instead of failing silently or printing to a console you never look at. When you're decoding batches or debugging why a video latent came back wrong, that log is the difference between five minutes and an afternoon.
How it works
Under the hood it's a thin, careful wrapper around the VAE itself: take the latent's samples tensor, call vae.decode(), and hand the result to the standard IMAGE output. Two behaviors matter in practice. First, if the decoded tensor comes back 5-dimensional (batch × time × channels × height × width - the shape a video VAE like Wan's produces), it reshapes it to 4D so downstream image nodes don't choke on it. Second, it interrogates the VAE for its spatial and temporal compression factors and logs them - so a decoding video latents mismatch shows up as numbers on the node instead of a mystery.
That compression logging is the genuinely useful bit. Every architecture has its own incompatible autoencoder, and video VAEs compress time as well as space; seeing spatial compression 8, temporal compression 4 on the node tells you at a glance what latent you're actually dealing with and whether the shapes make sense.
The inputs that matter
- samples (LATENT) - the latent to decode. Accepts a list of latents too.
- vae (VAE) - the decoder. The right VAE is the one your checkpoint was trained with; swapping in a random one produces noise or flat color, not a subtle change.
Outputs are image (the decoded batch) and image_list (the same frames as a list, which is what you want for per-frame processing).
Install
Part of lf-nodes:
- ComfyUI Manager: search "LF Nodes", install, restart.
- Manual:
cd ComfyUI/custom_nodes && git clone https://github.com/lucafoscili/lf-nodes.git, restart.
No model downloads - you wire in a VAE you already load.
Common issues
- "I get noise / flat color." Wrong VAE for the model - channel counts and compression differ between architectures, and the error is exactly this. Double-check the checkpoint's intended VAE rather than blaming the node.
- Video latent came out as a strange shape. If it didn't reshape cleanly, the latent may not be a standard video latent. The node's log shows the pre/post shapes; compare against what the model's docs promise.
- Chained decode/encode costs detail. Every round trip through a VAE loses a little (the KB's VAE panel is blunt about this). If your img2img or inpainting pass looks progressively softer, it's the round trips, not a broken node.
- List handling gotcha: the node normalizes lists, so wiring a single latent vs a batch behaves consistently - but if your downstream node expects exactly one image, take it from the
imageoutput, notimage_list.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| samples | LATENT | The latent to be decoded. | |
| vae | VAE | The VAE model used for decoding the latent. | |
| ui_widgetopt | LF_CODE | [object Object] | — |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| image | IMAGE | Decoded image. |
| image_list | IMAGE | List of decoded images. |