Nodes/RyanOnTheInside/Flex Audio Visualizer Contour βš‘πŸ…‘πŸ…žπŸ…£πŸ…˜
ComfyUI Node

Flex Audio Visualizer Contour βš‘πŸ…‘πŸ…žπŸ…£πŸ…˜

Audio bars that trace a shape instead of a line

By ryanontheinsideΒ·Created 2 years agoΒ·Updated 5 months agoΒ· 852
Flex Audio Visualizer Contour βš‘πŸ…‘πŸ…žπŸ…£πŸ…˜
  • audio
  • mask
  • opt_feature
  • IMAGE
  • MASK
β—„strength1.00β–Ί
β—„feature_threshold0.00β–Ί
β—„feature_paramβ–Ύβ–Ί
β—„feature_moderelativeβ–Ί
β—„frame_rate30β–Ί
β—„visualization_methodbarβ–Ί
β—„visualization_featurefrequencyβ–Ί
β—„smoothing0.50β–Ί
β—„num_points360β–Ί
β—„fft_size2048β–Ί
β—„min_frequency20β–Ί
β—„max_frequency8000β–Ί
β—„bar_length20β–Ί
β—„line_width2β–Ί
β—„contour_smoothing0β–Ί
β—„rotation0β–Ί
β—„directionoutwardβ–Ί
β—„min_contour_area100β–Ί
β—„max_contours5β–Ί
β—„distribute_byperimeterβ–Ί

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.

CategoryRyanOnTheInside/FlexFeatures/Targets/Audio/Visualizers

Inputs (23)

NameTypeDefaultDescription
strengthFLOAT1.000–1Strength of parameter modulation (0.0 to 1.0)
feature_thresholdFLOAT0.000–1Minimum 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_paramCOMBOParameter to modulate based on the optional feature input
feature_modeCOMBOrelativeMode of parameter modulation ('relative' or 'absolute')
audioAUDIOInput audio to visualize
frame_rateFLOAT301–240Frame rate of the output visualization (1.0 to 240.0 fps)
maskMASKInput mask to find contours from - can contain multiple distinct areas
visualization_methodCOMBObarVisualization style: - bar: Individual bars extending from the contour - line: Continuous line following the contour
visualization_featureCOMBOfrequencyData source for visualization: - frequency: Shows frequency spectrum analysis - waveform: Shows direct audio amplitude
smoothingFLOAT0.500–1Amount of smoothing applied to the visualization (0.0 to 1.0)
num_pointsINT3603–1000Number of points in contour visualization (3 to 1000)
fft_sizeINT2048256–8192FFT window size for frequency analysis (256 to 8192)
min_frequencyFLOAT2020–20000Minimum frequency to visualize (20.0 to 20000.0 Hz)
max_frequencyFLOAT800020–20000Maximum frequency to visualize (20.0 to 20000.0 Hz)
bar_lengthFLOAT201–100Length of bars extending from contour (1.0 to 100.0 pixels)
line_widthINT21–10Width of visualization lines (1 to 10 pixels)
contour_smoothingINT00–50Amount of smoothing applied to the contour (0 to 50)
rotationFLOAT00–360Rotation angle in degrees (0.0 to 360.0)
directionCOMBOoutwardDirection 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_areaFLOAT1000–10000Minimum area threshold for detecting contours (0.0 to 10000.0)
max_contoursINT51–20Maximum number of contours to process (1 to 20)
distribute_byCOMBOperimeterHow 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_featureoptFEATUREOptional feature input for parameter modulation

Outputs (2)

NameTypeDescription
IMAGEIMAGEβ€”
MASKMASKβ€”