Native Regional Rect Conditioning (Nukun)
Regional prompting without another dependency tree
- conditioning_1
- conditioning_2
- conditioning_3
- conditioning
- mask_1
- mask_2
- mask_3
Regional prompting - different prompts for different parts of the frame - is one of those things every ComfyUI user eventually wants and few want to set up. The classic path drags in DenseDiffusion or a regional-conditioning pack with its own model patching and its own failure modes. This node takes the other route: it builds your rectangular masks and applies them to per-region conditionings using only ComfyUI's core ConditioningSetMask metadata. No model patch, no extra dependency, no reason to trust a third-party patcher with your UNet.
That's the pitch, and it's genuinely the right tool when your regions are rectangles and you're on an SDXL-lineage model (Pony v6, Illustrious, or anything booru-trained) where regional conditioning has a long track record of working well. If your regions are wonky shapes, you want a mask-based approach - but for split-screen or panel-style layouts, rectangles are what you'd draw anyway.
How it works
You feed in up to three already-encoded conditionings, plus a width and height. Each region has x, y, w, h controls in the 0.0–1.0 range - percentages of the canvas, not pixels, so a w_1 of 0.35 means "left 35% of the image." The node builds three masks, applies each mask to its conditioning with the region's strength_1..3 as mask_strength, and returns one combined conditioning for the sampler's positive path.
The default layout is three full-height columns: left 35%, middle 30%, right 35%. That's a sensible starting point for a triptych; change h_1 etc. to 0.5 and you're doing a 2x2 grid instead.
Two settings matter more than the rest:
soft_edge- blurs the rectangle edges (0–256 px). Rectangles without soft edges leave visible boundaries on some samplers; a value around 16–32 hides them on Pony-class models. Your mileage varies, which is why the mask preview outputs exist.set_cond_area-defaultconditions the whole masked area;mask boundsshrinks the conditioning to the mask's bounding box.mask boundsis often crisper for tight regions, at the cost of a harsher cut.
Inputs and outputs
Required: conditioning_1, conditioning_2 (plus conditioning_3 if region_count is 3), width, height, region_count, and the twelve rect coordinates. Outputs: one combined conditioning, plus mask_1..3 so you can preview exactly what you're telling the model. Wire conditioning into your KSampler's positive slot and you're done - that's the whole integration story.
Installing it
Standard pack install, nothing special:
cd ComfyUI/custom_nodes
git clone https://github.com/OnekoSL/Nukun_ComfyUI_Nodes.git
Restart ComfyUI after cloning, or use ComfyUI Manager (search "Nukun"). No companion packages required - this is the whole point of the "Native" naming. One nice touch: the node ships a browser-side rectangle editor, so you can drag the region boxes on a canvas instead of typing coordinates. Right-click the node and look for the rectangle editor option.
Common issues
The most common mistake is leaving region_count at 3 and forgetting to connect conditioning_3 - the node raises a clear error for that, which is friendlier than most. Next: regions that don't add up to a full canvas. Unlike the DenseDiffusion variant, uncovered pixels here are just… uncondensed. That's fine with a strong base prompt, but if you see washed-out or empty areas, either cover the canvas or accept that you're effectively doing inpainting-style masked generation. And if your layout has overlapping rects, the later region wins in the overlap - order matters.
Inputs (23)
| Name | Type | Default | Description |
|---|---|---|---|
| conditioning_1 | CONDITIONING | — | |
| conditioning_2 | CONDITIONING | — | |
| width | INT | 10248–16384 | — |
| height | INT | 10248–16384 | — |
| region_count | INT | 32–3 | — |
| x_1 | FLOAT | 0.000–1 | — |
| y_1 | FLOAT | 0.000–1 | — |
| w_1 | FLOAT | 0.350–1 | — |
| h_1 | FLOAT | 1.000–1 | — |
| x_2 | FLOAT | 0.350–1 | — |
| y_2 | FLOAT | 0.000–1 | — |
| w_2 | FLOAT | 0.300–1 | — |
| h_2 | FLOAT | 1.000–1 | — |
| x_3 | FLOAT | 0.650–1 | — |
| y_3 | FLOAT | 0.000–1 | — |
| w_3 | FLOAT | 0.350–1 | — |
| h_3 | FLOAT | 1.000–1 | — |
| soft_edge | INT | 00–256 | — |
| strength_1 | FLOAT | 1.000–10 | — |
| strength_2 | FLOAT | 1.000–10 | — |
| strength_3 | FLOAT | 1.000–10 | — |
| set_cond_area | COMBO | 2 options: default, mask bounds | |
| conditioning_3opt | CONDITIONING | — |
Outputs (4)
| Name | Type | Description |
|---|---|---|
| conditioning | CONDITIONING | — |
| mask_1 | MASK | — |
| mask_2 | MASK | — |
| mask_3 | MASK | — |