ConditioningSetMaskAndCombine
Regional prompting for two areas in one node
- positive_1
- negative_1
- positive_2
- negative_2
- mask_1
- mask_2
- combined_positive
- combined_negative
Regional prompting exists because prompt adherence in diffusion models is global by default: describe two subjects in one prompt and their attributes reliably smear together - the girl on the left is supposed to keep her red hair, the one on the right her blue, and instead you get some blend of both. Masking each subject's conditioning to its own area of the canvas is the fix, and it's been rebuilt in one form or another across nearly every UI generation since SD 1.5 - Latent Couple, Regional Prompter, Forge Couple, and in ComfyUI's own graph, chaining ConditioningSetMask with ConditioningCombine.
That native chain works fine, but wiring it by hand for two regions means four conditioning nodes, two mask nodes, and a combine node, all connected correctly. This node's own description is refreshingly upfront about what it is: "Bundles multiple conditioning mask and combine nodes into one, functionality is identical to ComfyUI native nodes." Kijai didn't invent a new technique - he collapsed the common 2-region case into a single node.
The inputs that matter
positive_1/negative_1andpositive_2/negative_2(CONDITIONING, required) - two independent conditioning pairs, normally from two separate CLIP Text Encode nodes describing two different subjects or areas.mask_1/mask_2(MASK, required) - which region each pair applies to.mask_1_strength/mask_2_strength(default1, range0–10) - how strongly each region's conditioning is weighted.set_cond_area(choices:default/mask bounds) - the same choice ComfyUI's nativeConditioningSetMaskgives you.defaultapplies the conditioning across the whole canvas, weighted by the mask;mask boundsrestricts the area of effect to the mask's bounding rectangle specifically.
Outputs: combined_positive and combined_negative - wire these straight into your KSampler exactly like you would a single CLIP Text Encode's output.
How to install it
Via ComfyUI Manager: search KJNodes for ComfyUI, install, restart. Manually:
cd ComfyUI/custom_nodes
git clone https://github.com/kijai/ComfyUI-KJNodes
pip install -r ComfyUI-KJNodes/requirements.txt
Then restart. Pure conditioning-graph logic - no models, no downloads, nothing extra needed.
Common issues & troubleshooting
One subject's attributes leak into the other's region. Two masks that don't cover the full canvas, or overlap heavily, can fight each other - this is inherited from the native nodes this bundles, not something specific to KJNodes. Leave a soft border between masks, or make sure your base positive prompt covers whatever neither mask claims.
mask bounds doesn't seem to do what you expected. It's easy to assume it crops the image; it doesn't - it crops the area the conditioning is allowed to influence. If a region still shows attributes bleeding in from the other prompt, try switching set_cond_area, or raise that region's mask_strength before assuming the masks themselves are wrong.
You only need to emphasize one area, not run two full prompts. This node is overkill for that - a plain native ConditioningSetMask layered over your base positive is lighter and does the same job for a single region.
More than two subjects. This pack ships larger bundled variants - ConditioningSetMaskAndCombine3, 4, and 5 - for exactly that, same inputs pattern with more region slots.
Inputs (9)
| Name | Type | Default | Description |
|---|---|---|---|
| positive_1 | CONDITIONING | — | |
| negative_1 | CONDITIONING | — | |
| positive_2 | CONDITIONING | — | |
| negative_2 | CONDITIONING | — | |
| mask_1 | MASK | — | |
| mask_2 | MASK | — | |
| mask_1_strength | FLOAT | 1.000–10 | — |
| mask_2_strength | FLOAT | 1.000–10 | — |
| set_cond_area | COMBO | 2 options: default, mask bounds |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| combined_positive | CONDITIONING | — |
| combined_negative | CONDITIONING | — |