Nodes/Difforum/Difforum · Audio Analyzer
ComfyUI Node

Difforum · Audio Analyzer

Turn any audio file into per-frame curves your animation can dance to

By chillithebillis·Created 3 months ago·Updated about a month ago· 7
Difforum · Audio Analyzer
  • params
  • audio
  • audio_curves
  • amp
  • low
  • mid
  • high
  • onset
  • beat
smoothing0.25
normalizetrue
beat_sensitivity1.5

Deforum-style animation has always had a music-video soul, and Difforum · Audio Analyzer is where the beat enters the graph. Feed it an AUDIO clip and it measures the waveform once, then hands you six per-frame curves - amp, low, mid, high, onset, and beat - aligned one-to-one with your animation frames. Wire those into a Schedule's audio input and your expressions can react to the music: 0:(0.2 + 0.8*amp) for a bass-driven zoom, 0:(beat*45) for a spin that kicks on every downbeat.

The mechanics are refreshingly boring, which is the point. It's pure numpy FFT - no librosa, no torch audio models, nothing to download. The AUDIO input is ComfyUI's native audio tensor, which gets flattened to mono and analyzed in one pass:

  • amp - overall loudness (RMS), normalized 0–1.
  • low / mid / high - band energy: bass (~20–250 Hz), mids (~250 Hz–2 kHz), highs (2 kHz up).
  • onset - spectral flux, i.e. sudden attacks and hits.
  • beat - onset peaks gated into a 0/1 pulse with a short decay. That's your downbeat.

Because the analyzer knows your params (fps and max_frames), the curves come out exactly as long as the clip and stay in sync with the camera and strength schedules. That alignment is the whole trick - most audio tools give you samples, this one gives you frames, so there's no resampling step to get wrong.

The three tuning inputs are worth knowing:

  • smoothing (default 0.25) - exponential moving average over the curve. Too low and everything twitches frame-to-frame; too high and the bass "pump" turns into a slow heave. 0.2–0.3 is a good starting band.
  • normalize (default on) - scales the curves to 0–1 so they behave predictably in expressions regardless of how loud the file is.
  • beat_sensitivity (default 1.5) - the gate for what counts as a beat. If the beat curve is spitting out junk, raise it; if it's missing obvious hits, lower it.

Outputs: the bundled audio_curves (the DIFFORUM_AUDIO object you connect to Schedule and the camera nodes), plus each curve individually as a FLOAT list - handy if you want to drive a non-Difforum node with, say, the raw bass envelope.

Install

Standard pack install, zero audio dependencies:

cd ComfyUI/custom_nodes
git clone https://github.com/chillithebillis/Difforum.git difforum

Restart ComfyUI (console prints [Difforum] loaded N nodes), or use ComfyUI Manager → search "Difforum". The pack depends only on numpy, which ComfyUI already has - the author deliberately skipped librosa so this installs cleanly.

Common issues

  • "The curves don't line up with the video." Almost always a mismatch between this node's params and the downstream sampler's. Both must come from the same Anim Setup node - one source of truth. Mix two Setup nodes with different fps and the audio drifts from the frames.
  • Beat curve is useless. Check beat_sensitivity first, then smoothing. If your track is a wall of noise rather than discrete hits, onset is usually more musical than beat anyway.
  • Audio node not listed. You loaded the AUDIO via a loader the analyzer doesn't understand. Any node that emits ComfyUI's native AUDIO type works; if it doesn't, run the clip through a loader that produces a standard AUDIO tensor.

The classic first win: Audio Analyzer → two Schedules - one 1.0 + 0.6*low driving zoom, one beat*30 driving rotation - and suddenly the loop feels like it's performing. It's the single most satisfying node in the pack to see working, and it costs you a handful of numpy milliseconds per clip.

CategoryDifforum/audio

Inputs (5)

NameTypeDefaultDescription
paramsDIFFORUM_PARAMS
audioAUDIO
smoothingFLOAT0.250–0.99
normalizeBOOLEANtrue
beat_sensitivityFLOAT1.50.1–5

Outputs (7)

NameTypeDescription
audio_curvesDIFFORUM_AUDIO
ampFLOAT
lowFLOAT
midFLOAT
highFLOAT
onsetFLOAT
beatFLOAT