Feature Peak Detector β‘π ‘π π £π
Isolate the actual hits instead of reacting to every wiggle
- feature
- FEATURE
A raw audio-derived feature is full of small local maxima - every tiny fluctuation technically "peaks" at some point. If your effect reacts to all of them, it looks nervous and cluttered instead of hitting on the beats that actually matter. Feature Peak Detector filters that down to the peaks (or, flipped, the troughs) that genuinely stand out, using the same kind of prominence/distance/width controls you'd find in a signal-processing peak-finding tool.
If you're new to the RyanOnTheInside pack (Ryan / u/ryanontheinside, also behind ComfyStream and Daydream's real-time reactive video work): a FEATURE is a per-frame value curve, extracted from a source and reshaped by Feature Modulator nodes like this one before it drives a Flex node's parameter or an external target.
How it works
prominence is the main knob - it controls how much a local maximum needs to stand out from the surrounding values before it counts as a real peak, so raising it filters out the small bumps and keeps only the genuine standouts. distance enforces a minimum gap in frames between accepted peaks, which stops the detector from flagging two peaks that are really just one hit with a wobble on top. width and plateau_size set minimum requirements on how wide a peak (or a flat-topped peak) needs to be to count, which helps filter out single-frame noise spikes that aren't a sustained event. Flip detect_valleys on and the same logic runs on the inverted curve, finding troughs instead.
Inputs and outputs that matter
feature(required) - the curve to detect peaks in.prominence(0.0β1.0, default 0.1) - how much a peak has to stand out from its surroundings; the setting you'll adjust most.distance(1β100 frames, default 1) - minimum spacing between accepted peaks.width(1β100 frames, default 1) - minimum width a peak needs to count.plateau_size(1β100 frames, default 1) - minimum size of a flat-topped peak.detect_valleys- detect troughs instead of peaks.invert_output- flips the resulting curve.
Output is a single FEATURE, wired into a Flex node's optional feature input or into another modulator.
Installing it
Via ComfyUI Manager: search RyanOnTheInside. Manual install:
cd ComfyUI/custom_nodes
git clone https://github.com/ryanontheinside/ComfyUI_RyanOnTheInside
cd ComfyUI_RyanOnTheInside
pip install -r requirements.txt
Pure signal-processing math on an already-extracted feature - no models, no GPU work - though it ships with the pack's full dependency set for the extraction nodes elsewhere.
Where people get tripped up
If a v1-to-v2 update leaves the pack broken, the README's fix is a full uninstall and reinstall, not a git pull.
The default prominence of 0.1 is fairly permissive - on a noisy or heavily-processed audio feature, that's often enough to catch a lot of near-peaks you don't actually want, giving you far more "peaks" than there are real hits in the source material. If you're getting a cluster of detected peaks around what should be a single beat, raise prominence before touching anything else, and only reach for distance once prominence alone can't separate genuinely distinct peaks that happen to sit close together. It's also worth running your feature through Feature Smoothing before this node if the source is especially jittery - a smoother input curve makes prominence-based detection far more predictable.
Inputs (7)
| Name | Type | Default | Description |
|---|---|---|---|
| feature | FEATURE | Input feature to detect peaks from | |
| prominence | FLOAT | 0.100β1 | How much a peak needs to stand out from surrounding values (0.0 to 1.0) |
| distance | INT | 11β100 | Minimum number of frames between peaks (1 to 100) |
| width | INT | 11β100 | Minimum width of peaks in frames (1 to 100) |
| plateau_size | INT | 11β100 | Minimum size of flat peaks in frames (1 to 100) |
| detect_valleys | BOOLEAN | false | When enabled, detects troughs instead of peaks |
| invert_output | BOOLEAN | false | β |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| FEATURE | FEATURE | β |