Duration To Frames
The Node That Turns Seconds Into Frames — and Its One Weird Quirk
- int
- float
Every video model in ComfyUI asks you for a frame count, not a duration. You want a 10-second clip with Wan or LTX Video, and the Empty Latent Video node wants to know how many frames that is - so you sit there doing 10 × 24 in your head. Duration To Frames is the node that does that math for you. Type the seconds, pick the fps, and it hands back the frame count.
How it works
The arithmetic is simple: it takes your duration in seconds, multiplies it by fps, and rounds to the nearest whole frame. That's the whole job. The weird part is the tail end: the count then gets bumped up so that frame_count % 17 == 5. Ten seconds at 24 fps is 240 frames, but this node returns 243. The author never documented why 17; it looks like a magic number tuned to whatever pipeline he originally built the node for. For most models the extra few frames are harmless - but if your target model has strict frame requirements (say, exact multiples of 4 or 8 for its temporal VAE), this rounding will silently push your clip off your intended length.
One thing worth knowing before you wire it up: both outputs are the same number. The int and float sockets both carry the rounded frame count - the float is just there so you can plug it into a node that only accepts a float socket. There's no hidden "raw duration×fps" output.
The inputs that matter
- duration - clip length in seconds (FLOAT, 0.1 to 1000). This is the one you'll actually change.
- fps - frames per second (INT, 1 to 240). Default 24, which is the standard for most video models.
Outputs: int and float, both the same frame count.
What to wire it into
The int output goes straight into any frame-count socket - Empty Latent Video, LTX-Video's sampling nodes, Wan, CogVideo, they all take an INT. If you're building a video workflow and you'd rather think in "seconds of clip" than "number of frames", this is the node that translates for you. It's a thin utility, but it removes a genuine source of mental math in a workflow that's already full of it.
Installing it
It ships in the Fictiverse pack, so install that once and you get this node plus the pack's other helpers. Easiest route is ComfyUI Manager: search for ComfyUI Fictiverse Nodes and hit install, then restart. Or clone it by hand:
cd ComfyUI/custom_nodes
git clone https://github.com/Fictiverse/ComfyUI_Fictiverse
Then restart ComfyUI. The good news: this pack has zero dependencies and downloads no model files - requirements.txt is empty, so there's nothing extra for it to pull in.
Where people get burned
The only real gotcha is that rounding. If a workflow hands you a "10 second" setting and the model comes out at 243 frames, that's this node doing its mod-17 thing - not a bug in your graph. If you need an exact count, skip the node and wire duration × fps through a math node instead. And since both outputs are identical, don't go hunting for a raw value in the float socket; it isn't there.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| duration | FLOAT | 10.00.1–1000 | — |
| fps | INT | 241–240 | — |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| int | INT | — |
| float | FLOAT | — |