Nodes/ComfyUI-VideoHelperSuite/VAE Decode Batched πŸŽ₯πŸ…₯πŸ…—πŸ…’
ComfyUI Node Runs on cloud

VAE Decode Batched πŸŽ₯πŸ…₯πŸ…—πŸ…’

VAE Decode Batched

By KosinkadinkΒ·Created 3 years agoΒ·Updated 3 months agoΒ· 1,727
VAE Decode Batched πŸŽ₯πŸ…₯πŸ…—πŸ…’
  • samples
  • vae
  • IMAGE
β—„per_batch16β–Ί

This is the node you reach for when a normal VAE Decode dies with an out-of-memory error on a long clip. That's it. It does exactly what the built-in VAE Decode does - turns latents back into pixels - except it chews through them in fixed-size chunks instead of trying to decode the whole batch in one gulp.

Here's why that matters. In ComfyUI a "video" is just a stack of images, and a video's latents are a stack of latents. Decoding is per-frame work, but the VAE grabs VRAM for every frame it's holding at once. A 16-frame AnimateDiff clip is usually fine. Sixty-plus frames, or a big Wan/LTX render at high resolution, and the decode step alone can spike past what your card has - even though the sampling that produced those latents fit comfortably. That mismatch is the whole reason this node exists.

How it works

Instead of handing the VAE the entire latent batch, it slices the batch into groups of per_batch, decodes each group, then stitches the resulting images back into one sequence. Peak VRAM is now set by the chunk size, not the clip length. Slightly slower because it can't parallelize across the whole batch, but "slightly slower" beats "crashed."

The author is refreshingly blunt about it in the node's own description: unless you've actually hit VRAM issues encoding or decoding a big batch, just use the native VAE Decode, or decode straight from a Video Combine. Don't reach for this one preemptively - it's a workaround, not an upgrade.

Inputs and outputs

Three inputs, only one you'll ever touch:

  • samples - the LATENT batch to decode, straight off your KSampler.
  • vae - the VAE, same as any decode.
  • per_batch - how many frames to decode per chunk. Default is 16, minimum 1.

Output is a single IMAGE batch, which goes wherever decoded frames normally go - a Video Combine to mux into a file, a preview, an upscaler, whatever's next.

The one knob is per_batch. If 16 still OOMs, drop it to 8, then 4. Lower is safer and slower; there's no correctness penalty, the frames come out identical either way. You're just trading throughput for headroom.

Installing it

On comfy.icu the whole VideoHelperSuite is already baked into the image, so there's nothing to do - the node's just there.

Running locally, grab it through ComfyUI Manager: search ComfyUI-VideoHelperSuite, install, restart. Or from a terminal:

cd ComfyUI/custom_nodes
git clone https://github.com/Kosinkadink/ComfyUI-VideoHelperSuite

then restart ComfyUI. VHS is Kosinkadink's suite - the same person behind AnimateDiff-Evolved - so it's about as well-maintained and widely-installed as custom node packs get.

Common issues

If lowering per_batch all the way to 1 still OOMs, the decode isn't your real problem - your latents are just too large for the card at that resolution, and you want tiled VAE decoding or a smaller render instead. This node caps decode memory; it can't perform miracles.

And the pack-level gotcha: if VideoHelperSuite shows "import failed" in Manager, every VHS node including this one disappears from the menu. The usual causes are a NumPy version clash (people fix it by pinning NumPy to a 1.x build) or a broken ffmpeg install throwing No valid ffmpeg found in the console. Reinstall through Manager and watch the startup log - the real error is always printed there.

CategoryVideo Helper Suite πŸŽ₯πŸ…₯πŸ…—πŸ…’/batched nodes

Inputs (3)

NameTypeDefaultDescription
samplesLATENTβ€”
vaeVAEβ€”
per_batchINT16β€”

Outputs (1)

NameTypeDescription
IMAGEIMAGEβ€”