ComfyUI Node

Define Region

Define Region

By Acly·Created 3 years ago·Updated about a month ago· 667
Define Region
  • mask
  • conditioning
  • regions
  • regions

If you've ever tried to put two characters in one image and watched the redhead's hair color creep onto the blonde standing next to her, you already know why this node exists. Define Region is how you say "this prompt applies to this patch of the canvas, and nowhere else." It's the building block of the region system in Acly's tooling pack, and it's a regional-prompting node in the attention-masking family - the same lineage as Attention Couple, adapted here from laksjdjf's implementation.

Attribute bleeding between subjects is one of the oldest unsolved annoyances in this hobby. Prompt adherence is global by default: a single prompt describing two people reliably smears their traits together, and no amount of prompt wrangling reliably fixes it. Regional prompting has been the answer since 2023, and the demand has been remarkably steady - it never spiked, never died, because the problem never fully went away. The tooling churns (every new architecture breaks it and someone rebuilds it), but the idea is constant: split the canvas, give each area its own prompt.

The mechanism here is attention masking, not condition masking, and the difference matters. Condition masking (the old "Set Area" style) forces a prompt onto a rectangle and tends to look collaged, with visible seams. Attention masking is gentler - it steers the model's attention so a region's prompt pulls hardest inside its mask while still letting the whole image compose naturally. The README's own words: less forceful, more natural compositions. You pay for that with slightly looser bounds, which is the tradeoff this technique has never fully escaped.

The inputs, straight from the node's schema, are three:

  • mask (MASK) - the area this prompt owns. One real gotcha: the mask must match the size of the image or the latent (which is 8× smaller). Mismatch it and you'll get an error or garbage.
  • conditioning (CONDITIONING) - wire a normal CLIP Text Encode into this. Despite the README saying the node "takes a prompt," the actual input is encoded conditioning, ComfyUI-style - you encode the region's prompt yourself and plug it in.
  • regions (optional) - this is the chaining port. Feed the output of an upstream Background Region (or another Define Region) here to append to the list; leave it empty to start a fresh list.

The single output is regions, which you either pass into the next Define Region (to stack more areas) or hand to the Regions Attention Mask node, which is what actually patches the model and replaces the positive conditioning going into your sampler. Define Region on its own does nothing visible - it's a list-builder. The pattern is always: Background Region → Define Region → Define Region → … → Regions Attention Mask → sampler.

Installing it comes with the whole pack. Either search "ComfyUI Nodes for External Tooling" in ComfyUI Manager, or from your ComfyUI install run cd custom_nodes && git clone https://github.com/Acly/comfyui-tooling-nodes.git and restart. This node needs no extra dependencies or model downloads - it's pure model patching.

Where people get tripped up: forgetting the mask/latent size rule, or wiring Define Region straight to the sampler and wondering why nothing happens (you need Regions Attention Mask in between). And know what this doesn't fix - if a single subject is rendering wrong, that's an adherence problem, not a bleeding problem, and regions won't help. This is strictly for keeping two-plus subjects from swapping traits.

One bit of context that explains the whole pack: these nodes are the backend that Acly's Krita AI Diffusion plugin drives. When you paint regions on a Krita canvas, nodes like this one are what run underneath. You can wire them by hand in a ComfyUI graph - this page is for exactly that - but most people meet them through the paint interface, never the node.

Categoryexternal_tooling/regions

Inputs (3)

NameTypeDefaultDescription
maskMASK
conditioningCONDITIONING
regionsoptRegions

Outputs (1)

NameTypeDescription
regionsRegions