Hunyuan Image Latent To Video Latent
Fake Hunyuan image-to-video by tiling one still latent 13 times
- latent
- LATENT
When HunyuanVideo launched in December 2024 it was text-to-video only. The official image-to-video model didn't arrive until three months later, so the community hacked its own: encode a still with the Hunyuan VAE, tile that one latent across the time axis until it's shaped like a video latent, then lean on a noise mask to keep the result anchored to your source image. That hack is this entire node. It's a ~60-line utility that does the tiling and builds the mask for you - no API, no key, no downloaded model, nothing else. It won't improve your results on its own; it just spares you from hand-wiring the tensor gymnastics every time you want Hunyuan to animate a still.
How it works
The trick is Hunyuan's temporal compression. Its 3D causal VAE squashes 4 video frames into 1 latent frame, so a length-frame clip needs (length - 1) // 4 + 1 latent frames along the time axis - 13 for the default 49 frames. The node copies your image latent exactly that many times and concatenates them, giving you a LATENT that's genuinely shaped like a Hunyuan video latent and plugs straight into a KSampler.
Then the part worth understanding: the noise mask. If you just tile the image, the sampler has no reason to keep any of it - every identical frame gets noised into oblivion and you're effectively doing text-to-video. The mask tells ComfyUI where to hold onto the input latent instead of regenerating. ComfyUI's rule (the KSamplerX0Inpaint path in comfy/samplers.py): mask value 1 means denoise freely, 0 means keep the original latent. This node's mask sits near 1.0 almost everywhere, with a notch that dips toward the input image around one spot on the timeline. The three noise_* knobs shape that notch:
noise_o(offset, default 0.25) - where along the timeline it sits, as a fraction from start (0) to end (1). With the default, the anchor lands about a quarter of the way through the clip.noise_w(width, default 0.05) - how wide a band gets pulled toward the image.noise_s(scale, default 20) - how hard that band sticks. Crank it up and the anchor point is held almost fully to the source; drop it toward 2 and the notch nearly vanishes, so the whole clip floats free.
Defaults give you a subtle anchor a quarter of the way in. If you want the video to visibly start from your image, nudge o toward 0 - worth knowing, because nothing in the tooltip spells that out.
The inputs that matter
latent- the "Hunyuan image latent," i.e. encode a still with the Hunyuan VAE (a plain VAE Encode into the node). This is the one input that decides what comes out.length- desired frames, default 49, stepping by 4. Keep it small for tests; add frames in multiples of 4.use_noise_mask- on by default. Leave it on. Off means no anchor and the source image mostly washes away.
Output is a single LATENT: wire it into a KSampler's latent_image with the HunyuanVideo checkpoint, then VAE Decode. One quirk: the node prints the computed mask intensities to your console on every run. Harmless debug noise; don't panic when a list of numbers appears in the log.
Installing it
Via ComfyUI Manager, search "Hunyuan Image Latent To Video Latent" and install, then restart. Or the manual way:
cd ComfyUI/custom_nodes
git clone https://github.com/philiprodriguez/ComfyUI-HunyuanImageLatentToVideoLatent
Restart ComfyUI and you're done. The only declared dependency is torch, which ComfyUI already ships - no checkpoints, no config files, no weights to fetch. The README is literally empty, which is fine; the whole node is a single __init__.py under an MIT license.
Gotchas
The one that will actually bite you: the image latent must come from the Hunyuan VAE. Feed it an SDXL or Flux latent and the channel counts and latent space won't match the HunyuanVideo model - expect a shape error or garbage, not a subtly wrong video. And be honest about what this is: a one-commit pack with essentially zero community footprint, so there are no battle-tested settings to crib. Tune the noise knobs empirically - generate, watch what drifts, adjust. One wider caveat: as of 2026 Hunyuan has fallen well behind Wan and LTX for new video work, so if you're picking an I2V model from scratch, this isn't the reason to choose it. But if you're already committed to Hunyuan - say you're running FramePack, which builds on it - this node is the clean way to get image-to-video without waiting on anything else.
Inputs (6)
| Name | Type | Default | Description |
|---|---|---|---|
| length | INT | 491–40000 | The number of frames desired |
| latent | LATENT | The Hunyuan image latent to convert into a Hunyuan video latent | |
| use_noise_mask | BOOLEAN | true | Whether to include a noise mask |
| noise_s | FLOAT | 20.000–100 | The s (scale) parameter in the noise intensity function (see https://www.desmos.com/calculator/vhw74mr1vh) |
| noise_o | FLOAT | 0.25-2–2 | The o parameter (offset) in the noise intensity function (see https://www.desmos.com/calculator/vhw74mr1vh) |
| noise_w | FLOAT | 0.050–2 | The w parameter (width) in the noise intensity function (see https://www.desmos.com/calculator/vhw74mr1vh) |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| LATENT | LATENT | — |