ComfyUI Node Runs on cloud

HunyuanVideo Encode

The leapfusion image-to-video route

By kijai·Created 2 years ago·Updated 12 months ago· 2,595
HunyuanVideo Encode
  • vae
  • image
  • samples
enable_vae_tilingtrue
temporal_tiling_sample_size64
spatial_tile_sample_min_size256
auto_tile_sizetrue
noise_aug_strength0.000
latent_strength1.000
latent_distsample

This node runs an image through HunyuanVideo's VAE to get a LATENT, which you then feed into HyVideoSampler as either samples (for video-to-video) or image_cond_latents (for image-to-video). That second use is the one worth understanding, because this pack actually offers two different image-to-video routes, and they're easy to mix up.

HyVideoI2VEncode is the official one - it runs your image through the LLM text encoder alongside your prompt, using Tencent's own I2V model. This node, HyVideoEncode, is the older, community-driven route: "leapfusion," a technique that predates the official I2V release and works by encoding an image into a latent and feeding it as a conditioning signal to the base text-to-video model. Two of this node's optional inputs exist specifically for that technique - if you're not doing leapfusion, you probably want HyVideoI2VEncode instead.

The inputs that matter

  • vae - from HyVideoVAELoader.
  • image - the frame you're encoding.
  • enable_vae_tiling / temporal_tiling_sample_size / spatial_tile_sample_min_size / auto_tile_size - the same tiling controls as HyVideoDecode, with the same caution: leave temporal_tiling_sample_size at 64 (the model default) unless you want stutter.
  • noise_aug_strength (default 0) - the tooltip says it directly: "helpful for leapfusion I2V where some noise can add motion and give sharper results." A pure, noiseless encode of a static image can bias the sampler toward a static output; a little noise gives the model room to introduce motion.
  • latent_strength (default 1) - same context, opposite direction: "helpful for leapfusion I2V where lower values allow for more motion." At 1, the init latent dominates heavily; lower it if your output feels frozen.
  • latent_dist - sample (uses the VAE's latent distribution) or mode (uses its mode). sample is the default and standard choice.

Output: samples, a LATENT.

How to install it

Ships with the pack - no separate download.

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

Needs HyVideoVAELoader working first (manual VAE download from Kijai's HunyuanVideo_comfy repo on HuggingFace - no auto-download).

Common issues & troubleshooting

Output barely moves - it's basically a still image with grain. This is the classic leapfusion symptom, and the fix is right there in the node's own tooltips: raise noise_aug_strength a little, and/or lower latent_strength. Both push the sampler away from over-trusting the static init frame.

Motion is wild and incoherent, image identity is lost. You've likely overcorrected - too much noise_aug_strength or too low a latent_strength gives the model too much freedom to drift from your reference image. Back both toward their defaults and adjust in smaller steps.

Confusing this with HyVideoI2VEncode and getting worse results than expected. If you're not specifically doing the leapfusion technique, use HyVideoI2VEncode instead - it's the official, model-native image-to-video path and generally the better starting point.

Seams or stutter in the encoded result. Same tiling caveats as decode - leave temporal_tiling_sample_size at 64 unless you're deliberately trading quality for VRAM.

CategoryHunyuanVideoWrapper

Inputs (9)

NameTypeDefaultDescription
vaeVAE
imageIMAGE
enable_vae_tilingBOOLEANtrueDrastically reduces memory use but may introduce seams
temporal_tiling_sample_sizeINT644–256Smaller values use less VRAM, model default is 64, any other value will cause stutter
spatial_tile_sample_min_sizeINT25632–2048Spatial tile minimum size in pixels, smaller values use less VRAM, may introduce more seams
auto_tile_sizeBOOLEANtrueAutomatically set tile size based on defaults, above settings are ignored
noise_aug_strengthoptFLOAT0.0000–10Strength of noise augmentation, helpful for leapfusion I2V where some noise can add motion and give sharper results
latent_strengthoptFLOAT1.0000–10Additional latent multiplier, helpful for leapfusion I2V where lower values allow for more motion
latent_distoptCOMBOsampleSampling mode for the VAE, sample uses the latent distribution, mode uses the mode of the latent distribution

Outputs (1)

NameTypeDescription
samplesLATENT