Empty Latent (aspect + size + seconds)
Set your video length in seconds — no frame math required
- LATENT
- frames
- width
- height
- render_fps
- out_fps
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
EmptyLatentImagefills 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.
Inputs (6)
| Name | Type | Default | Description |
|---|---|---|---|
| aspect | COMBO | 9:16 | 7 options: 9:16, 16:9, 1:1, 4:5, 2:3, 3:2, +1 |
| size | COMBO | large | 3 options: small, medium, large |
| duration | COMBO | 12s | 7 options: custom, 12s, 15s, 20s, 30s, 45s, +1 |
| custom_seconds | FLOAT | 12.00.1–600 | — |
| fps | INT | 241–120 | — |
| interp_x | INT | 11–8 | — |
Outputs (6)
| Name | Type | Description |
|---|---|---|
| LATENT | LATENT | — |
| frames | INT | — |
| width | INT | — |
| height | INT | — |
| render_fps | INT | — |
| out_fps | INT | — |