Regional Conditioning By Color Mask (Inspire)
Region conditioning from a painted color map
- clip
- color_mask
- CONDITIONING
- MASK
Take Regional Conditioning Simple, swap the mask input for a color map, and you've got this node. Instead of passing a black-and-white mask per region, you paint one color-coded image - red here, blue there - and this node extracts the region by its color, restricts your prompt to it, and outputs a CONDITIONING for a normal KSampler. It's the color-mask authoring flow married to the light, sampler-free style of regional prompting.
This is the combination a lot of people actually want: regional prompting to keep multiple subjects from bleeding into each other, driven by a single painted map instead of a pile of separate masks, and without the overhead of the Impact Pack's per-region sampler. You draw the layout once, then wire one of these per color.
How it works
You give it a color_mask image and a mask_color (hex like #00FF00, or a decimal). It pulls the matching pixels into a mask, encodes your prompt against the clip, and limits that conditioning to the extracted area - the same Conditioning (Set Mask) idea underneath, just with a color-keyed mask. Chain several with a Conditioning (Combine) and feed a standard sampler.
The inputs and outputs that matter
- color_mask - the single painted color map.
- mask_color - the color to extract for this region.
- clip / prompt - encode this region's text.
- strength - conditioning strength for the region.
- set_cond_area -
defaultormask bounds(tighten to the region's bounding box). - dilation (optional) - grow or shrink the extracted mask by N pixels; a little positive dilation helps close hairline gaps at region edges.
Outputs: CONDITIONING (combine and sample) and the extracted MASK.
Installing it
Via ComfyUI Manager: search "Inspire Pack", install, restart. Manually:
cd ComfyUI/custom_nodes
git clone https://github.com/ltdrdata/ComfyUI-Inspire-Pack
Restart afterward (pip install -r requirements.txt if you cloned). Like its plain-mask sibling, this one wraps a core ComfyUI feature, so it doesn't require the Impact Pack to function.
Where people get tripped up
Color matching is exact, so the painted map needs flat, pure colors and no anti-aliasing - save it as PNG and paint hard edges, or the blended boundary pixels won't match mask_color and drop out of the region. That edge fraying is exactly what the dilation input is there to paper over; a couple of pixels of dilation reclaims the soft border. And the standing caveat of masked-conditioning regional prompting applies: bounds are soft and some attribute bleed between regions is normal. If you need harder separation, the Regional Prompt By Color Mask node routes the same color map through Impact's regional sampler, which holds bounds better but costs you setup and a slower render.
Inputs (7)
| Name | Type | Default | Description |
|---|---|---|---|
| clip | CLIP | — | |
| color_mask | IMAGE | — | |
| mask_color | STRING | #FFFFFF | — |
| strength | FLOAT | 1.000–10 | — |
| set_cond_area | COMBO | 2 options: default, mask bounds | |
| prompt | STRING | — | |
| dilationopt | INT | 0-512–512 | — |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| CONDITIONING | CONDITIONING | — |
| MASK | MASK | — |