Nodes/AnimateDiff Evolved/Adjust Weight [Indiv-Attnβ—†Add] πŸŽ­πŸ…πŸ…“
ComfyUI Node Runs on cloud

Adjust Weight [Indiv-Attnβ—†Add] πŸŽ­πŸ…πŸ…“

Additive offsets down to the Q/K/V level of AnimateDiff's attention

By KosinkadinkΒ·Created 3 years agoΒ·Updated 8 days agoΒ· 3,519
Adjust Weight [Indiv-Attnβ—†Add] πŸŽ­πŸ…πŸ…“
  • prev_weight_adjust
  • WEIGHT_ADJUST
β—„pe_ADD0.0000β–Ί
β—„attn_ADD0.0000β–Ί
β—„attn_q_ADD0.0000β–Ί
β—„attn_k_ADD0.0000β–Ί
β—„attn_v_ADD0.0000β–Ί
β—„attn_out_weight_ADD0.0000β–Ί
β—„attn_out_bias_ADD0.0000β–Ί
β—„other_ADD0.0000β–Ί
β—„print_adjustmentfalseβ–Ί

This is the deepest node in AnimateDiff-Evolved's Weight Adjust family - the one that splits "attention" apart into query, key, value, output-weight, and output-bias, and lets you add an offset to each independently, on top of separate offsets for positional encoding and everything else. If ADE_AdjustWeightIndivAdd treats attention as one bucket, this treats it as five.

Where it fits

Positional encoding, attention, and "other" are the three broad weight categories in the motion module. ADE_AdjustWeightIndivAdd lets you offset each of those three as a whole. This node keeps pe_ADD and other_ADD the same, but blows attention open into the actual sub-components of a self-attention block: the query projection, key projection, value projection, the output projection's weight, and the output projection's bias. That's the kind of granularity you'd reach for only after establishing that a coarser adjustment (this pack's simpler weight nodes, or the ordinary scale/effect multivals) already gets you close but not quite where you want, and you have a specific reason to believe one particular attention sub-component is the culprit. For most workflows that's never going to happen - this is deep experimental/research territory inside the motion module's internals, not a normal tuning knob.

Inputs and output

Eight float fields, all default 0, range βˆ’2 to 2:

  • pe_ADD - offset for positional-encoding weights.
  • attn_ADD - a blanket offset applied to attention as a whole, alongside the finer sub-fields below.
  • attn_q_ADD, attn_k_ADD, attn_v_ADD - offsets for the query, key, and value projections specifically.
  • attn_out_weight_ADD, attn_out_bias_ADD - offsets for the attention block's output projection, weight and bias separately.
  • other_ADD - offset for everything outside PE and attention.

Plus print_adjustment (bool, off by default) - with eight interacting values, turning this on to see what's actually being applied is close to mandatory rather than optional. Chain a prev_weight_adjust (WEIGHT_ADJUST) in to stack this on an earlier weight adjustment. Output is WEIGHT_ADJUST, wired into whichever node in your graph collects per-model AnimateDiff settings.

Installing the pack

ComfyUI Manager: search AnimateDiff Evolved, confirm Kosinkadink as author, install, restart. Manually:

cd ComfyUI/custom_nodes
git clone https://github.com/Kosinkadink/ComfyUI-AnimateDiff-Evolved

restart. No model file for this node itself, but you need a motion module (mm_sd_v15_v2, v3_sd15_mm, and similar) sitting in ComfyUI/models/animatediff_models.

Common issues

Eight knobs, no clear starting point. There's no published set of "good" values here - this is a fine-grained experimental tool, not a preset system. If you're not already sure which sub-component you want to touch, start with the coarser ADE_AdjustWeightIndivAdd node instead (which offsets PE/attention/other as three buckets) and only drop to this level once you've narrowed down that attention specifically, and not PE or "other," is where the problem lives.

Values interact in ways that are hard to predict. attn_ADD and the five sub-fields aren't independent in effect even though they're independent in the UI - changing attn_q_ADD changes what the query projection contributes, which changes what the whole attention block computes, which is also affected by attn_ADD. Change one field at a time.

You changed something and see nothing. As with every node in this family, the WEIGHT_ADJUST output does nothing until it's wired into your model settings node - confirm the connection before concluding the values don't matter.

KB gap: we have no documented real-world use cases for adjusting individual attention sub-components - what problem attn_v_ADD specifically solves versus attn_q_ADD, for instance, isn't something our sources cover. That's worth capturing from the pack's own docs or user reports the next time this comes up.

CategoryAnimate Diff πŸŽ­πŸ…πŸ…“/ad settings/weight adjust

Inputs (10)

NameTypeDefaultDescription
pe_ADDFLOAT0.0000-2–2β€”
attn_ADDFLOAT0.0000-2–2β€”
attn_q_ADDFLOAT0.0000-2–2β€”
attn_k_ADDFLOAT0.0000-2–2β€”
attn_v_ADDFLOAT0.0000-2–2β€”
attn_out_weight_ADDFLOAT0.0000-2–2β€”
attn_out_bias_ADDFLOAT0.0000-2–2β€”
other_ADDFLOAT0.0000-2–2β€”
print_adjustmentBOOLEANfalseβ€”
prev_weight_adjustoptWEIGHT_ADJUSTβ€”

Outputs (1)

NameTypeDescription
WEIGHT_ADJUSTWEIGHT_ADJUSTβ€”