Nodes/MultiMaskCouple/MaskedRegionCond
ComfyUI Node

MaskedRegionCond

The quiet glue node that makes MultiMaskCouple usable

By tumbowungus·Created 9 months ago·Updated 7 months ago· 1
MaskedRegionCond
  • positive
  • negative
  • mask
  • region_positive
  • region_negative
pos_strength1.00
neg_strength1.00

MultiMaskCouple is a two-node act: the big node clones your model and does the attention coupling, and MaskedRegionCond is the helper that makes it all bearable to wire up. Its entire job is to attach the same mask to a region's positive and negative conditioning in a single step. The source is basically four lines - it runs ConditioningSetMask twice, once per side - which is exactly what the author says it is: "really just two ConditioningSetMask bundled together."

Why you'd reach for it: with three regions you'd otherwise chain six ConditioningSetMask nodes and a pile of duplicate wires. This collapses that into one node per region. Prompt pair in, mask in, ready-to-use region outputs out. On a beginner workflow it's the difference between a readable graph and a spaghetti pile.

The inputs (this is the whole list)

  • positive and negative - the CLIP-encoded CONDITIONING for this region, from a CLIPTextEncode.
  • mask - a MASK, typically Load ImageImageToMask using one channel per color (red, green, blue).
  • pos_strength and neg_strength (0–2, default 1) - how hard the mask pushes each side. The per-side split is deliberate: you can suppress a region's negative prompt without weakening its positive, or push a region past 1.0 to pin it down harder. Start at 1 and adjust only when something's bleeding.

Outputs are region_positive and region_negative, which feed the matching region_N_positive / region_N_negative sockets on MultiMaskCouple. That's the whole loop: encode, mask-attach, couple, sample.

The honest caveat

This node does none of the heavy lifting. On its own it behaves like two ConditioningSetMask calls - the mask only truly bites once the patched MultiMaskCouple reads it during sampling and weights each region's cross-attention by it. So don't expect anything dramatic from MaskedRegionCond by itself; judge results after the whole chain runs. If you're seeing a region bleed into its neighbor, that's usually a mask-design problem or a strength setting - try thinning the masks or adding black borders in your mask image before you blame this node.

Install

It ships inside the MultiMaskCouple pack, so you install them together. Via ComfyUI Manager, search "MultiMaskCouple", or:

cd ComfyUI/custom_nodes
git clone https://github.com/tumbowungus/MultiMaskCouple

Then restart ComfyUI. No requirements.txt, no extra models - it only uses things ComfyUI already bundles. Keep your mask image at the same resolution as the output, and keep the mask shapes simple; regional prompting is about evoking composition, not dictating it.

Categoryconditioning/MultiMaskCouple

Inputs (5)

NameTypeDefaultDescription
positiveCONDITIONING
negativeCONDITIONING
maskMASK
pos_strengthFLOAT1.000–2
neg_strengthFLOAT1.000–2

Outputs (2)

NameTypeDescription
region_positiveCONDITIONING
region_negativeCONDITIONING