Nodes/RyanOnTheInside/Audio Info βš‘πŸ…‘πŸ…žπŸ…£πŸ…˜
ComfyUI Node

Audio Info βš‘πŸ…‘πŸ…žπŸ…£πŸ…˜

The node that answers 'how many frames is my song' before you build anything

By ryanontheinsideΒ·Created 2 years agoΒ·Updated 5 months agoΒ· 852
Audio Info βš‘πŸ…‘πŸ…žπŸ…£πŸ…˜
  • audio
  • total_frames
  • frames_per_beat
  • frames_per_bar
  • frames_per_quarter
  • frames_per_eighth
  • audio_duration
  • beats_per_second
  • detected_bpm
  • detected_bpm_rounded
  • sample_rate
  • num_channels
  • num_samples
  • max_amplitude
  • mean_amplitude
  • rms_amplitude
  • bit_depth
  • detected_key
β—„frame_rate30.0β–Ί

Before you build an audio-reactive video workflow, you need a handful of boring numbers: how many frames does this clip need at my frame rate, what's the tempo, is it loud enough to bother normalizing. Audio Info answers all of that in one node instead of you doing math in your head or opening the file in an editor first. Drop it right after you load audio and wire its outputs wherever the rest of your graph needs them.

What it does

You give it audio and a frame_rate (default 30 fps, the target rate your animation will run at), and it hands back a pile of derived numbers: total_frames (audio duration Γ— frame_rate, the exact batch length your video needs to stay in sync), frames_per_beat/frames_per_bar/frames_per_quarter/frames_per_eighth (so you can snap effects to musical subdivisions without doing the arithmetic yourself), audio_duration and beats_per_second, detected_bpm and detected_bpm_rounded (automatic tempo detection - no tapping along to figure out the BPM), sample_rate, num_channels, num_samples, bit_depth, three loudness stats (max_amplitude, mean_amplitude, rms_amplitude), and detected_key (an automatic musical key guess, handy if you're about to prompt ACE-Step for a track in a specific key).

The two you'll actually set are the audio input and the frame rate. Everything else is read-only output. The most useful ones for a beginner: total_frames wires straight into any node that needs a batch size or frame count (like EmptyImageAndMaskFromAudio, if you're using that separately, or your video-length settings), and frames_per_beat gets you clean beat-synced pulses without manual BPM math.

Why this matters in the wider workflow

This pack's whole pitch is "everything reacts to audio" - but before anything can react, your video length has to actually match your audio length, and your effects need to know where the beats are. Audio Info is the node that makes both of those things numbers you can wire in, instead of guesses you bake in by hand and have to redo every time you swap the track.

Installing it

Via ComfyUI Manager: search RyanOnTheInside, install, restart. Or manually:

cd ComfyUI/custom_nodes
git clone https://github.com/ryanontheinside/ComfyUI_RyanOnTheInside
cd ComfyUI_RyanOnTheInside
pip install -r requirements.txt

Restart ComfyUI. Nothing here needs a model download - this node is pure signal analysis (the pack pulls in scipy and friends for this kind of thing), so once the pack's installed you're set.

Where people get burned

detected_bpm and detected_key are estimates from onset/beat-tracking heuristics, not ground truth - they're genuinely useful as a starting point, but ambiguous or syncopated material can fool any automatic beat tracker, this one included. If the reported BPM looks obviously wrong (half or double what you'd tap out by ear is the classic failure mode for beat detectors in general), trust your ears and hardcode the real value downstream instead.

Also: the numbers here are computed from whatever audio you feed in at that point in the graph. If you trim or pad the clip afterward with AudioTrim or AudioPad, total_frames and the rest go stale - run Audio Info again after any edit, not before it, if the downstream node actually needs the updated frame count.

This node is the author's own pack, and he's an active presence in the ComfyUI community (real-time video work under Daydream/ComfyStream, does creator streams, answers questions on his own release threads) - worth knowing if you hit something odd and want to check for a fix upstream rather than assume it's permanent.

CategoryRyanOnTheInside/Audio/Utility

Inputs (2)

NameTypeDefaultDescription
audioAUDIOInput audio to analyze
frame_rateFLOAT30.00.1–120Target frame rate for animation timing calculations (frames per second)

Outputs (17)

NameTypeDescription
total_framesINTβ€”
frames_per_beatINTβ€”
frames_per_barINTβ€”
frames_per_quarterINTβ€”
frames_per_eighthINTβ€”
audio_durationFLOATβ€”
beats_per_secondFLOATβ€”
detected_bpmFLOATβ€”
detected_bpm_roundedINTβ€”
sample_rateINTβ€”
num_channelsINTβ€”
num_samplesINTβ€”
max_amplitudeFLOATβ€”
mean_amplitudeFLOATβ€”
rms_amplitudeFLOATβ€”
bit_depthSTRINGβ€”
detected_keyCOMBOβ€”