Nodes/ComfyUI-HunyuanVideoSamplerSave/Empty Video Latent For Hunyuan
ComfyUI Node

Empty Video Latent For Hunyuan

Sizing a Hunyuan video latent without doing the alignment math

By ShmuelRonen·Created 2 years ago·Updated 2 years ago· 20
Empty Video Latent For Hunyuan
    • LATENT
    resolution
    length25
    batch_size1

    This is the video equivalent of ComfyUI's stock Empty Latent Image node: it doesn't generate anything by itself, it just hands your sampler a correctly-shaped blank canvas to fill in. The twist is that "correctly shaped" is more finicky for video than for a single image - you need width, height, and frame count all landing on numbers the model's VAE actually likes - and this node bakes that into a dropdown instead of making you do the arithmetic.

    It's one of four nodes in ShmuelRonen's ComfyUI-HunyuanVideoSamplerSave pack, alongside a sampler, an image resizer, and a pan/zoom utility. Worth knowing going in: this specific pack has essentially no footprint in the community - no threads mention it - so it's not a widely-battle-tested tool the way, say, the author's LatentSync lip-sync nodes are. Treat it as a convenience wrapper around sane defaults, not as something with a reputation to lean on.

    How it works

    You pick a resolution string, a frame length, and a batch size, and out comes an empty LATENT tensor sized for Hunyuan's video pipeline. The 36 resolution presets are grouped by aspect ratio (1:1, 16:9, 4:3, 3:2, 9:16, 3:4, 2:3) and every one of them is aligned to a 16×16 grid, which is what Hunyuan's causal VAE needs. Note the ceiling: the presets top out around the 768px range. That's not the node being stingy - the original 13B HunyuanVideo model officially wanted 45–60GB of VRAM at its native resolutions, so a pack built for "home GPUs" pins itself to sizes that actually finish a generation on consumer hardware.

    The inputs and outputs that matter

    • resolution - one of the 36 presets. Pick this to match whatever you're resizing your source image to, if you're doing image-to-video (the pack's ResizeImageForHunyuan node uses the same size list, not by accident).
    • length - number of frames, default 25, and it steps in increments of 4. That's not arbitrary: causal video VAEs (Hunyuan's included) compress time roughly 4x, so frame counts want to land on a 4n+1 pattern - 1, 5, 9, 13… 25. Get this wrong and the community's experience with the same VAE family on Wan is that your clip comes back a couple of frames short of what you asked for. Stick to the step-4 increments this node gives you rather than typing in an arbitrary number.
    • batch_size - how many separate videos to generate in parallel, default 1. Leave it there. A batch of N videos costs roughly N times the VRAM and time of one - it's almost never what you want for video the way it sometimes is for stills.

    Output is a single LATENT, which wires directly into the video_latents input on this pack's HunyuanVideoSamplerSave node (or any sampler expecting a Hunyuan-shaped latent).

    How to install it

    Via ComfyUI Manager: search ComfyUI-HunyuanVideoSamplerSave, install, restart. Manually:

    cd ComfyUI/custom_nodes
    git clone https://github.com/ShmuelRonen/ComfyUI-HunyuanVideoSamplerSave.git
    

    then restart. This particular node doesn't need the pack's model download - it's pure math, no checkpoint required. You only need the Hunyuan model loaded once you get to the sampler node downstream.

    Common issues & troubleshooting

    Your video is a few frames off. This is the 4n+1 trap, and it's the same one people hit on Wan's causal VAE. If you ever bypass the dropdown's step-4 behavior and hand-type a length, expect the decoded clip to come back short.

    You picked a resolution above the presets and it looks wrong. There isn't one - 768-class is the ceiling here on purpose. If you need genuinely higher resolution, you're better off using ComfyUI's native Hunyuan Video workflow (official support shipped with 1.5) rather than fighting this pack's preset list, which was built for an earlier, much heavier version of the model.

    Latent shape mismatch at the sampler. Make sure the resolution you pick here is the same one you used on ResizeImageForHunyuan if you're doing image-to-video - the two nodes share a preset list precisely so you keep them in sync, and it's on you to actually do that.

    Categorylatent/video

    Inputs (3)

    NameTypeDefaultDescription
    resolutionCOMBO36 options: 256x256 (1:1), 384x384 (1:1), 512x512 (1:1), 768x768 (1:1), 384x216 (16:9), 512x288 (16:9), +30
    lengthINT251–16384
    batch_sizeINT11–4096

    Outputs (1)

    NameTypeDescription
    LATENTLATENT