π Frame Calculator (Video)
How many frames is that 12-second clip at 30fps?
- frame_rate
- frame_rate_int
- frames_number
- video_duration
Video generation is a game of exact numbers. Tell Wan or LTX "5 seconds" and the model actually wants a frame count - 150 at 30fps - and if you're off by one the whole clip shifts or the model rejects it. This node is the arithmetic you don't want to do by hand: type in the duration in seconds and the fps, and it gives you the exact frame count, rounded and ready to feed straight into the model's length parameter.
It's the plain-duration sibling of FrameCalculatorAudio - same outputs, but driven by a duration_seconds integer instead of an audio file. If your duration is dictated by a soundtrack, use the audio one; if it's just "I want a 5-second clip," this is the simpler tool.
How it works
frames_number = round(fps Γ duration_seconds). That's genuinely the whole engine, but the packaging matters:
- frame_rate - your fps as a float (30.0, 24.0, whatever you set).
- frame_rate_int - the same value rounded to an int (30), handy for nodes that want an integer rate.
- frames_number - the computed frame count, rounded to a whole number.
- video_duration - your duration reformatted as
HH:MM:SS, for labels and sanity checks.
It's an output node, so after running you see a summary in the node UI: frame rate, frame count, and duration at a glance.
Inputs
- fps - 1.0 to 480.0, default 30.0.
- duration_seconds - integer seconds, default 0. (Yes, a 0-second clip gives 0 frames - it won't guess for you.)
Outputs: frame_rate, frame_rate_int, frames_number, video_duration.
Install
ComfyUI Manager (search "YarvixPA") or
cd ComfyUI/custom_nodes
git clone https://github.com/YarvixPA/ComfyUI-YarvixPA
restart. Under ComfyUI-YarvixPA/Utils/Video.
Where people trip
Two things. First, duration_seconds is an integer - you can't type 4.5. If you need half-seconds, multiply: 9 seconds at 30fps is the same 270 frames as 4.5 at 60, or just use the audio calculator with a real clip. Second, and this is the real trap, video models don't accept arbitrary frame counts - many expect a multiple of 8 or a specific length, and the rounding this node does won't enforce that. If the model complains, round your frames_number up (or down) to the nearest valid value yourself. The node gets you in the right neighborhood; the model owns the final say.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| fps | FLOAT | 30.01β480 | β |
| duration_seconds | INT | 0 | β |
Outputs (4)
| Name | Type | Description |
|---|---|---|
| frame_rate | FLOAT | β |
| frame_rate_int | INT | β |
| frames_number | INT | β |
| video_duration | STRING | β |