Conditioning (Set Mask)
Make one prompt own one part of the frame
- conditioning
- mask
- CONDITIONING
This is the node that makes regional prompting actually work in ComfyUI. Your average prompt is global - everything in the text pulls on every pixel. "A red-haired woman on the left, a blue-haired one on the right" smears both attributes together, and no amount of prompt rewriting fixes it. Conditioning Set Mask is the fix: it attaches a mask to a prompt so that prompt only has influence inside the white part of the mask. Everything else keeps doing its own thing.
You'll almost always use it in pairs, wired into a ConditioningCombine. Encode your background prompt, feed it through Set Mask with one mask. Encode your foreground prompt, feed it through with the inverted mask. Combine the two, and the sampler now reads one prompt for the foreground region and one for the background. Same trick powers masked inpainting on models that want text conditioning, and it's how a lot of "the rest of the image should stay put" workflows work.
How it works
A CONDITIONING in ComfyUI is a list of [embedding, metadata] pairs. The metadata dict is where this node does its work - it stamps in three keys: the mask itself, a mask_strength, and a set_area_to_bounds flag. During sampling, the model's cross-attention is gated by that mask: where the mask is black, this prompt contributes almost nothing; where it's white, it contributes at strength. Raise strength above 1 and the region gets more than its fair share of attention; drop it below 1 and the prompt goes soft inside the mask.
The inputs that actually matter:
- mask - a grayscale MASK image, same spatial size as your latent. White = this prompt applies here.
- strength - 0 to 10, default 1. How hard this prompt pulls inside the mask.
- set_cond_area - "default" uses the full image as the attention area, "mask bounds" limits the sampler to the mask's bounding box. Bounds is faster and keeps the prompt from drifting outside the mask, but can feel cramped on oddly shaped regions.
One output, a CONDITIONING, which wires straight into your KSampler's positive or negative.
Where people get burned
The mask needs to match the resolution of the generation. Mismatched sizes get resized implicitly, which sounds fine until your soft mask edge becomes a hard one. And remember the strength on the combined chain: if you set strength 1 on both regions and Combine them, the overlap zone gets double attention and tends to fight. Leave a small gap between masks, or feather them, and let each side own its territory.
Also worth knowing: Set Mask modifies metadata, it doesn't duplicate the embedding. So the output is not a "stronger" version of your prompt - it's your prompt plus spatial constraints. If you want the prompt itself amplified, that's a different node (Conditioning Multiply).
Common issues
- Region ignores its prompt entirely - mask is inverted, or
strengthis 0. Check you fed the right mask to the right prompt. - Hard seams at the mask edge - no feathering. Blur the mask a few pixels before it goes in.
- Nothing changes - if you're on a guidance-distilled model running at CFG 1, regional text conditioning has nothing to attach to; the negative side especially is inert. Test at CFG > 1 or restate the constraint inside the positive.
It ships with ComfyUI core - no install, it's been there since the early days. For two-character scenes or "change only the sofa" edits, it's still the standing answer the regional-prompting world orbits.
Inputs (4)
| Name | Type | Default | Description |
|---|---|---|---|
| conditioning | CONDITIONING | — | |
| mask | MASK | — | |
| strength | FLOAT | 1.000–10 | — |
| set_cond_area | COMBO | 2 options: default, mask bounds |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| CONDITIONING | CONDITIONING | — |