Region Mask Conditioning
Attach a prompt to each Flux region
- mask1
- bbox1
- conditioning1
- mask2
- bbox2
- conditioning2
- mask3
- bbox3
- conditioning3
- region1
- region2
- region3
- region_count
- preview_image
This is the node where the Flux Region pipeline stops being about geometry and starts being about prompts. The Region Mask Generator gave you masks and boxes; here you marry each of those to its own conditioning - its own prompt - and set how strongly each one asserts itself. It's the step that makes "red-haired woman on the left, blue-haired woman on the right" actually mean something to the model.
In regional-prompting terms, this is the per-region conditioning stage: you're masking the conditioning so each area of the canvas listens to a different prompt instead of everything sharing one global description that smears attributes together.
How it works
Each region takes three things: a mask, a bbox (both from the generator), and a conditioning (your encoded prompt for that area). Region 1's inputs are required; regions 2 and 3 are optional so you can run one, two, or three. You also pass number_of_regions, and here's a subtlety worth internalizing - the node processes based on that count, not on how many conditioning inputs you happened to wire. Set the count to match the regions you actually want.
Each region gets an independent strength (0 to 10, in 0.1 steps). At strength 1, a region matches the base conditioning strength, which the pipeline holds at 1 globally. Above 1 the region pushes harder. Two things the author is explicit about: strengths are relative not just to the base but to each other, and they're also affected by each region's share of the canvas area and by the feathering you'll set in the Attention Control node. So it's a balancing act, not an absolute dial.
The inputs and outputs that matter
conditioning1/2/3- the prompt for each region. The author says to use standard DualCLIP + Flux conditioning, and to keep the Flux guidance at 1 for both base and regions.strength1/2/3- start everything at 1 and adjust relatively. If region 2 is losing to region 1, nudge its strength up rather than cranking one to 10.number_of_regions- must reflect the regions you want processed.
Outputs are region1/region2/region3 (a custom REGION type), a region_count (INT), and a preview_image. The REGION outputs are what feed the Flux Attention Control node next; the preview lets you sanity-check before you sample.
How to install it
ComfyUI Manager → ControlAltAI Nodes → install → restart, or clone:
cd ComfyUI/custom_nodes
git clone https://github.com/gseth/ControlAltAI-Nodes
No download for this node, but the same pipeline caveat holds: Flux Attention Control downstream needs XFormers. Get that in place.
Common issues
The most common confusion is the count-vs-connections thing - people wire two prompts, leave number_of_regions at 1, and wonder why the second prompt does nothing. Match the count to your intent. The second: treating strength as absolute. Because the values are relative to each other and to region area, a big region at strength 1 and a small region at strength 1 don't have equal pull - the smaller region often needs a higher number to hold its ground. And keep your per-region prompts short. The attention mechanism this feeds has a real token ceiling (the author suggests keeping each CLIP prompt under ~80 tokens), and overlong regional prompts are a direct cause of the shape-mismatch errors that show up later in the chain.
Inputs (13)
| Name | Type | Default | Description |
|---|---|---|---|
| mask1 | MASK | — | |
| bbox1 | BBOX | — | |
| conditioning1 | CONDITIONING | — | |
| number_of_regions | INT | 11–3 | — |
| strength1 | FLOAT | 1.00–10 | — |
| mask2opt | MASK | — | |
| bbox2opt | BBOX | — | |
| conditioning2opt | CONDITIONING | — | |
| strength2opt | FLOAT | 1.00–10 | — |
| mask3opt | MASK | — | |
| bbox3opt | BBOX | — | |
| conditioning3opt | CONDITIONING | — | |
| strength3opt | FLOAT | 1.00–10 | — |
Outputs (5)
| Name | Type | Description |
|---|---|---|
| region1 | REGION | — |
| region2 | REGION | — |
| region3 | REGION | — |
| region_count | INT | — |
| preview_image | IMAGE | — |