Nodes/ComfyUI-BerniniR/BerniniR · VAE Decode
ComfyUI Node

BerniniR · VAE Decode

Latent to frames, without the 4n+1 headache

By neuregex·Created 3 months ago·Updated 3 months ago· 24
BerniniR · VAE Decode
  • vae
  • latent
  • frames

BerniniR · VAE Decode is the node at the end of every graph in this pack: it takes the BR_LATENT from BerniniR · Sampler and the Wan VAE from BerniniR · Load VAE (Wan), runs the decode, and hands you a plain ComfyUI IMAGE batch you can preview or save.

It exists because the pack's sampler produces a custom latent type, and the stock VAEDecode doesn't speak it. Under the hood it's straightforward: push the VAE to the GPU, decode, clamp to [−1, 1], rescale to [0, 1], and reorder to ComfyUI's [T, H, W, C] frame layout. It offloads the VAE afterwards so the big experts get the GPU back.

Inputs

  • vae (BR_VAE) - from BerniniR · Load VAE (Wan).
  • latent (BR_LATENT) - from BerniniR · Sampler.

Output

frames (IMAGE) - a batch of frames in 0..1, ready for BerniniR · Save Video, a preview node, or anything else that eats a normal image batch. If you only want to eyeball the result, wire a preview node here and skip saving.

Why the frame count can surprise you

The Wan VAE compresses time ~4×, so decoded frames come back as (latents-1)*4+1. The pack's defaults (81 frames in, 81 out) are 4n+1-safe, so you won't notice on the standard graph. Where it bites: if you ever hand a hand-built latent of a non-4n+1 length to a node that assumes exact counts, or if you chain chunks. If your clip comes back two frames short, that's the Wan VAE's time compression, not a bug in this node - and it's a known community trap.

Install & troubleshooting

Shared pack install: ComfyUI Manager, or git clone https://github.com/neuregex/ComfyUI-BerniniR into custom_nodes plus pip install -r requirements.txt. The VAE comes from the downloaded bundle (no extra download). If decode is slow or the whole pipeline OOMs, remember the binding peak is sampling - the decode itself is lightweight; it's the 81-frame latent being resident that costs. For quick tests, generate a single frame (t2i task) first - the README suggests anchoring with a t2v/t2i run before you commit to full-length video anyway.

CategoryBerniniR

Inputs (2)

NameTypeDefaultDescription
vaeBR_VAE
latentBR_LATENT

Outputs (1)

NameTypeDescription
framesIMAGE