Nodes/ComfyUI_agilly1989_motorway/UNetSelfAttentionMultiply_motorway_edition
ComfyUI Node

UNetSelfAttentionMultiply_motorway_edition

Scaling how much the image pays attention to itself

By agilly1989·Created 2 years ago·Updated about a year ago· 7
UNetSelfAttentionMultiply_motorway_edition
  • MOTORWAY 🚌💨
  • MOTORWAY 🚌💨
INPUT_model_keymodel
q1.00
k1.00
v1.00
out1.00
OUTPUT_MODEL_keyMODEL

Diffusion models run on two kinds of attention. Cross-attention (attn2) is where text meets image. Self-attention (attn1) is where the image looks at itself - pixels and patches relating to other patches in the same image. This node is the self-attention sibling of the cross-attention multiplier: it scales the q/k/v/out tensors of every self-attention layer in your model by hand-set constants. The stock node lives under _for_testing/attention_experiments in ComfyUI, and this _motorway_edition clone brings the same experiment to the agilly1989 Motorway pipe.

Motorway, in 20 words: start with MotorwayStart, then each _motorway_edition node swaps data wires for key strings, reading and writing a shared dict that flows down one MOTORWAY connection. The clones are generated from ComfyUI's own registry, so underneath, this is the stock node.

What it does. It patches the model so every self-attention layer's query, key, value, and output tensors get multiplied by your q, k, v, out floats (each default 1.0, range 0–10). All ones and it's a no-op. Scale self-attention down and the image's internal coherence loosens - different regions stop checking in with each other, which is a classic recipe for "globally incoherent but locally detailed" output. Scale it up and structure gets stiffer. Like all attention-multiply hacks, the effect is subtle, model-dependent, and easy to overdo.

The inputs that matter. MOTORWAY is required. INPUT_model_key (default model) is where the base model lives in the dict - remember loaders default to uppercase MODEL, so line that up. Four sliders (q, k, v, out) are the whole experiment. OUTPUT_MODEL_key (default MODEL) is where the patched model is stored. Output: the MOTORWAY port only.

Common issues. This is a tinkerer's node with no "right" answer; the community mostly treats attention multipliers as a curiosity, not a reliable style tool. The Motorway's usual traps apply - keys are exact-match and case-sensitive, and 'MotorwayClass' object has no attribute 'hash_' is just "key not found." And be aware: the pack's current main branch has the clone registration commented out in __init__.py, so if the node isn't in your menu, that's the version, not a broken install. Install via ComfyUI Manager (search "ComfyUI_agilly1989_motorway") or git clone into custom_nodes - no models, no dependencies. Solo-dev beta pack, so expect it to behave like a sandbox: play, observe, don't build your whole workflow on it.

Categoryagilly1989 Nodes/Motorway-ed/_for_testing/attention_experiments

Inputs (7)

NameTypeDefaultDescription
MOTORWAY 🚌💨MOTORWAY 🚌💨
INPUT_model_keySTRINGmodel
qFLOAT1.000–10
kFLOAT1.000–10
vFLOAT1.000–10
outFLOAT1.000–10
OUTPUT_MODEL_keySTRINGMODEL

Outputs (1)

NameTypeDescription
MOTORWAY 🚌💨MOTORWAY 🚌💨