Audio Duration & Frames
How long is that clip, really? Audio Duration gives you the answer as numbers
- audio
- duration_int
- duration_float
- frames
- audio_path
Audio Duration is the dumbest useful node in the Fictiverse pack: you feed it an audio clip and it tells you how long that clip is. That's the whole job, and it's the kind of thing you don't need until the moment you absolutely do.
Say you're building an audio-synced video workflow - load a track, generate a prompt, render frames to match. The sampler needs to know how many frames to produce, and how many frames depends on how long the audio runs. Without a duration node you're either eyeballing it in a media player and hardcoding the number (which breaks the moment you swap in a different track) or you're writing the math by hand. This node turns the answer into live numbers that flow through the graph.
How it works
ComfyUI audio loaders - the core Load Audio node and friends - hand audio around as a dict with two keys: a waveform tensor and a sample_rate. Duration is trivial math from those: the number of samples along the time axis divided by the sample rate. Audio Duration reads that same dict, so it works with any node that produces a proper AUDIO output, not just ComfyUI's own loader.
The one thing to know: the milliseconds output is computed first as an integer (int(...)), and the seconds value is then derived from that integer milliseconds number, not recomputed from the raw float. Fine for practical purposes, just don't expect sub-millisecond precision.
Inputs and outputs
The input list is genuinely one item:
- audio (AUDIO) - the clip to measure. Plug in any AUDIO socket.
Outputs:
- duration_ms (INT) - length in milliseconds.
- duration_sec (FLOAT) - same length in seconds, handy when the downstream node wants a float.
That's the whole graph: duration_sec is the one you'll actually wire somewhere, usually into a math node, a switch, or a loop that paces something off the audio length.
Installing it
It's part of ComfyUI Fictiverse Nodes, so it comes with the whole pack. Easiest path is ComfyUI Manager - search "ComfyUI Fictiverse Nodes" and hit install - or clone it manually:
cd ComfyUI/custom_nodes
git clone https://github.com/Fictiverse/ComfyUI_Fictiverse
Then restart ComfyUI. There's no requirements.txt to speak of and no model files to download - this node is pure Python reading a tensor, and the pack is Apache 2.0 so it's free to copy and reuse.
Common issues
The pack-level gotcha that bites people: Fictiverse imports its nodes via the hardcoded path custom_nodes.ComfyUI_Fictiverse.nodes.*, so the install folder has to be named exactly ComfyUI_Fictiverse. If Manager or a manual clone puts it in a differently-named folder you'll get ModuleNotFoundError: No module named 'custom_nodes.ComfyUI_Fictiverse' on load. Rename the folder and restart and it sorts itself out.
Beyond that, if the node throws, it's almost always because the thing feeding it isn't actually an AUDIO object - check that the wire comes from a real audio loader and not a preview or VAE output. And note it measures the clip you loaded; if you've trimmed or stretched audio upstream, it measures whatever tensor lands on its input.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| audio_pathopt | STRING | — | |
| audioopt | AUDIO | — | |
| fpsopt | FLOAT | — |
Outputs (4)
| Name | Type | Description |
|---|---|---|
| duration_int | INT | — |
| duration_float | FLOAT | — |
| frames | INT | — |
| audio_path | STRING | — |