Nodes/Akatz Custom Nodes/Audioreactive Dilate Mask Infinite | Akatz
ComfyUI Node

Audioreactive Dilate Mask Infinite | Akatz

Dilate a mask to the beat — and output it as color

By akatz-ai·Created 2 years ago·Updated 9 months ago· 33
Audioreactive Dilate Mask Infinite | Akatz
  • mask
  • normalized_amp
  • IMAGE
mask_colors(255, 0, 0), (0, 255, 0), (0, 0, 255)
threshold0.50
dilation_speed30
quality_factor0.15
should_composite_subjectfalse
subject_mask_color255, 0, 0
initial_background_color0, 0, 0
start_frame0
end_frame0

Audioreactive Dilate Mask Infinite is the big sibling of the plain audioreactive dilate node: it takes a mask, dilates it to the music, and instead of handing back a plain mask it renders the result as a colored IMAGE - multiple masks in multiple colors, composited over a background, ready to be a visual layer.

The "infinite" in the name is the giveaway. The finite version is tied to the batch length and radius limits; this one is built around a start_frame/end_frame window and a per-frame schedule, which makes it feel like it runs as long as your music does. Where you'd reach for it: full-frame visualizer layers, beat-synced title reveals, or a subject that swells with the kick drum and is output directly as a colored graphic rather than a mask you'd have to composite yourself.

How it works

Like the rest of the family, it's OpenCV dilation driven by per-frame amplitude - the normalized_amp input is the per-frame float list (wire it from the pack's Schedule Audio Framesync node). But instead of one mask and one radius, it accepts mask_colors - a list like (255, 0, 0), (0, 255, 0) - and treats each color as a separate dilation layer. The threshold decides when a frame's amplitude is "on" enough to dilate, and dilation_speed sets pixels per frame. quality_factor trades render speed for smoothness (the author suggests 0.25 down to 0.15). The output is a color-composited IMAGE, with an optional subject overlay via should_composite_subject and subject_mask_color.

Inputs that matter

  • mask - the mask to dilate (one per frame, or a single mask reused).
  • normalized_amp - per-frame amplitude values, roughly 0–1. The node validates this must be a NORMALIZED_AMPLITUDE or FLOAT type.
  • mask_colors - one RGB tuple per dilation layer.
  • threshold - amplitude level that triggers dilation, default 0.5.
  • dilation_speed - pixels per frame, default 30.
  • quality_factor - speed/quality balance, default 0.15.
  • should_composite_subject, subject_mask_color, initial_background_color - whether and how the subject mask is drawn over the colored layers.

Output is a single IMAGE batch. If you wanted a plain mask instead, use the non-"Infinite" audioreactive nodes.

Installing it

Part of akatz-ai/ComfyUI-AKatz-Nodes. Install via ComfyUI Manager (search "AKatz") or:

cd ComfyUI/custom_nodes
git clone https://github.com/akatz-ai/ComfyUI-AKatz-Nodes
cd ComfyUI-AKatz-Nodes
pip install -r requirements.txt

Restart ComfyUI. No model downloads; requirements are numpy, torch, opencv-python and pydub.

Common issues

The schedule string is the footgun - mask_colors has to match the (r, g, b), (r, g, b) format exactly or the parser returns nothing and you get an error. And because this node outputs IMAGE rather than MASK, don't wire it where a mask type is required; convert or use the mask-returning sibling. If nothing dilates, check that normalized_amp actually reaches above threshold - a flat, quiet track will never trip it.

Category💜Akatz Nodes/Mask

Inputs (11)

NameTypeDefaultDescription
maskMASK
normalized_amp*
mask_colorsSTRING(255, 0, 0), (0, 255, 0), (0, 0, 255)
thresholdFLOAT0.50
dilation_speedINT30
quality_factorFLOAT0.150–1
should_composite_subjectBOOLEANfalse
subject_mask_colorSTRING255, 0, 0
initial_background_colorSTRING0, 0, 0
start_frameINT0
end_frameINT0

Outputs (1)

NameTypeDescription
IMAGEIMAGE