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

Threshold (Audio Op)

The Gate That Isn't Wired Up Yet

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

Let's get the honest version out first: as this pack is currently shipped, Threshold (Audio Op) doesn't actually run. You can drag it onto a graph, wire a signal in, hit execute, and it throws a TypeError before doing anything. That's not you messing up. That's a port that was left half-finished in January 2024, and this is one of the nodes where the scaffolding is visible.

What it's meant to do

Threshold is a gate. Feed it an audio signal and it's supposed to silence everything below a set level, y[y < low] = 0, and pass the loud stuff through untouched. In an audio-reactive animation pipeline that's the move where quiet passages stop driving your parameters, so your camera only twitches on the hits instead of jittering through the whole verse.

It's one of a whole family of ops in this pack - OpRms, OpNovelty, OpSmooth, OpBandpass, OpClamp, about twenty of them - all built on the same SimpleSignalOperation base. Each one is a one-line wrapper around a function in nodes/audio_utils.py, ported over from dmarx's older "Video Killed the Radio Star" Colab notebook, which is where this entire pack comes from. The README is a single sentence: "porting audioreactivity pipeline from vktrs to comfyui."

The catch, in detail

The signal-processing function behind this node is a factory: threshold(low) takes the cutoff level and returns a function that gates the samples. But the node's info_schema exposes exactly one input - signal (type SIGNAL) - and no threshold level, and the code never passes one. So when main() tries to call the factory, Python rejects the call: "threshold() got an unexpected keyword argument 'y'." The node's own error-handling retries, fails the same way, and that's the end of it.

Which is to say: this node is a stub that tells you what the finished op would do, not a node that does it. If you find a version where the author got around to plumbing the level through, great - it'll be the "gate the quiet parts" tool. As of the current snapshot, treat it as a preview.

The one input and the output

If it did run, the wiring is simple. In: signal, a SIGNAL (a dict of raw samples y plus sample rate sr that this pack threads between its audio nodes). Out: SIGNAL again, so you can chain ops - threshold, then smooth, then convert.

Installing the pack

Same story as every node in this pack. ComfyUI Manager (search "ComfyUI-AudioReactive"), or manually:

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

On load the pack pip-installs scipy, scikit-learn, librosa, and loguru itself. It will not install keyframed - and keyframed is imported at startup, so without it the whole pack fails to load. Install dmarx's ComfyUI-Keyframed pack (or pip install keyframed) or every node in here breaks, not just this one.

Bottom line

If your goal is audio-reactive animation in ComfyUI, don't build a workflow around this node yet. Its siblings that actually execute - OpSmooth, OpNormalize, OpRms, and the rest of the working ops - are where the value is. Consider Threshold a placeholder with a clear design intent: if dmarx ever finishes the port, this is the node you'll grab to kill the quiet, muddy low end of your driving signal. Right now it's the node you grab to confirm you read the source before trusting the name.

CategoryAudioReactive/Operators

Inputs (1)

NameTypeDefaultDescription
signalSIGNAL

Outputs (1)

NameTypeDescription
SIGNALSIGNAL