XB-BOX - VAE分块解码(原版优化)
Tiled, temporal VAE decode for video latents that won't fit
- samples
- vae
- IMAGE
VAE decoding is where video workflows die. The sampler just produced a latent your card handled fine, and then the decode tries to hold the entire video reconstruction in memory at once - and that's your OOM. XB_ROCmLTXVAEDecode decodes video latents in tiles, both spatially and across time, so a full-length LTX clip can be reconstructed piece by piece without ever asking the GPU to hold the whole thing.
The name says LTX, and LTX's high-compression spatiotemporal VAE is the model most people hit this wall with - but read the source and you'll find it's the pack's "原版优化" wrapper around ComfyUI's official VAEDecodeTiled, with a cleanup pass added. Tile the spatial dimensions, tile the temporal dimension, and slide the window forward with an overlap so the seams don't show.
How the mechanism works
This is one of the pack's legacy ROCm alias nodes, which means it's a remapping shell: the input names (tile, overlap, t_tile, t_overlap) get translated to the official VAEDecodeTiled parameters (tile_size, overlap, temporal_size, temporal_overlap), and it calls the official decoder. A value of 0 in any tile control means "use the built-in default" (512 spatial, 64 temporal / 8 temporal overlap). There's also a compatibility guard that inspects your ComfyUI's signature and silently drops the temporal parameters on older versions that don't support them.
Then, before decoding, it can run the same four-level cleanup sweep as the pack's samplers (不做任何清理 → 单次缓存清理 → 卸载显存模型 → 卸载全量模型), which matters here because tiled decode is exactly the step where a fragmented cache turns a near-miss into an OOM.
The inputs that matter
- samples, vae - the video latent and the VAE. Standard.
- tile (0–4096, step 64) - spatial tile size. 0 = default 512. Smaller tiles = less VRAM, more seams.
- overlap (0–256) - spatial overlap between tiles. Too small and you get visible tile borders.
- t_tile (0–1024) - temporal tile size in frames of latent time. This is the LTX-specific dial: chunking the video across time is what makes a 5-second 720p clip decodable on a 12GB card.
- t_overlap (0–128) - temporal overlap. The one to tune when you see flicker.
- cleanup - the memory sweep.
Output is IMAGE.
Where people get burned
The honest failure mode, straight from the LTX 2.3 community: temporal tiling is a flicker factory. Reddit threads on LTX 2.3 report shimmering/pumping across the whole frame, and the temporal tile boundary is a prime suspect - the VAE doesn't see continuous context across tile edges, so the reconstruction disagrees at the seams. The fixes that actually work:
- Raise
t_overlap(start around 16) so tiles see more shared context. - If flicker persists, raise
t_tileuntil the whole clip fits - bigger temporal tiles mean fewer seams, at VRAM's expense. - When all else fails, that "cleanup" dropdown is not decoration: an OOM'd cache mid-decode produces artifacts that look like model failure but are just memory rot.
Install
cd ComfyUI/custom_nodes
git clone https://github.com/WJLUOXIAO/XB_ToolBox.git
# or: ComfyUI Manager → "XB_ToolBox"
No pip deps - it calls ComfyUI's built-in tiled decoder. The one compatibility note: on older ComfyUI builds without temporal decode support, the node drops those parameters and falls back to spatial-only tiling (it logs the drop), which means a big clip will still OOM. If that happens, update ComfyUI rather than fighting the node.
Inputs (7)
| Name | Type | Default | Description |
|---|---|---|---|
| samples | LATENT | — | |
| vae | VAE | — | |
| tile | INT | 00–4096 | — |
| overlap | INT | 00–256 | — |
| t_tile | INT | 00–1024 | — |
| t_overlap | INT | 00–128 | — |
| cleanup | COMBO | 不做任何清理 | 4 options: 不做任何清理, 单次缓存清理, 卸载显存模型, 卸载全量模型 |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| IMAGE | IMAGE | — |