Comfy Couple
Two characters, one frame, zero blending — Comfy Couple is the no-mask regional prompting shortcut
- model
- positive_1
- positive_2
- negative
- MODEL
- CONDITIONING
- CONDITIONING
You know the failure: you prompt for "Ayaka and Lumine, holding hands, picnic," and what comes back is one character wearing both hairstyles. Put two different people in a single prompt and the model happily averages their features together, because a prompt describes the whole canvas and every token gets to attend everywhere. Comfy Couple fixes the specific case - two characters, left and right - by quietly doing regional prompting for you. One node in, one patched model out, and your two positive prompts stop fighting.
It's the ComfyUI port of Attention Couple, the A1111/Forge technique that splits the frame and glues each character's prompt to its own half. This is a fork of laksjdjf/attention-couple-ComfyUI with the fiddly bits replaced by ComfyUI's built-in mask nodes, so instead of assembling a web of Conditioning (Set Mask), Mask Composite, and Solid Mask nodes yourself, you drop in a single "Comfy Couple" and set two numbers. That's the whole point of it: the original repo works, but it's a chore to wire. This one isn't.
How it actually works
Read the source and the "magic" turns out to be honest plumbing. On the inside it builds two rectangular masks with SolidMask + MaskComposite, attaches each of your positive conditionings to the other half's mask (so positive_1 gets the left region, positive_2 the right), and merges them into one conditioning stack. Then the fun part: it clones your model and patches every cross-attention block - attn2 in the UNet - so each region's text tokens only attend to their own spatial area. The masks get downsampled to whatever resolution each attention map happens to be at and normalized so they sum to 1. It has separate patching paths for SD 1.5 and SDXL, detected automatically.
Two things worth knowing from that mechanism. First, it only masks cross-attention text tokens, not self-attention image tokens. That's exactly what the README means by its "known issue": it is not quite actual regional prompting. Bounds are soft and leak a little; the technique's proper modern form masks both and stops early, and this node does neither. Second, it patches UNet layers - so this is SD 1.5 / SDXL tooling. Don't expect it on Flux, Wan, or Anima; regional prompting gets rebuilt from scratch on every architecture, and this one was built for 2023-era UNets.
The inputs that matter
Of the eight inputs, a beginner actually sets five:
- model - your checkpoint's model, straight from the loader.
- positive_1 and positive_2 - the two CLIP-encoded prompts. In horizontal orientation,
positive_1owns the left side,positive_2the right. - negative - the one negative you'd usually write anyway.
- orientation -
horizontal(side-by-side, the default for couples) orvertical(top/bottom, handy for stacked figures). - center - where the split sits, 0 to 1. Default 0.5 is a 50/50 split; push it toward 0 or 1 to give one character more room.
The remaining two, width and height, are the trap. They're the canvas the masks are built on, and they need to match the resolution you actually sample at. Set the node to 512×512 but sample a 768×1024 latent and your masks will be built for a frame that doesn't exist - the classic symptom is a tensor-size mismatch error on the first step. Set them to your Empty Latent Image dimensions and leave them alone.
The three outputs are what you feed the KSampler: a patched MODEL, the combined CONDITIONING (goes to positive), and the CONDITIONING for negative. Nothing else to wire.
Installing it
ComfyUI Manager: search "Comfy Couple" (it's published to the Comfy registry) and hit install. Or the manual route:
cd ComfyUI/custom_nodes
git clone https://github.com/Danand/ComfyUI-ComfyCouple
Restart ComfyUI. That's it - there are no dependencies beyond ComfyUI itself and no model files to download. The whole thing is one Python file and a bundle of masks. The node sits under loaders (right-click → loaders → Comfy Couple), and a ready-made workflow ships in the repo if you want the exact wiring.
Troubleshooting and expectations
The one real error people hit is the tensor-size mismatch above - keep width/height aligned with your latent. Beyond that, manage expectations rather than errors: this is guidance, not isolation, so expect some attribute bleed near the boundary and accept that characters who overlap, touch, or sit in each other's lap will still blend. It shines when your characters are clearly separated in the frame, which is also how the README's own examples compose them. Give each character at least one attribute the other lacks ("red hair" vs "blue hair"), and remember the whole category of problem is getting easier - better text encoders on newer models need regional prompting less and less. For SD 1.5 / SDXL anime work today, though, this is the least-pain path to two characters who stay themselves.
Inputs (8)
| Name | Type | Default | Description |
|---|---|---|---|
| model | MODEL | — | |
| positive_1 | CONDITIONING | — | |
| positive_2 | CONDITIONING | — | |
| negative | CONDITIONING | — | |
| orientation | COMBO | 2 options: horizontal, vertical | |
| center | FLOAT | 0.500–1 | — |
| width | INT | 51216–16384 | — |
| height | INT | 51216–16384 | — |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| MODEL | MODEL | — |
| CONDITIONING | CONDITIONING | — |
| CONDITIONING | CONDITIONING | — |