Nodes/ComfyUI-HunyuanVideoWrapper/HunyuanVideo Latent Preview
ComfyUI Node Runs on cloud

HunyuanVideo Latent Preview

A cheap peek at your video before the real VAE decode

By kijai·Created 2 years ago·Updated 12 months ago· 2,595
HunyuanVideo Latent Preview
  • samples
  • images
  • latent_rgb_factors
seed0
min_val-0.150
max_val0.150
r_bias0.000
g_bias0.000
b_bias0.000

Video VAEs are slow to decode, and Hunyuan's is no exception - running the real decoder every few steps just to check whether a generation is even heading somewhere useful would tank your iteration speed. So, like most of the modern video-wrapper packs, this one ships a cheap approximation: a fixed small matrix that maps latent channels directly to rough RGB values, skipping the actual decoder entirely. It's not accurate, but it's fast, and "fast and roughly right" is exactly what you want when you're just trying to see if a seed is worth letting finish.

The only required input is samples - your LATENT, wired straight out of a sampler mid-generation or after it finishes. seed is there for consistency with the rest of the pack's node signatures rather than doing anything meaningful to the preview itself. The fields that actually shape what you see are min_val and max_val (defaulting to -0.15 and 0.15), which control the contrast clipping range applied before mapping to RGB - narrow that range and you'll pull more visible detail out of a preview that otherwise looks flat or washed out, at the cost of clipping the extremes.

r_bias, g_bias, and b_bias (all -1 to 1, default 0) nudge the color balance of the approximation. Because this isn't the real decoder, the raw preview can look distinctly off-color - a persistent green or magenta cast is normal for these fixed-factor approximations across the ecosystem, not a sign anything's broken. If your previews consistently skew one direction, bumping the opposing bias channel a bit is a reasonable fix; don't chase perfect color accuracy here, since that's not what this node is for.

Two outputs: images, the actual RGB preview you'd send to a PreviewImage node, and latent_rgb_factors, a string dump of the factor matrix the node used to do the conversion. That second output is mostly a debugging or curiosity artifact - you're very unlikely to need to wire it anywhere in a normal workflow.

The workflow this is built for: drop it right after your sampler, feed images into a PreviewImage node, and watch the video take shape while it's still generating. If a seed is obviously going sideways - wrong composition, garbled motion, whatever - you can cancel and try again instead of waiting on the full, slow VAE decode to confirm what you could already tell from the rough preview. It's a time-saver, not a quality check; don't judge your final output's actual look from this node's rendering.

Installing the pack: ComfyUI Manager, search "HunyuanVideoWrapper," or manually - cd ComfyUI/custom_nodes && git clone https://github.com/kijai/ComfyUI-HunyuanVideoWrapper, then pip install -r requirements.txt inside that folder, then restart. This node needs nothing beyond the base install - no model download, since the RGB factor matrix ships with the pack itself rather than being a separate weight file.

CategoryHunyuanVideoWrapper

Inputs (7)

NameTypeDefaultDescription
samplesLATENT
seedINT00–18446744073709550000
min_valFLOAT-0.150-1–0
max_valFLOAT0.1500–1
r_biasFLOAT0.000-1–1
g_biasFLOAT0.000-1–1
b_biasFLOAT0.000-1–1

Outputs (2)

NameTypeDescription
imagesIMAGE
latent_rgb_factorsSTRING