Nodes/ComfyUI-AudioReactive/Smooth (Audio Op)
ComfyUI Node

Smooth (Audio Op)

Smooth — a Hann-window smoother that should be the pack's most-used node (if it worked)

By dmarx·Created 3 years ago·Updated 2 years ago· 11
Smooth (Audio Op)
  • signal
  • SIGNAL

OpSmooth (display name "Smooth (Audio Op)") is meant to be the node you reach for constantly: convolve the signal with a Hann window and hand back a smoothed envelope. In the source, it defaults to a window of length 150:

def smooth(k=150):
    def smooth_(y, sr=None):
        win_smooth = signal.windows.hann(k)
        filtered = signal.convolve(y, win_smooth, mode='same') / sum(win_smooth)
        return filtered
    return smooth_

That's a legit, textbook low-pass-ish smoothing: each output point becomes a weighted average of its neighborhood, which is exactly what you want after Rms or Novelty when the per-frame feature is jittery. Raw RMS output bounces around annoyingly; a smooth pass turns it into the kind of clean, predictable envelope that drives animation without flicker. In a mature version of this pack, Smooth would be the glue between "feature extraction" and "drive the animation."

Here's the honest part: it doesn't work yet. It's a factory - smooth(k=150) returns the real smoother - and the node wrapper calls every operator as f(y, sr), so it calls smooth(y, sr) with the signal as the window length. That returns a closure parked in the SIGNAL's y slot. The node runs without error and passes that function object downstream, where ARDrawSignal or SignalToCurve will throw a TypeError. The info_schema confirms the state: only a signal input, no window-length input at all.

What to do instead

  • If a workflow has "Smooth (Audio Op)" in it, expect it to break downstream.
  • Want smoothing today? The pack's Smoosh is a poor substitute (it compresses range rather than smoothing time), so the honest answer is: smooth in the curve domain. Take RmsSignalToCurve and apply easing/filtering to the KEYFRAMED_CURVE in whatever scheduler tooling you're using - it's the same math, just moved one node down the chain.
  • Watch the repo. The backend is complete and obviously useful; it's one k input away from being the pack's MVP.

Inputs and outputs

As shipped:

  • signal (SIGNAL) - in.
  • SIGNAL - out, containing a function object, not a smoothed signal. Don't build on it.

Installing it

Manager (search "AudioReactive") or:

cd ComfyUI/custom_nodes
git clone https://github.com/dmarx/ComfyUI-AudioReactive

Restart and wait through the first-load auto-install of scipy (which provides the Hann window and convolution), scikit-learn, librosa, loguru. ModuleNotFoundError: No module named 'keyframed' on load → pip install keyframed.

The takeaway

Smooth is the most obviously-missed working node in this pack - the backend is real, the need is real, and only the wrapper is missing. That's the story of the parameterized operators in dmarx's port of video-killed-the-radio-star: Smooth, Sustain, Bandpass, Clamp, Modulo, Pow, and Quantize are all stubs, while the no-parameter ops (Rms, Novelty, Stretch, Smoosh, Normalize, Pow2, Harmonic, Percussive, Predominant_Pulse) work today. Build on the working set, and treat the stubs as "check the repo before you rely on it."

CategoryAudioReactive/Operators

Inputs (1)

NameTypeDefaultDescription
signalSIGNAL

Outputs (1)

NameTypeDescription
SIGNALSIGNAL