Nodes/KJNodes for ComfyUI/ConditioningSetMaskAndCombine4
ComfyUI Node Runs on cloud

ConditioningSetMaskAndCombine4

Four-region regional prompting in one node

By kijai·Created 3 years ago·Updated 2 days ago· 3,110
ConditioningSetMaskAndCombine4
  • positive_1
  • negative_1
  • positive_2
  • negative_2
  • positive_3
  • negative_3
  • positive_4
  • negative_4
  • mask_1
  • mask_2
  • mask_3
  • mask_4
  • combined_positive
  • combined_negative
mask_1_strength1.00
mask_2_strength1.00
mask_3_strength1.00
mask_4_strength1.00
set_cond_area

The four-region member of this pack's regional-prompting bundle. Same mechanism as its smaller siblings - the node's own description says it plainly: "Bundles multiple conditioning mask and combine nodes into one, functionality is identical to ComfyUI native nodes" - just scaled to four independent conditioning-and-mask pairs instead of two or three. A natural fit for a 2×2 compositional layout: four characters, four objects, four quadrants each carrying their own prompt.

The inputs that matter

  • positive_1/negative_1 through positive_4/negative_4 (CONDITIONING, required) - four independent conditioning pairs.
  • mask_1 through mask_4 (MASK, required) - one mask per region.
  • mask_1_strength through mask_4_strength (default 1, range 010) - per-region weighting.
  • set_cond_area (default / mask bounds) - canvas-wide mask-weighted application versus restricting the conditioning's area of effect to each mask's bounding box.

Outputs: combined_positive and combined_negative, straight into your KSampler.

Four quadrants also means four full CLIP Text Encode nodes upstream, each wired to its own mask - the graph itself becomes a meaningful part of the work at this size, not just the prompts. It's worth deciding your layout (a literal 2×2 grid, or four organically-shaped regions) before you start placing mask nodes, since retrofitting a fourth region into a graph built for three tends to produce awkward, overlapping masks rather than a clean split.

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. No models involved.

Common issues & troubleshooting

Your generation got noticeably slower after moving from two regions to four. That's expected, not a bug - four separate conditioning entries mean four times the text-encoding and mask overhead the sampler has to account for at every step compared to a single-region prompt. It's a real cost, worth budgeting for if you're iterating quickly on a complex multi-subject composition.

Regions blur together at the boundaries. With four masks dividing a canvas, the seams between them carry more total edge length than a two- or three-region split, and that's where bleed between prompts shows up first. A little softness at each mask boundary (rather than hard, pixel-sharp edges) usually reads better than trying to force a perfectly crisp split.

Managing four separate CLIP Text Encode nodes feeding this gets unwieldy. That's a real cost of this many regions - worth naming your text encode nodes clearly (which subject/area each one is for) so the graph stays readable as it grows.

This is still not enough regions. ConditioningSetMaskAndCombine5 is the largest bundled variant in this pack. Past five, you're back to hand-chaining native ConditioningSetMask + ConditioningCombine nodes - which, at that scale, isn't meaningfully more wiring than working with a fixed six-region node would be anyway.

CategoryKJNodes/masking/conditioning

Inputs (17)

NameTypeDefaultDescription
positive_1CONDITIONING
negative_1CONDITIONING
positive_2CONDITIONING
negative_2CONDITIONING
positive_3CONDITIONING
negative_3CONDITIONING
positive_4CONDITIONING
negative_4CONDITIONING
mask_1MASK
mask_2MASK
mask_3MASK
mask_4MASK
mask_1_strengthFLOAT1.000–10
mask_2_strengthFLOAT1.000–10
mask_3_strengthFLOAT1.000–10
mask_4_strengthFLOAT1.000–10
set_cond_areaCOMBO2 options: default, mask bounds

Outputs (2)

NameTypeDescription
combined_positiveCONDITIONING
combined_negativeCONDITIONING