Nodes/ComfyUI-Apt_Preset/IO_video_encode
ComfyUI Node

IO_video_encode

Tiled VAE decode for video, wired through this pack's context pipe

By cardenluo·Created 2 years ago·Updated 18 days ago· 309
IO_video_encode
  • context
  • samples
  • context
  • image
trim_latent0
tile_size256
overlap64
temporal_size64
temporal_overlap8

Despite the name, this is a decode node - it turns video latents back into viewable frames. The "encode" in the name refers to encoding the output, not the input; you'll find it at the end of a video sampling chain, right where you'd normally reach for a VAE Decode (Tiled) node.

How it works

This pack's whole pitch, stated in its own README, is that dense workflows get simpler when related nodes pass one bundled connection between them instead of half a dozen separate wires for model, clip, VAE, and conditioning. That bundle is the RUN_CONTEXT type, and it threads through most of this pack's loader → controller → sampler chain. IO_video_encode is a leaf on that chain: it takes the context (which is carrying the VAE it needs internally) plus your sampled samples (LATENT), and decodes them into frames - passing context straight through afterward so the next node in the chain still has it.

The decode itself is tiled in both space and time, the same idea as core ComfyUI's tiled VAE decode extended to handle video length without blowing your VRAM budget. tile_size and overlap control the spatial tiling (default 256 / 64). temporal_size and temporal_overlap (default 64 / 8) do the same thing along the time axis - the tooltip is explicit that these only matter for video VAEs, and control how many frames get decoded at once and how much they overlap. Video VAEs commonly compress time by a fixed factor (Wan's, for instance, compresses roughly 4x), so decoding isn't a simple frame-for-frame operation - temporal tiling is what keeps a long clip from needing every latent frame resident in memory simultaneously. trim_latent, per its own tooltip, is only relevant for vace_video - leave it at 0 otherwise.

Inputs and outputs

  • context (required, RUN_CONTEXT) - the pack's bundled pipe, carrying the VAE this node needs.
  • samples (LATENT) - what to decode.
  • tile_size, overlap - spatial tiling, same idea as core ComfyUI's tiled decode.
  • temporal_size, temporal_overlap - frame-axis tiling, video VAEs only.
  • trim_latent - vace_video-specific, leave at 0 for everything else.

Two outputs: context (RUN_CONTEXT, passed through unchanged for the next node in the chain) and image - the decoded frames.

How to install it

ComfyUI Manager → search ComfyUI-Apt_Preset, install, restart. Manually:

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

then run install.bat for dependencies (Windows-only - on Linux/macOS run its pip install lines by hand) and restart ComfyUI.

Common issues & troubleshooting

context has nothing to connect to. RUN_CONTEXT is specific to this pack's own node family (its loader/controller/sampler stack) - it won't wire up to a plain core-ComfyUI VAE or model output. If you're not already using this pack's context-based workflow style, this particular node isn't a drop-in replacement for a standard VAE Decode; use core ComfyUI's tiled decode node instead in a plain graph.

Out-of-memory on long clips. Push temporal_size down before touching tile_size - the temporal axis is usually where video decode blows VRAM, since a video VAE has to hold more of the reconstruction in memory per frame than a spatial tile does. Smaller temporal_size costs some speed for a lower memory ceiling.

Visible seams between tiles. Standard tiled-decode symptom, not specific to this node - increase overlap (spatial) or temporal_overlap (frame axis) rather than tile_size/temporal_size first.

IMPORT FAILED on startup. This pack has at least one reported import failure in the wild on a stock install, generally traced to skipping install.bat's dependency step, which needs to be run manually off Windows. Check the console for the actual missing package before reinstalling.

CategoryApt_Preset/IO_Port

Inputs (7)

NameTypeDefaultDescription
contextRUN_CONTEXT
samplesoptLATENT
trim_latentoptINT00–500Only used for vace_video.
tile_sizeoptINT25664–4096
overlapoptINT640–4096
temporal_sizeoptINT648–4096Only used for video VAEs: Amount of frames to decode at a time.
temporal_overlapoptINT84–4096Only used for video VAEs: Amount of frames to overlap.

Outputs (2)

NameTypeDescription
contextRUN_CONTEXT
imageIMAGE