Video Duration Calculator (CRT)
Video Duration Calculator (CRT)
- duration_seconds
Video Duration Calculator (CRT) takes a fps and a frame_count and hands you back the length of the clip in seconds. That's the whole node: two numbers in, one number out. It exists because in video workflows, seconds are the number you actually reason about, but the graph only ever hands you frames.
Here's the thing that makes it more useful than it sounds. WAN, LTX and the other ComfyUI video models take their length as a frame count and their motion as a frame-level value, but everything else in your project - music sync, a voiceover you're matching, a loop you want to land on a beat, a "seamless loop must be exactly N seconds" constraint - thinks in seconds. So you end up doing frame_count / fps in your head a dozen times a session, and then you bump the frame count and do it again. A calculator node turns that from an off-graph mental step into a live, connected value that recomputes whenever you change either input. Change the frame count and the duration output updates the moment you run - it never goes stale.
Mechanically it's dead simple: duration_seconds = frame_count / fps, rounded to two decimals. The two required inputs are fps (default 30) and frame_count (default 300), and the output is a FLOAT named duration_seconds. Rounding to two decimals matters more than it looks - it keeps the value clean for anything that serializes or displays it, and you rarely need sub-centisecond precision for planning.
What you do with it is the interesting part. Feed the FLOAT into a node that wants a duration, use it in a text formatter to label your output, or route it to a conditional that picks a different pipeline when a clip crosses a length threshold. Because it's a pure function of two numbers it's also trivially safe to leave in a workflow permanently - no state, no models, no side effects.
Install with the rest of CRT-Nodes (ComfyUI Manager → search "CRT-Nodes", or clone https://github.com/plugcrypt/CRT-Nodes.git into custom_nodes and restart). It's arithmetic over two ints; it needs nothing beyond the pack itself loading. If you're building video or loop workflows and find yourself reaching for a calculator app mid-render, this is the node that takes that step back into the graph where it belongs.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| fps | INT | 30 | — |
| frame_count | INT | 300 | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| duration_seconds | FLOAT | — |