Audio Reactive Transform
Make your video move with the music — the whole point of this pack
- image
- audio_weights
- background_image
- mask
- image_batch
- frame_count
Audio Reactive Transform is the marquee node of NodeSweet's audio half, and it's what the pack's example workflow is built around. You feed it one foreground image, a list of FLOATS audio weights, and it returns a whole batch of frames - one per weight - with the image scaled, rotated, and faded according to how loud the audio is at that moment. Wire that batch into VHS_VideoCombine and you've got a music-reactive video. It's the ComfyUI-native version of a visualizer pattern the community has chased for years, minus the After Effects.
The mechanism is straightforward and entirely CPU-bound. The node takes the first frame of your foreground image, and for each weight in your list it normalizes the weights to [0,1], then interpolates three parameters between their min/max bounds: scale (scale_min→scale_max, default 1.0→1.5), rotation (rotation_min→rotation_max, default 0→15 degrees), and opacity (opacity_min→opacity_max, default 0.3→1.0). Each frame gets an inverse-mapping affine transform (bilinear, pure numpy) and is composited over the background.
The optional inputs are where it gets flexible:
- background_image - a static image to composite the transforming foreground over. The classic setup is white text over a photo.
- mask - controls which pixels of the foreground get transformed, e.g. isolating white text from a photo. Pass a
MASKand only the masked region animates; without it, the whole foreground transforms.
Outputs are image_batch (an IMAGE tensor, one frame per audio weight - keep the order, it matches the music) and frame_count (an INT, just len(audio_weights), handy for driving anything that needs to know the length).
The full flow from the pack's own audio_reactive_mask_video.json: Load Audio → Audio Analysis → AudioWeightsRemap → AudioReactiveTransform → VHS_VideoCombine. AudioWeightsRemap is worth including - raw weights are spiky, and a little smoothing there saves you from a jittery result here.
Install is the pack default: ComfyUI Manager → search "Batch BBox Detector" → Install, or
cd ComfyUI/custom_nodes && git clone https://github.com/rslosch/comfyui-nodesweet
then restart. The node is pure numpy/PyTorch - no models, no downloads. (The example workflow itself references Load Audio Separation Model and an Audio Analysis node, which come from other packs - install those if you load it as-is.)
Where people get burned: this is a per-frame CPU affine transform, and it adds up. A 300-frame batch at 1080p will make you wait; keep the foreground small if you can. Also remember only image[0] is used - if you wire in a batch of images expecting all of them to animate, you're getting the first frame only. And set expectations on "audio reactive": most of the jaw-dropping stuff posted online is AE editing, not a node graph. This node does one honest thing - beat-driven scale, rotation, and fade - and it does it cleanly.
Inputs (10)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | — | |
| audio_weights | FLOATS | — | |
| scale_min | FLOAT | 1.000.1–5 | — |
| scale_max | FLOAT | 1.500.1–5 | — |
| rotation_min | FLOAT | 0-360–360 | — |
| rotation_max | FLOAT | 15-360–360 | — |
| opacity_min | FLOAT | 0.300–1 | — |
| opacity_max | FLOAT | 1.000–1 | — |
| background_imageopt | IMAGE | — | |
| maskopt | MASK | — |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| image_batch | IMAGE | — |
| frame_count | INT | — |