🪐 MiniMax H3 Duration
The calculator that saves you from frame-count math
- frames
- revised_seconds
You asked for a six-second clip and MiniMax H3 said no, so now you're staring at a frame count you can't explain. This node is the fix. It's not a generator and it doesn't call any API - it's a one-input calculator that does the single conversion H3 forces on you, so you can stop doing 17k+5 arithmetic in your head.
MiniMax H3 (the Hailuo family's latest) only accepts frame counts of the form 17k+5 at a fixed 24 fps. Not "about that long," not "between 140 and 150" - exactly 17k+5. Duration takes the number of seconds you actually want, works out the smallest valid frame count that covers it, and reports both the count and the real duration that count produces. Rounding goes up, never down, because a frame count that falls short of your request is a video that cuts off early.
The inputs and outputs are almost insultingly simple. One input:
seconds- your desired duration as a float, default 6.0. That's the whole input.
Two outputs:
frames(INT) - the H3-compatible frame count, rounded up to the nearest17k+5.revised_seconds(FLOAT) - the actual durationframesgives you at 24 fps.
Concrete example, because the rounding always surprises the first time: ask for 6 seconds and you're at 144 frames, which is not a valid H3 count. The node snaps you up to 158 frames (17×9+5), which is 6.58 seconds. Ask for 4 seconds - 96 frames - and you land at 106 (17×6+5), or 4.42 seconds. The gap matters if you're syncing to audio or cutting to a beat, so wire revised_seconds downstream rather than assuming your request came true. If you need a specific exact duration, work backwards from a frame count instead. And if you try something absurdly short, the floor is 5 frames (17×0+5) - the k=0 count - which is about a fifth of a second; the node isn't going to give you a zero-frame "video."
Install is the standard two-step, and there's no heavy lifting: this is pure arithmetic, so there are no model downloads and no extra dependencies riding along. In ComfyUI Manager, search for "Wan VACE Prep", or clone it manually:
cd ComfyUI/custom_nodes
git clone https://github.com/stuttlepress/ComfyUI-Wan-VACE-Prep
Then restart ComfyUI. It's bundled in a pack that's mostly about prepping control videos for Wan VACE outpainting and joining, and this node is the odd one out in the corner - but it's the lightest thing in the pack, and you can drop it into any workflow without dragging in VACE model files.
One honest warning about context: the pack migrated to ComfyUI's Nodes 2.0 / V3 API in v1.1.0 (v1.0.25 is the last legacy release). Duration isn't on the pack's list of fragile nodes - the canvas-widget and batch-calling-convention ones are - so you're on solid ground here. The bigger trap is using this node's output for the wrong model. H3's 17k+5 rule is not Wan's 4n+1 rule; they're different models with different frame contracts. Don't wire frames from this node into a local Wan sampler and expect it to behave. And a note on where H3 itself lives: as of mid-2026 the model was reachable through ComfyUI via API access, with native open-weight support promised soon. This node doesn't care either way - it just produces the frame count the H3 sampler in your graph is going to demand.
Inputs (1)
| Name | Type | Default | Description |
|---|---|---|---|
| seconds | FLOAT | 6.00 | — |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| frames | INT | — |
| revised_seconds | FLOAT | — |