Nodes/ComfyUI/EmptyMochiLatentVideo
ComfyUI Node Runs on cloud

EmptyMochiLatentVideo

The latent whose length math is a trap

By Comfy-Org·Created 4 years ago·Updated 2 minutes ago· 129,937
EmptyMochiLatentVideo
    • LATENT
    width848
    height480
    length25
    batch_size1

    Every video model needs a starting latent with the right shape, and "the right shape" is different for every model. This is the one for Mochi, Genmo's 2024 open video model that ComfyUI picked up basically the day it dropped. It allocates a zero-filled latent shaped exactly the way Mochi's VAE expects, so you don't have to count channels and compression factors yourself.

    What it creates

    The node builds [batch_size, 12, t, height/8, width/8] - twelve latent channels, 8x spatial downscale, and a temporal compression of 6x. Defaults are 848x480x25 frames at batch 1, which matches Mochi's home turf: 16:9-ish video around a few seconds.

    The one genuinely annoying part is the length parameter. Because Mochi compresses time by 6x, valid lengths only land on specific values: ((length - 1) // 6) + 1 must come out right, so lengths like 7, 13, 19, 25, 31... are what the widget accepts. The step is 6 on the slider, which is the UI telling you the rule. If you type in a length that doesn't fit the formula, you get a tensor Mochi can't sample, so keep to the step.

    Where it sits

    The output is a LATENT, and it plugs directly into the latent input of a Mochi workflow - typically alongside a CLIPTextEncode for the prompt, then into the sampler. You won't decode it; the sampler turns the empty latent into the noisy-then-cleaned video latent, and only then do you VAE-decode to pixels. Think of this node as "give the sampler a correctly-sized box."

    Width and height must be multiples of 16 (the slider steps by 16), and it shares the usual video-model rule: pick a size the model was trained near. Mochi's sweet spot is around 848x480; go wildly bigger and you're asking for quality loss or VRAM pain. batch_size produces that many independent video latents in one go - but remember they'll share a seed unless you vary their noise sources, which is the classic cause of "why is my batch of videos identical."

    Common issues

    The length math is the failure mode beginners actually hit - a 30-frame request snaps to an invalid latent and the sample errors or silently does something weird. Stick to the step. Second: Mochi is a heavier model than its profile suggests; an empty latent is instant, but everything downstream isn't, so budget VRAM for the sampler, not this node. It's a one-trick node - allocate the box, nothing else - and that's exactly why it exists: shape correctness is the kind of thing you don't want to get wrong by hand.

    Where it came from

    Mochi support landed in ComfyUI core in late 2024 when the model released, so this node has been stable and unchanged for a long while. It ships with core - nothing to install.

    Categorymodel/latent/mochi

    Inputs (4)

    NameTypeDefaultDescription
    widthINT84816–16384
    heightINT48016–16384
    lengthINT257–16384
    batch_sizeINT11–4096

    Outputs (1)

    NameTypeDescription
    LATENTLATENT