Audio Duration
How long is this audio, in seconds? One output, that's the whole node
- audio
- second
This is the smallest node in the pack and it knows it. One input, one output, no options to misconfigure: give it an AUDIO tensor and it returns the length in seconds as a FLOAT. That's it. There's genuinely nothing more to the node - which is exactly why you'll reach for it: it's the missing "tell me how long this clip is" primitive that ComfyUI doesn't ship.
How it works
Under the hood it reads the audio dict's sample_rate and the waveform's sample count, then divides: samples / sample_rate = seconds. Standard digital-audio math, nothing clever. If the input is missing or malformed it returns 0.0 rather than erroring out - a polite little failure mode that keeps your graph alive when an upstream video node silently produced no audio track.
Where it earns its keep
The output is a plain FLOAT, so it plugs into anything that takes a number: condition a scheduling node on "start the next section at the end of the audio," drive a text node that stamps duration into metadata, or feed a comparison node for a "if longer than X seconds, use this path" branch. Video work is the natural home - most of the time the audio arrives via a node like Load Video to Image from the same pack, which unpacks the track alongside the frames; this is the node that tells you how long that track actually is before you commit to a frame count.
It also works as a sanity check. When you're trimming video with start_skip/end_skip and the output duration keeps surprising you, stick an Audio Duration on the track and you'll know instantly whether the trim is behaving or whether the audio and video are being cut differently.
Installing it
ComfyUI Manager, search "ComfyUI 1hewNodes", install, restart. Or:
cd ComfyUI/custom_nodes
git clone https://github.com/1hew/ComfyUI-1hewNodes
Then restart. Yes, this trivial node rides in the same fat repo as the pack's detection and background-removal stuff, so the install still pulls opencv, rembg, ultralytics and friends. The cost is the pack's, not the node's.
Gotchas
It reports duration from the samples it was given, not from any file on disk - if the upstream node already trimmed the audio, that's the duration you get. And 0.0 means "no usable audio," which is worth distinguishing from "a 0-second clip," because the node can't tell you which. Also: the output is seconds as a float, not a human "1:23" string - if you need minutes:seconds text for a label, wrap it in a formatting node.
Inputs (1)
| Name | Type | Default | Description |
|---|---|---|---|
| audio | AUDIO | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| second | FLOAT | — |