Nodes/A8R8 ComfyUI Nodes/Attention Couple
ComfyUI Node

Attention Couple

The engine node behind ComfyUI's regional prompting

By ramyma·Created 3 years ago·Updated 2 years ago· 74
Attention Couple
  • model
  • base_prompt
  • regions
  • model
global_prompt_weight0.3
width1024
height1024

If your prompt describes two people and the model keeps swapping their hair color, or merging one's jacket onto the other, that's not a prompting skill issue - it's how conditioning works. A single prompt conditions the whole canvas at once, so "a woman with red hair and a man with blue hair" reliably drifts toward a redheaded man or a blue-streaked dress. This is the single most common reason people go looking for regional prompting in the first place, and it's still not something prompt-writing alone fixes on any current model. AttentionCouple is the tool for it: paint separate masks over the canvas, give each one its own prompt, and each region only gets to influence its own pixels.

Where it comes from

This node is part of ramyma's A8R8_ComfyUI_nodes pack - the ComfyUI-side plumbing for A8R8, a separate canvas-based frontend that runs A1111, Forge, or ComfyUI as a backend. The pack's own README credits the node as a derived work of laksjdjf's cgem156-ComfyUI attention_couple script and Haoming02's sd-forge-couple - the same "Attention Couple" lineage that shipped for Forge in 2024 and has been rebuilt for basically every new architecture since (Anima got its own regional-conditioning node in 2026, because the technique never survives an architecture shift intact). The mechanism across that whole family is the same idea: mask the model's attention so a region's prompt only paints inside its mask instead of bleeding across the whole image.

How it works

AttentionCouple is a model patcher, not something that runs on its own. You feed it your checkpoint's model, a base_prompt for the overall scene, one or more regions, and it hands back a patched model that KSampler treats exactly like a normal one - nothing downstream needs to know regional prompting is happening.

The inputs that matter:

  • model - your checkpoint (or LoRA-patched) model, straight in.
  • base_prompt (CONDITIONING) - the whole-canvas prompt. Keep it generic: "two people standing in a park," not a full description of both subjects - that's what the regions are for.
  • global_prompt_weight (default 0.3, range 0.01–1) - the tooltip calls it "Base prompt strength." The low default is deliberate: most of the influence goes to your regions, not the base prompt, which is exactly what stops subjects from bleeding back together. Raise it if the overall composition or background falls apart; you can't lower it past 0.01, so there's no fully-off switch.
  • regions (ATTENTION_COUPLE_REGION) - its own tooltip says it "accepts Attention Couple Regions or a single Attention Couple Region directly." For one extra region, wire an AttentionCoupleRegion node straight in. For more than one, bundle them first with AttentionCoupleRegions.
  • width / height (default 1024×1024, step 8) - set these to your actual output resolution. This is the node protecting you from the most common Attention Couple failure mode in the wild: a tensor-size mismatch that fires the instant a region mask doesn't match the image dimensions.

Output is a single model - feed it straight into your KSampler in place of the checkpoint's own model output.

Installing it

Search "A8R8 ComfyUI Nodes" in ComfyUI Manager, or do it by hand:

cd ComfyUI/custom_nodes
git clone https://github.com/ramyma/A8R8_ComfyUI_nodes

Restart ComfyUI. No extra Python dependencies beyond what ComfyUI already ships, and no model downloads - this is pure attention-patching logic, nothing to fetch.

Common issues

Tensor size mismatch. By far the most reported Attention Couple failure across every implementation of this technique, and it's almost always a region mask that doesn't match the resolution you set in width/height here. Fix the masks, not the node.

Regions bleed into each other anyway. This is the known, never-fully-solved limit of the whole attention-couple family, not a bug in this specific node - it works great when subjects are spatially separated and gets rough the moment they overlap or touch.

No step-cutoff control. Some regional-prompting setups let you end hard masking early (once composition has formed) and blend back to the base conditioning for the rest of the sample - that's the community's standard fix for a collaged, seamy look. This node doesn't expose that as a parameter; if bleeding or seams persist, tuning global_prompt_weight and per-region weight (see AttentionCoupleRegion) is the lever you actually have.

One subject dominating the frame. Pull that region's weight down rather than fighting it with prompt rewrites - more on the exact range in the AttentionCoupleRegion article, since that's where weight actually lives.

CategoryA8R8

Inputs (6)

NameTypeDefaultDescription
modelMODEL
base_promptCONDITIONING
global_prompt_weightFLOAT0.30.01–1Base prompt strength.
regionsATTENTION_COUPLE_REGIONAccepts Attention Couple Regions or a single Attention Couple Region directly.
widthINT1024
heightINT1024

Outputs (1)

NameTypeDescription
modelMODEL