Nodes/ComfyUI-Apt_Preset/AD_AutoTileVAEDecode
ComfyUI Node

AD_AutoTileVAEDecode

Stop guessing tiled-decode settings for long video clips

By cardenluo·Created 2 years ago·Updated 22 days ago· 309
AD_AutoTileVAEDecode
  • vae
  • tile_size
  • overlap
  • temporal_size
  • temporal_overlap
  • temporal_compression
width1024
height1024
total_frames64
lowGpu_modefalse
temporal_compression8

Decoding a big video latent back into pixels all at once is a fast way to run out of VRAM - the VAE decode step has to hold the whole thing in memory at once. The standard fix is a tiled decode: cut the latent into overlapping chunks, decode each one, stitch them back together. The catch is that ComfyUI's tiled VAE decode node exposes several numeric parameters - tile size, overlap, and (for video specifically) temporal tile size and temporal overlap - and picking good values by hand for a given resolution and clip length is fiddly guesswork most people just don't do correctly on the first try.

AD_AutoTileVAEDecode doesn't decode anything itself - it's a calculator. Feed it your target width, height, total_frames, and temporal_compression (default 8, matching the VAE's own temporal downsampling factor for most video models), flip lowGpu_mode on if memory is tight, and it hands back a matched set of five integers: tile_size, overlap, temporal_size, temporal_overlap, and temporal_compression - values sized specifically for the resolution and frame count you told it, ready to plug directly into ComfyUI's native tiled VAE decode node's matching input fields. lowGpu_mode, going by its purpose, biases those numbers toward smaller tiles and more conservative memory use at some cost to decode speed - the standard trade-off for anyone decoding on a card that's already close to its VRAM ceiling.

There's also an optional vae input, which the node doesn't strictly require to produce numbers, but connecting your actual VAE likely lets the calculation account for that specific model's real compression ratio rather than relying purely on the temporal_compression value you typed in - worth wiring up if you have it available, since it removes one more manual guess from the equation.

This is the same category of problem the wider community solved for images with combinations like Tiled Diffusion + Tiled VAE, which lets large images decode in chunks without holding the whole thing in memory at once; this node is the video-specific, auto-tuned version of that same idea, scoped to the temporal dimension video adds on top of plain spatial tiling.

Outputs - five integers, all at once. tile_size, overlap, temporal_size, temporal_overlap, temporal_compression - feed each straight into the corresponding input on your actual VAE Decode (Tiled) node.

Installing it. Standard for the whole pack - search "ComfyUI-Apt_Preset" in ComfyUI Manager, or clone it directly:

cd ComfyUI/custom_nodes
git clone https://github.com/cardenluo/ComfyUI-Apt_Preset.git

Run install.bat on Windows for dependencies, then restart ComfyUI. This node does pure arithmetic - no models, no GPU work of its own - so it works the moment the pack imports; the actual decode still happens in whatever tiled VAE decode node you wire its outputs into.

Troubleshooting. If you're still hitting out-of-memory errors even after using this node's computed values, turn on lowGpu_mode before increasing total_frames or resolution further - that flag exists specifically for exactly this situation. If the decoded output shows visible seams between tiles, that generally points to the overlap value being too small relative to how much detail is changing frame to frame - connecting the actual vae input rather than leaving it disconnected is the first thing to try, since it lets the node calculate against your model's real compression behavior instead of a generic assumption. And if this node doesn't appear in your install at all, that's most likely the documented pack-wide IMPORT FAILED issue from a missing dependency elsewhere in Apt_Preset, not this node specifically - check your ComfyUI console log at startup and reinstall via Manager's "install missing custom nodes."

CategoryApt_Preset/AD

Inputs (6)

NameTypeDefaultDescription
widthINT102464–32768
heightINT102464–32768
total_framesINT641–4096
lowGpu_modeBOOLEANfalse
temporal_compressionINT80–64
vaeoptVAE

Outputs (5)

NameTypeDescription
tile_sizeINT
overlapINT
temporal_sizeINT
temporal_overlapINT
temporal_compressionINT