Flex Audio Visualizer Contour β‘π ‘π π £π
Audio bars that trace a shape instead of a line
- audio
- mask
- opt_feature
- IMAGE
- MASK
Most audio visualizers give you a straight row of bars. This one gives you bars (or a line) growing outward or inward from the outline of a shape - a circle, a silhouette, whatever mask you hand it. Give it a mask of a person's outline and audio of them talking, and you get bars radiating off their silhouette in time with the sound. It's the more elaborate cousin of FlexAudioVisualizerLine, and the extra complexity is entirely in service of that one trick.
How it works
It needs two inputs the plain-line version doesn't: audio to analyze, and mask - the shape whose outline gets traced. Under the hood it detects contours in that mask (it can find multiple separate shapes in one mask, not just one), and distributes the visualization's bars or line segments around each contour's perimeter. visualization_feature chooses frequency (spectrum analysis) or waveform (raw amplitude) as the data source, and visualization_method picks bar (individual segments extending from the contour) or line (one continuous line following it).
Everything else shapes how the bars sit on the contour: bar_length (how far they extend), line_width, direction - outward (away from the shape), inward (toward its center), or both at once - and num_points (how many samples run around the outline). contour_smoothing cleans up a jagged detected outline before drawing on it. If your mask has several disconnected regions, min_contour_area filters out ones too small to matter, max_contours caps how many get processed, and distribute_by decides how audio data gets split between them - area and perimeter give bigger shapes more points, equal splits evenly regardless of size.
As with the rest of the Flex family, an optional opt_feature can additionally modulate one of the node's own parameters (feature_param - smoothing, rotation, num_points, fft_size, min/max frequency, bar_length, line_width, contour_smoothing, direction, min_contour_area, max_contours, and one more beyond that), gated by feature_threshold and scaled by strength, with feature_mode choosing relative vs. absolute application. Most of the time the audio itself is doing the reactive work through visualization_feature; opt_feature is for stacking a second, independent reactive layer on top.
Inputs and outputs that matter
Start with audio, mask, visualization_method, and bar_length/line_width - that's enough to get something visible on screen. Tune min_contour_area/max_contours afterward if your mask has noisy small regions you don't want traced. Outputs are IMAGE (the rendered visualization) and MASK (the same render as a mask, for compositing or recoloring downstream).
How to install it
ComfyUI Manager, search "RyanOnTheInside," or manually:
cd ComfyUI/custom_nodes
git clone https://github.com/ryanontheinside/ComfyUI_RyanOnTheInside
cd ComfyUI_RyanOnTheInside
pip install -r requirements.txt
then restart. Contour detection runs on OpenCV, and audio analysis on librosa - both come from the shared requirements.txt, so a clean install of that file is what actually matters here, not any per-node setup.
Common issues & troubleshooting
No bars show up at all. The most common cause is a mask that OpenCV can't find any usable contour in - a fully black mask, or one where every region falls under min_contour_area. Check your mask actually has a clear white shape on a black background before assuming the audio side is the problem.
Too many tiny, noisy bars. Raise min_contour_area to filter out small detected regions, or lower max_contours - a busy mask with lots of small blobs will otherwise scatter your audio data across way more shapes than you intended.
The effect looks static despite loud audio. Confirm visualization_feature matches what you expect (frequency vs waveform behave very differently on the same source), and that bar_length/num_points are large enough to actually be visible at your canvas resolution - a subtle setting can technically be "reacting" while being invisible at a glance.
Inputs (23)
| Name | Type | Default | Description |
|---|---|---|---|
| strength | FLOAT | 1.000β1 | Strength of parameter modulation (0.0 to 1.0) |
| feature_threshold | FLOAT | 0.000β1 | Minimum feature value to trigger the effect (0.0 to 1.0) Only applies the effect when the feature value exceeds this threshold. Lower values make the effect more sensitive, higher values make it more selective. |
| feature_param | COMBO | Parameter to modulate based on the optional feature input | |
| feature_mode | COMBO | relative | Mode of parameter modulation ('relative' or 'absolute') |
| audio | AUDIO | Input audio to visualize | |
| frame_rate | FLOAT | 301β240 | Frame rate of the output visualization (1.0 to 240.0 fps) |
| mask | MASK | Input mask to find contours from - can contain multiple distinct areas | |
| visualization_method | COMBO | bar | Visualization style: - bar: Individual bars extending from the contour - line: Continuous line following the contour |
| visualization_feature | COMBO | frequency | Data source for visualization: - frequency: Shows frequency spectrum analysis - waveform: Shows direct audio amplitude |
| smoothing | FLOAT | 0.500β1 | Amount of smoothing applied to the visualization (0.0 to 1.0) |
| num_points | INT | 3603β1000 | Number of points in contour visualization (3 to 1000) |
| fft_size | INT | 2048256β8192 | FFT window size for frequency analysis (256 to 8192) |
| min_frequency | FLOAT | 2020β20000 | Minimum frequency to visualize (20.0 to 20000.0 Hz) |
| max_frequency | FLOAT | 800020β20000 | Maximum frequency to visualize (20.0 to 20000.0 Hz) |
| bar_length | FLOAT | 201β100 | Length of bars extending from contour (1.0 to 100.0 pixels) |
| line_width | INT | 21β10 | Width of visualization lines (1 to 10 pixels) |
| contour_smoothing | INT | 00β50 | Amount of smoothing applied to the contour (0 to 50) |
| rotation | FLOAT | 00β360 | Rotation angle in degrees (0.0 to 360.0) |
| direction | COMBO | outward | Direction of the visualization relative to the contour: - outward: Extends away from the contour - inward: Extends towards the center of the contour - both: Shows both inward and outward effects simultaneously |
| min_contour_area | FLOAT | 1000β10000 | Minimum area threshold for detecting contours (0.0 to 10000.0) |
| max_contours | INT | 51β20 | Maximum number of contours to process (1 to 20) |
| distribute_by | COMBO | perimeter | How to distribute audio data among multiple contours: - area: Larger contours get more data points - perimeter: Longer contours get more data points - equal: All contours get equal data points |
| opt_featureopt | FEATURE | Optional feature input for parameter modulation |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| IMAGE | IMAGE | β |
| MASK | MASK | β |