Nodes/cgem156-ComfyUI🍌/Attention Couple 🍌
ComfyUI Node

Attention Couple 🍌

Regional prompting, the original hard-mode version

By laksjdjf·Created 2 years ago·Updated about a month ago· 93
Attention Couple 🍌
  • model
  • base_mask
  • conds
  • masks
  • MODEL

If you've ever put two characters in one prompt and watched their hair colors, outfits, or faces melt into each other, you already know why this node exists. A single prompt conditions the whole canvas - there's no way to tell the model "red hair only on the left, blue hair only on the right" using text alone. Attention Couple fixes that by masking which region of the image each piece of conditioning is allowed to influence.

It's one of the older implementations of this idea in the ComfyUI world, and it has a reputation to match: a well-known thread comparing it to ComfyCouple (a friendlier node built by someone else) describes ComfyCouple as "insanely good" and specifically calls Attention Couple "the way harder to use" node it's based on. That's a fair warning, not a knock - this is the primitive, not the polished wrapper.

How it works

You give the node a base model, a base mask, and then a parallel list of conditionings and masks - one mask per region, one conditioning per region. Internally it patches the model's attention so that each region only "sees" its own prompt during sampling, instead of every token influencing every pixel. The output is a patched MODEL you drop straight into your KSampler in place of the original.

Worth knowing: the earliest standalone version of this node (before it moved into this pack) was literally fixed at two regions - hence "couple." People asked years ago how to extend it past a pair and mostly couldn't. This version doesn't have that limit: conds and masks are autogrow lists, so you can keep adding region/conditioning pairs past two. Just keep the two lists the same length and in matching order - position 3 in conds pairs with position 3 in masks.

Inputs and outputs that matter

  • model - the model to patch.
  • base_mask - the fallback region, covering whatever your other masks don't.
  • conds / masks - your per-region conditioning and mask pairs, added as needed.
  • Output: MODEL, patched and ready for your sampler.

The masks themselves come from wherever you normally build them - painted masks, Conditioning (Set Area)-style rectangles converted to masks, or a segmentation node. This node doesn't build masks for you, it just applies them.

Installing it

Same as the rest of the pack: open ComfyUI Manager and search cgem156-ComfyUI🍌 (yes, the banana is part of the actual name), install, restart. Or by hand:

cd ComfyUI/custom_nodes
git clone https://github.com/laksjdjf/cgem156-ComfyUI

then restart ComfyUI. No unusual Python dependencies called out for this particular node.

Common issues

It doesn't work on Flux. This is worth saying plainly because people ask: attention-masking tools built for SD 1.5/SDXL, cgem156-ComfyUI specifically included, don't carry over to Flux's architecture. If you're on Flux, lean on its native prompt adherence and phrasing instead - it handles a surprising amount of what used to require region masks, and if you still need hard spatial control, look for a Flux-native regional node rather than forcing this one.

Fiddly to set up. This isn't you doing it wrong - it's the node's reputation. If you just want "two people, don't blend" and don't want to hand-paint masks, a purpose-built wrapper node aimed at exactly that case will get you there faster. Reach for this one when you want more than two regions or want to control the masking yourself.

A single character is coming out wrong. That's not what this fixes. Regional prompting solves bleeding between subjects, not a subject looking wrong on its own - fix your prompt or checkpoint first, and reach for ControlNet if the problem is pose or structure rather than attribute bleeding.

Mismatched list lengths. conds and masks are parallel lists - add or remove entries from both together, not just one.

Categorycgem156 🍌/attention_couple

Inputs (4)

NameTypeDefaultDescription
modelMODEL
base_maskMASK
condsCOMFY_AUTOGROW_V3
masksCOMFY_AUTOGROW_V3

Outputs (1)

NameTypeDescription
MODELMODEL