Nodes/ComfyUI_Yvann-Nodes/Edit Audio Weights
ComfyUI Node

Edit Audio Weights

The polish step that makes audio weights actually usable

By yvann-ba·Created 2 years ago·Updated 6 months ago· 708
Edit Audio Weights
  • any_audio_weights
  • process_weights
  • graph_audio
smooth0.00
min_range0.00
max_range1.00

Raw audio weights from Audio Analysis are spiky. Every transient sends the value to 1, then it crashes to 0, and if you feed that straight into AnimateDiff or ControlNet you get animation that twitches instead of flowing. Edit Audio Weights is the smoothing and rescaling stage that turns raw, nervous weights into something a motion module can actually drive.

What it does

Two passes, in order:

  1. Smoothing. The smooth parameter (0 to 1, default 0) runs an exponential moving average over the weight list. At 0, nothing changes. At 1, every frame is a tiny nudge of the last - the curve becomes a lazy wave. Values around 0.5–0.8 are the sweet spot for "beats drive motion but don't spasm."
  2. Rescaling. The smoothed signal is normalized to 0–1, then stretched onto the range you set with min_range and max_range.

The output process_weights is a new FLOATS-style list, and graph_audio gives you a preview of the polished curve so you can see what the smoothing did before you wire it anywhere.

Where it plugs in

This is the node's real value: it's the adapter between the pack and two big ComfyUI ecosystems.

  • AnimateDiff - feed process_weights into AnimateDiff-Evolved's Multival (Float List) node to schedule motion strength with the music. The pack's own docs flag the important bit: AnimateDiff multival behaves best in the 0.9 to 1.3 range. That's why the min/max defaults here are 0 and 1 - you'll typically want to raise them, e.g. min_range = 0.95, max_range = 1.25, so the whole curve sits in the range where the motion module actually responds. A 0-to-1 weight list into AnimateDiff often just looks like "sometimes still, sometimes full speed" instead of a graded swell.
  • ControlNet - the same process_weights output feeds Latent Keyframe From List, letting the ControlNet's influence ramp up and down with the track.

So the mental model is: Audio Analysis measures → Edit Audio Weights shapes → the shaping determines whether it's usable by the tool you're driving. Almost every advanced workflow in this pack passes through this node on the way to a video model.

Inputs to care about

  • any_audio_weights - from Audio Analysis or Audio Peaks Detection (binary peaks work too, if you want steppy, hard-edged motion).
  • smooth - the only knob that changes the character of the result. Start at 0 to see the raw curve, then raise it until the motion stops feeling jittery.
  • min_range / max_range - set these to the target tool's happy zone (AnimateDiff: ~0.9–1.3; ControlNet keyframes: often 0–1).

A quick reality check

Smoothing kills snappiness, and snappiness is often the point of a beat-synced video. If you're making a hard-cut music video with Audio IPAdapter Transitions, you don't want this node in the path at all - the transitions node handles its own blending. Edit Audio Weights is for motion strength modulation, not image switching. Use it where the music should control how much the video moves, not what it shows.

Install

One line, same as the whole pack:

cd ComfyUI/custom_nodes
git clone https://github.com/yvann-ba/ComfyUI_Yvann-Nodes

(or ComfyUI Manager → search ComfyUI_Yvann-Nodes). AnimateDiff-Evolved isn't included - grab it from Manager if you're planning the multival route. The smoothing loop is pure numpy on the CPU, so this node is instant even on long clips.

Category👁️ Yvann Nodes/🔊 Audio

Inputs (4)

NameTypeDefaultDescription
any_audio_weightsFLOATSAudio weights from Audio Analysis or Audio Peaks Detection
smoothFLOAT0.000–1Smoothing factor (0=none, 1=max smoothing)
min_rangeFLOAT0.000–2.99Minimum output value after rescaling
max_rangeFLOAT1.000.01–3Maximum output value after rescaling

Outputs (2)

NameTypeDescription
process_weightsFLOAT
graph_audioIMAGE