Nodes/AnimateDiff Evolved/Empty Latent Image (Big Batch) πŸŽ­πŸ…πŸ…“
ComfyUI Node Runs on cloud

Empty Latent Image (Big Batch) πŸŽ­πŸ…πŸ…“

Seeding huge AnimateDiff frame counts

By KosinkadinkΒ·Created 3 years agoΒ·Updated 8 days agoΒ· 3,519
Empty Latent Image (Big Batch) πŸŽ­πŸ…πŸ…“
    • LATENT
    β—„width512β–Ί
    β—„height512β–Ί
    β—„batch_size1β–Ί

    This is ComfyUI's stock Empty Latent Image node, but with the batch-size ceiling knocked way up. That's the whole feature, and it exists for one specific reason: in an AnimateDiff workflow, "batch size" means "how many frames," and the native node's cap gets in your way once you start doing genuinely long generations.

    Why AnimateDiff needs its own version

    The batch dimension of a latent tensor is what AnimateDiff-Evolved treats as your frame count. With sliding context windows, VRAM only scales with the window size (typically 16 frames at a time), not the total length of the video - the README calls out "1000+ frame videos" as feasible on 24GB. But you can't ask for 1000 frames from the native Empty Latent Image node; it wasn't built with video batch sizes in mind. This node just swaps in a much larger allowed range so the latent-creation step doesn't become the bottleneck before you even get to sampling.

    Inputs and outputs

    • width, height - pixel dimensions, 64 to 16384, step 8. Latents are 1/8-scale of pixel space for SD1.5, so these need to stay multiples of 8 (the step enforces it), and you'll generally want them near your checkpoint's trained resolution - 512Γ—512-ish for SD1.5-based AnimateDiff work.
    • batch_size - 1 to 262144. This is your total frame count for the animation, not the size of one context window. If you're using Context Options (the node that actually splits work into sliding windows), that node's context_length setting is a separate number - don't confuse the two. batch_size here is "how many frames exist," context length is "how many the sampler looks at per pass."

    Output is a plain LATENT, all zeros, ready to feed a KSampler.

    How to install it

    Part of the base pack.

    • ComfyUI Manager - search AnimateDiff Evolved by Kosinkadink, install, restart.
    • Manual - cd ComfyUI/custom_nodes && git clone https://github.com/Kosinkadink/ComfyUI-AnimateDiff-Evolved, restart.

    No motion module is strictly required to use this node in isolation (it's just latent creation), but you'll obviously need one for the rest of the AnimateDiff pipeline it's feeding - grab a motion module like mm_sd_v15_v2 or v3_sd15_mm and put it in ComfyUI/models/animatediff_models.

    Common issues & troubleshooting

    Setting a huge batch_size and hitting OOM anyway. Sliding context windows keep sampling VRAM bounded, but they don't help you at every other stage of the pipeline. VAE decode, in particular, often processes the whole batch at once (or in its own separate chunking), and outputs, ControlNet preprocessing, and anything downstream all still scale with total frame count. A thousand-frame generation is realistic for sampling; make sure the rest of your workflow (especially VAE decode batching, if your VAE-decode node offers it) is set up to handle the same scale before you commit to a huge number.

    Output looks wrong at unusual resolutions. AnimateDiff's motion modules were trained at a specific resolution family (mostly 512-class for SD1.5). Pushing width/height far outside that, especially combined with a long batch, tends to degrade coherence faster than it would on a single still image - it's not this node's fault, it's the motion module working outside its comfort zone.

    Confusing this with the native Empty Latent Image node. If your workflow only needs a modest batch (under ~64), the native node works fine and this one adds nothing. Reach for this specifically when you need a frame count the standard node won't let you type in.

    CategoryAnimate Diff πŸŽ­πŸ…πŸ…“/extras

    Inputs (3)

    NameTypeDefaultDescription
    widthINT51264–16384β€”
    heightINT51264–16384β€”
    batch_sizeINT11–262144β€”

    Outputs (1)

    NameTypeDescription
    LATENTLATENTβ€”