Nodes/ComfyUI-LTX-Attention-Toolkit/LTX Attn — QKV Multiplier
ComfyUI Node

LTX Attn — QKV Multiplier

The live, no-capture ablation knob

By g-raw·Created 3 months ago·Updated 2 months ago· 2
LTX Attn — QKV Multiplier
  • model
  • steered_model
targets24:8
apply_satrue
apply_catrue
qk_mult1.00
vo_mult1.00
from_step0
to_step999

Every other intervention node in this pack needs a prior capture - the whole two-run dance. QKV Multiplier doesn't. It's a live multiply: scale the attention sharpness and/or output magnitude of targeted heads while the generation runs, no store, no setup. That makes it the fastest way to test "what if I kill this head?" - the profiling-then-freeze loop collapses into a single run.

Its two knobs are also the pack's clearest lesson in what attention math actually does, so this node doubles as a crash course:

  • qk_mult rescales the softmax logits before attention weights are computed. It changes how sharp or flat the head's attention distribution is. Setting it to 0 does not ablate the head - it makes it attend uniformly over every key, and it still contributes via V. You made it unfocused, not dead.
  • vo_mult scales the head's actual contribution to the residual stream - V before the attn_weights @ V matmul, equivalently the head's slice of the output after (linear in V, so same net effect). Setting it to 0 is a true ablation: that head genuinely stops contributing.

So: vo_mult to kill or amplify a head; qk_mult to experiment with attention sharpness. The tooltips in the node spell this out, and it's worth trusting them over your first instinct. There's deliberately no separate q_mult/k_mult or v_mult/o_mult pair - Q and K are each a uniform per-head scalar, so only their product shows up in the logits, hence one qk_mult; same logic collapses V/O into vo_mult.

The inputs that matter

  • targets - same format as Head Freeze/QKV Transfer: block:head | block:h1,h2 | block:all | all. A whole-string all targets every block (0–47) and head (0–31). Multipliers are shared across all targets.
  • apply_sa / apply_ca - which attention types get scaled.
  • qk_mult / vo_mult - the two knobs above, range −10 to 10, default 1.0 (no-op). Note negatives are allowed - you can invert a head's contribution, which is a very particular kind of torture test.
  • from_step / to_step - the denoising step window the multiply is active for (defaults to full range 0–999).

Output is a single steered_model MODEL.

Disable by blanking

Same house rule as the other intervention nodes: clear targets to disable, don't use bypass/mute. This node patches the shared diffusion_model, and bypass/mute skips the code that unwraps its layer, leaving the multiplier in effect on later runs while looking disabled. Blank targets runs the cleanup reliably. LTX Reset Patches is the sweep if you've orphaned a layer.

Install

cd ComfyUI/custom_nodes
git clone https://github.com/g-raw/ComfyUI-LTX-Attention-Toolkit.git

Restart ComfyUI. No extra dependencies, no model files, no capture store required - this is the lowest-friction node in the pack to try. Work-in-progress caveat applies to the pack as a whole.

Common issues

The main trap is conceptual, not mechanical: reach for vo_mult=0 when you want to ablate a head, because qk_mult=0 just makes it a uniform attender and the result confuses people ("I zeroed it and nothing changed" - right, it's still contributing). Because it's live, it also stacks with other intervention nodes if you chain them - that's supported (each node registers its own layer), but remember each one also needs its own disable-by-blanking when you're done.

Categoryg_raw/LTX/Profiler

Inputs (8)

NameTypeDefaultDescription
modelMODEL
targetsSTRING24:8Same format as Head Freeze/QKV Transfer's targets: paste Head Candidates' candidates_csv directly (one 'block,head' per line), or type manually as 'block:head | block:h1,h2,... | block:all | ...'. A whole-string 'all' (or 'all:all') targets every block (0-47) and head (0-31). No prior capture needed -- this is a live multiply, not a replay. Leave blank to disable entirely -- this is the reliable way to turn it off; ComfyUI's node bypass/mute skips this node's cleanup, so the diffusion_model (shared across runs) can be left patched from a previous run.
apply_saBOOLEANtrue
apply_caBOOLEANtrue
qk_multFLOAT1.00-10–10Scales Q for the targeted heads before the attention dot product -- changes attention sharpness (softmax logit scale), not the head's output magnitude. 0 makes the head attend uniformly over all keys, it does NOT ablate it (still contributes via V). Scaling Q and K separately would be redundant -- both are uniform per-head scalars, so only their product changes the logits, hence a single knob.
vo_multFLOAT1.00-10–10Scales the targeted head's output (V before the attn_weights@V matmul, equivalently the head's slice of the output after -- same net effect either way since the matmul is linear in V, hence a single knob). Directly scales the head's contribution to the residual stream. 0 zeroes it out (true ablation).
from_stepINT00–999Denoising step (per targeted block) to start applying from. Defaults to the full range.
to_stepINT9990–999Denoising step (per targeted block) to stop applying at, inclusive. Defaults to the full range.

Outputs (1)

NameTypeDescription
steered_modelMODEL