ComfyUI Node Runs on cloud

CogVideo Decode

Turning CogVideoX latents into actual frames

By kijai·Created 2 years ago·Updated 12 months ago· 1,549
CogVideo Decode
  • vae
  • samples
  • images
enable_vae_tilingtrue
tile_sample_min_height240
tile_sample_min_width360
tile_overlap_factor_height0.200
tile_overlap_factor_width0.200
auto_tile_sizetrue

The sampler gives you a latent, which is not something you can watch. This node is the last step that turns it into real, viewable frames. It runs the latent through the CogVideoX VAE and outputs an image batch - one image per frame - that you then hand to a video-combine node to save as an mp4. Every CogVideoX workflow ends here (or one node before the file save).

The catch with video VAE decoding is memory. A full clip of latents decoded all at once can blow past your VRAM in a heartbeat, because you're reconstructing every frame at full resolution simultaneously. So this node decodes in tiles - chunks of the frame at a time - and stitches them back together. That's what most of the settings are about.

The inputs that matter

Two are the real inputs: vae (from your loader node) and samples (the LATENT from CogVideo Sampler). The rest is tiling control:

  • enable_vae_tiling (default on) - the big one. On, it decodes in tiles to keep VRAM sane. Turn it off only if you have memory to spare and want to avoid any chance of tile seams. On most cards, leave it on.
  • auto_tile_size (default on) - lets the node pick sensible tile dimensions for you. Leave it on unless you're hand-tuning.
  • tile_sample_min_height / tile_sample_min_width (240 / 360) - the tile size, used when you turn auto_tile_size off. Smaller tiles use less VRAM but risk visible seams and are slower.
  • tile_overlap_factor_height / tile_overlap_factor_width (both 0.2) - how much neighboring tiles overlap so the seams blend. More overlap = smoother joins, a bit more compute.

The single output, images (an IMAGE batch), goes to whatever saves or previews your video - most commonly a Video Combine node from the VideoHelperSuite pack, which assembles the frames into a playable file at your chosen framerate.

How to install it

It's part of the CogVideoX wrapper:

  • ComfyUI Manager - search ComfyUI-CogVideoXWrapper, install, restart.
  • Manual - cd ComfyUI/custom_nodes && git clone https://github.com/kijai/ComfyUI-CogVideoXWrapper, then pip install -r ComfyUI-CogVideoXWrapper/requirements.txt, restart.

You'll almost certainly also want the VideoHelperSuite pack for the Video Combine node that saves the output - the decode node hands you frames, not a file.

Common issues & troubleshooting

Out of memory at the decode step. Very common - decoding is a VRAM spike even when sampling fit fine. Make sure enable_vae_tiling is on. If it's on and you still OOM, turn auto_tile_size off and set smaller tile_sample_min_height/_width values so each tile is cheaper.

Faint grid lines or seams in the output. That's tiling showing through. Raise the overlap factors so tiles blend more, or bump the tile size up if you have the memory. The overlap defaults of 0.2 are usually enough, but very smooth gradients (skies, fog) are where seams sneak in.

Output is noise or wildly wrong colors. Wrong VAE. The VAE feeding this node has to be the CogVideoX one that matches your model - either the vae output from a download loader, or a CogVideoX VAE Loader if you used the model-only loader. A mismatched VAE decodes to garbage.

CategoryCogVideoWrapper

Inputs (8)

NameTypeDefaultDescription
vaeVAE
samplesLATENT
enable_vae_tilingBOOLEANtrueDrastically reduces memory use but may introduce seams
tile_sample_min_heightINT24016–2048Minimum tile height, default is half the height
tile_sample_min_widthINT36016–2048Minimum tile width, default is half the width
tile_overlap_factor_heightFLOAT0.2000–1
tile_overlap_factor_widthFLOAT0.2000–1
auto_tile_sizeBOOLEANtrueAuto size based on height and width, default is half the size

Outputs (1)

NameTypeDescription
imagesIMAGE