Nodes/comfyui-alabo-duration/Empty Latent (aspect + size + seconds)
ComfyUI Node

Empty Latent (aspect + size + seconds)

Set your video length in seconds — no frame math required

By AlaboMPJ·Created about a month ago·Updated about a month ago· 0
Empty Latent (aspect + size + seconds)
    • LATENT
    • frames
    • width
    • height
    • render_fps
    • out_fps
    aspect9:16
    sizelarge
    duration12s
    custom_seconds12.0
    fps24
    interp_x1

    Stock EmptyLatentImage is fine until a video workflow makes you do arithmetic. You want 12 seconds at 24 fps, AnimateDiff wants a latent with a batch of 288, and if it's 9:16 the width field isn't 512 anymore. Suddenly you're punching numbers into raw pixel fields and hoping the frame count divides evenly. AlaboSecondsLatent (shown in the menu as Empty Latent (aspect + size + seconds)) exists to end that: shape, size, and length are all dropdowns, and the frame math comes out the other side as plain integers you can wire straight into your video nodes.

    It's the only node in the tiny comfyui-alabo-duration pack, and it's a pure utility - no models, no API key, no pip deps. It just builds an empty latent, but it builds the right one for a video graph, where latent shape, frame count, and frame rate all have to line up or your clip comes out two seconds longer than you asked for.

    How it works

    Pick an aspect ratio (9:16, 16:9, 1:1, 4:5, 2:3, 3:2, or 2.39:1) and a size bucket - small/medium/large map to a short side of 320, 448, or 576 pixels. The node computes the other dimension, snaps both to a multiple of 8, and builds a 4-channel latent at width/8 × height/8 with one batch slot per frame. So far that's EmptyLatentImage with nicer ergonomics.

    The interesting part is the length math. fps sets your render rate, and interp_x is your downstream RIFE multiplier. out_fps = fps × interp_x, and the node renders fewer frames than the target clip needs so that after RIFE multiplies the count back up, the clip played at out_fps lands on exactly the seconds you picked. Set it to 1 (the default) when you're not interpolating.

    The inputs that matter

    Honestly, only a few. aspect and size pick your canvas, duration picks your length. The one trap: custom_seconds is only used when duration is set to custom. It's always on the node, so people set "12" in the float field, leave duration on "12s", and nothing changes - which is fine, because they're the same value anyway, but it's good to know the dropdown wins.

    interp_x only matters if you run RIFE. If you do, keep it in lockstep with your RIFE multiplier or your "12s" clip silently drifts toward 24s.

    The outputs

    Six of them: LATENT plus frames, width, height, render_fps, and out_fps. The latent feeds AnimateDiff or your sampler's latent input like any empty latent would. The integers are the useful part - wire out_fps into your video encode node and frames into anything that wants a batch count, and you never compute either by hand.

    Install

    ComfyUI Manager will find it if you search "comfyui-alabo-duration" (or the display name). Manual install is two lines:

    cd ComfyUI/custom_nodes
    git clone https://github.com/AlaboMPJ/comfyui-alabo-duration
    

    Restart ComfyUI. No requirements to install, no model files to fetch - the whole node is one small Python file.

    Gotchas

    • The latent it builds is all zeros, where stock EmptyLatentImage fills with random noise. In practice the sampler re-noises each step, so the common AnimateDiff path works fine - just know it's a clean start, not a noisy one, if a workflow was tuned around the stock node's behavior.
    • Longer durations mean more frames, which means more VRAM. 60s at 24 fps is 1,440 frames of latent - that will hurt on an 8 GB card regardless of how tidy this node is.
    • AnimateDiff is arguably past its prime as a starter tech - Wan and its friends took the video crown - but AnimateDiff-era workflows are still everywhere, and anything that starts from an empty latent (AnimateDiff, deforum-style graphs, custom video pipelines) can use this as a drop-in.
    CategoryAlabo/video

    Inputs (6)

    NameTypeDefaultDescription
    aspectCOMBO9:167 options: 9:16, 16:9, 1:1, 4:5, 2:3, 3:2, +1
    sizeCOMBOlarge3 options: small, medium, large
    durationCOMBO12s7 options: custom, 12s, 15s, 20s, 30s, 45s, +1
    custom_secondsFLOAT12.00.1–600
    fpsINT241–120
    interp_xINT11–8

    Outputs (6)

    NameTypeDescription
    LATENTLATENT
    framesINT
    widthINT
    heightINT
    render_fpsINT
    out_fpsINT