Nodes/ComfyUI-HunyuanVideoWrapper/HyVideo Encode Keyframes
ComfyUI Node Runs on cloud

HyVideo Encode Keyframes

Start-and-end-frame video with the Dashtoon LoRA

By kijai·Created 2 years ago·Updated 12 months ago· 2,597
HyVideo Encode Keyframes
  • vae
  • start_image
  • end_image
  • samples
num_frames49
enable_vae_tilingtrue
temporal_tiling_sample_size64
spatial_tile_sample_min_size256
auto_tile_sizetrue
noise_aug_strength0.000
latent_strength1.000
latent_distsample

Regular image-to-video gives the model a starting frame and lets it improvise the rest. This node is for when you want to control both ends: a start frame and an end frame, with the model generating what happens in between. The README calls out exactly what this is built for - the community's dashtoon keyframe control LoRA (linked directly in the changelog), added in the same update that brought the official I2V model into this wrapper.

That LoRA detail matters more than it might seem. The end_image input's own tooltip says plainly: "End frame for dashtoon keyframe LoRA." Without that LoRA loaded onto your model (via the lora input on HyVideoModelLoader), the model wasn't trained to actually use an end-frame conditioning signal the way this node hands it one - so this node's usefulness is tied directly to having that specific LoRA in your setup, not something that works generically on any HunyuanVideo checkpoint.

The inputs that matter

  • vae - from HyVideoVAELoader.
  • start_image - your first frame.
  • end_image - your target last frame. Requires the dashtoon keyframe LoRA to actually be meaningful, per the tooltip above.
  • num_frames (default 49) - how many frames span between start and end, same 4n+1 convention as the sampler.
  • enable_vae_tiling / temporal_tiling_sample_size / spatial_tile_sample_min_size / auto_tile_size - the same VAE tiling controls as HyVideoEncode and HyVideoDecode. Leave temporal_tiling_sample_size at 64 (the model default) unless you're deliberately trading quality for VRAM.

Optional: noise_aug_strength and latent_strength - the same leapfusion-oriented knobs from HyVideoEncode, useful here too if the interpolated motion between your keyframes feels too static or too wild. latent_dist (sample default, or mode).

Output: samples, a LATENT that goes into HyVideoSampler's image_cond_latents.

How to install it

Ships with the pack - no separate download for the node itself.

  • 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.

For the intended use case, you'll separately need the dashtoon keyframe control LoRA (linked from the pack's README, hosted on its own GitHub repo) loaded through HyVideoModelLoader's lora input - this node alone doesn't get you keyframe-aware generation without it.

Common issues & troubleshooting

End frame is basically ignored - output doesn't converge toward it at all. This is the expected result if the dashtoon LoRA isn't loaded on your model. Check HyVideoModelLoader's lora input is actually pointed at it.

Interpolated motion between the two frames looks static or frozen. Same fix as HyVideoEncode: nudge noise_aug_strength up a little to give the sampler room to introduce motion, rather than over-trusting both encoded endpoints.

Seams or stutter in the encoded latents. Standard tiling caveats apply - keep temporal_tiling_sample_size at 64, or accept the stutter tradeoff if you're deliberately lowering it for VRAM.

Not sure whether to use start_image/end_image here versus a plain image on HyVideoI2VEncode. If you only care about a single starting frame and want the model's normal improvisation, use HyVideoI2VEncode. Reach for this node specifically when you have a concrete target end frame you want the clip to land on.

CategoryHunyuanVideoWrapper

Inputs (11)

NameTypeDefaultDescription
vaeVAE
start_imageIMAGE
end_imageIMAGEEnd frame for dashtoon keyframe LoRA
num_framesINT491–1024
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