ComfyUI Node

Excellent attention

A second pass over cross-attention for crisper prompts

By Extraltodeus·Created 2 years ago·Updated about a year ago· 66
Excellent attention
  • model
  • MODEL
scale2.0
enabledtrue

Attention is where your prompt actually lands in the image, and most of the "make the model listen harder" tricks in the custom node ecosystem are attention hacks of one kind or another. Excellent attention is this pack's entry: it runs cross-attention twice and combines the two passes in a way that amplifies prompt adherence, patched in at the middle block's cross-attention layer. The name is a joke that turns out to be the feature - it's just... good attention, applied again.

Here's the mechanism, roughly. Normally the model computes attention once: query, key, value in, attended output out. This node computes the normal attention, then feeds that output through attention a second time, and mixes the result with the query in a normed blend, scaled by the scale input (default 2). It's the classic "attend to the attention" pattern - the second pass sharpens where the model is already looking, and the scale controls how much the double-attention result displaces the original. Because it patches only attn2 (cross-attention) in the middle block, it's aimed squarely at prompt-to-image binding rather than the self-attention structural stuff.

The inputs are mercifully short: model, scale (default 2, range −1 to 10), and enabled (default on). Negative scales are allowed, which in practice produces the opposite of emphasis - a way to blunt cross-attention's influence in places, if that's ever what you need. enabled makes A/B testing painless: flip it off and the patch is skipped entirely, returning the model untouched, so you can compare on a fixed seed.

Why you'd reach for it: subjects that keep losing their defining features at distance, complex prompts where the model drifts toward the dominant token, or any render where you want tighter prompt binding without raising CFG (which costs render time and risks burn). It's in the model_patches category rather than the pre-CFG group because it works through attention patching, not the CFG arithmetic - but it ships in the same pack and chains fine alongside the pre-CFG nodes.

A word of calibration: start at the default scale of 2 and nudge from there. This is a subtle intervention, and the README-adjacent wisdom around attention patches is that more isn't automatically better - pushed too high you can start to see doubled or "painted-over" structure, especially on models you're already at a high CFG. If results get weird, drop the scale before you drop the node.

Install with the pack:

cd ComfyUI/custom_nodes
git clone https://github.com/Extraltodeus/pre_cfg_comfy_nodes_for_ComfyUI

or find pre_cfg_comfy_nodes_for_ComfyUI in ComfyUI Manager and restart. No models, no extra dependencies.

It's a quiet little quality-of-life patch that's easy to forget you have on - which is honestly the best compliment an attention node can get. Wire it after your model loader, set it to 2, and move on.

Categorymodel_patches

Inputs (3)

NameTypeDefaultDescription
modelMODEL
scaleFLOAT2.0-1–10
enabledBOOLEANtrue

Outputs (1)

NameTypeDescription
MODELMODEL