Want a red-haired knight on the left and a blue dragon on the right, without the colors bleeding into each other? A single prompt can’t do that reliably. The model mixes every word across the whole image.
Regional prompting fixes this by giving each part of the image its own prompt. ComfyUI can do it with built-in nodes, no custom packs needed.
This guide shows how to do regional prompting in ComfyUI three ways: rectangular areas with Conditioning (Set Area), percentage areas for any image size, and painted masks with Conditioning (Set Mask).
It also explains how Combine, Concat and Average differ, which strength values work, a timestep trick that cleans up seams, and fixes for the usual problems.
- Idea: one CLIP Text Encode per region, each limited to an area or mask, all merged with Conditioning (Combine) into the KSampler’s positive input.
- Rectangles: Conditioning (Set Area) takes width, height, x and y in pixels (multiples of 8).
- Any size: Conditioning (Set Area with Percentage) takes values from 0 to 1, so it survives a resolution change.
- Free shapes: Conditioning (Set Mask) with a mask from the Mask Editor or a Load Image alpha channel.
- Always keep a full-image background prompt so the regions blend into one scene.
New to ComfyUI? Start with my ComfyUI guide, which covers install, nodes and workflows in one place.
What Regional Prompting Does
In a normal workflow, one CLIP Text Encode node turns your whole prompt into a single conditioning, and the sampler applies it to every pixel.
Ask for “a woman in a red dress and a man in a blue suit” and you’ll often get red and blue on both of them. This is called concept bleeding.
Regional prompting splits the prompt. Each region gets its own text encode, and a conditioning node tells the sampler where that text applies. During sampling, ComfyUI runs the model on each area with its own prompt and blends the results.
ComfyUI’s official examples call this area composition. The example page builds a landscape with four areas (night, evening, day and morning) side by side, then adds a subject in the bottom center with one more area prompt.
The same examples point out a second use: generating a wide 16:9 image with a square area for the subject, which keeps the subject’s anatomy consistent while the rest of the frame fills in around it.
The Built-in Nodes
All of these come with ComfyUI. Double-click the canvas and type the name. Searching “regional prompt” also finds Set Area.
| Node | What it does | Key inputs |
|---|---|---|
| Conditioning (Set Area) | Limits a prompt to a rectangle in pixels | width, height (min 64, step 8), x, y, strength (default 1.0) |
| Conditioning (Set Area with Percentage) | Same, but as fractions of the image | width, height, x, y from 0.0 to 1.0, strength |
| Conditioning (Set Mask) | Limits a prompt to a painted mask | mask, strength, set_cond_area (default or mask bounds) |
| Conditioning (Set Area Strength) | Changes the strength of an existing area | strength (0-10) |
| Conditioning (Combine) | Merges several conditionings so all apply | conditioning_1, conditioning_2 |
| ConditioningSetTimestepRange | Applies a conditioning only during part of sampling | start, end (0.0-1.0) |
Method 1: Conditioning (Set Area)
This is the classic method. Here’s a two-subject example on a 1024×1024 SDXL image: a knight on the left half, a dragon on the right half, and a castle scene behind both.
Node chain
CLIP Text Encode ("castle courtyard at sunset, cinematic") → Combine (background)
CLIP Text Encode ("knight in silver armor, red cape") → Set Area (left) → Combine
CLIP Text Encode ("blue dragon, glowing eyes") → Set Area (right) → Combine
Combine → KSampler positive
Step by step
- Start from the default text-to-image workflow and set the Empty Latent Image to 1024×1024.
- Keep the existing positive prompt as the background prompt. Describe the scene, lighting and style, but not the subjects.
- Add a second CLIP Text Encode for the knight. Connect the same CLIP.
- Add Conditioning (Set Area) and connect the knight prompt to it. Set
width512,height1024,x0,y0. - Add a third text encode for the dragon, plus another Set Area with
width512,height1024,x512,y0. - Add two Conditioning (Combine) nodes. Combine the knight and dragon areas first, then combine that with the background.
- Connect the final Combine output to the KSampler’s
positiveinput. Keep one normal negative prompt. - Queue. Fix the seed while you adjust the areas.
The x and y values are the top-left corner of the area, measured from the top-left of the image. Keep every number a multiple of 8, because the latent is 8 times smaller than the image.
Overlap the areas a little
Two areas that meet at an exact line can leave a visible seam. Make each area 64-128 px wider so they overlap in the middle, for example knight at x 0 width 576 and dragon at x 448 width 576. The overlap zone gets both prompts and blends.
Strength
Leave strength at 1.0 to start. Raise a region to 1.2-1.5 if its subject keeps disappearing, or lower it to 0.6-0.8 if it overpowers the background. Values far above 2 usually burn the area.
Method 2: Set Area with Percentage
Pixel areas break when you change resolution. Switch the latent from 1024×1024 to 832×1216 and your “right half” is no longer the right half.
Conditioning (Set Area with Percentage) uses fractions instead. The same left/right split looks like this:
| Region | width | height | x | y |
|---|---|---|---|---|
| Left half | 0.5 | 1.0 | 0.0 | 0.0 |
| Right half | 0.5 | 1.0 | 0.5 | 0.0 |
| Top third (sky) | 1.0 | 0.33 | 0.0 | 0.0 |
| Center subject | 0.4 | 0.7 | 0.3 | 0.3 |
Use this version when you plan to reuse the workflow at different sizes, or when you add a hires fix pass at a larger size afterwards.
Method 3: Mask Regions with Set Mask
Rectangles are fine for “left person, right person”. For a river winding through a valley, or a subject that isn’t box-shaped, use a mask.
Ways to get a mask
- Mask Editor: load any image of the right size (a blank one works) in a Load Image node, right-click it, choose Open in MaskEditor, paint the region and save. Use the node’s
MASKoutput. - A black-and-white image: paint the regions in any image editor, load it, and convert it with Convert Image to Mask (pick the channel).
- Solid Mask: makes a mask of one value at a set size, handy as a base you combine with other masks.
- From a photo: a segmentation node (for example SAM-based nodes) can make a mask from an existing picture for img2img layouts.
Wiring
CLIP Text Encode (region prompt) → Conditioning (Set Mask) ← MASK
Conditioning (Set Mask) → Combine (with background and other regions) → KSampler positive
set_cond_area has two options:
- default: the model sees the whole image when it works on this prompt, and the mask decides where the prompt counts. Blends more naturally.
- mask bounds: the model works only on the box around the mask, at higher detail. Good for small regions, but can look pasted in.
The mask must match the latent’s image size. If it’s a different size, ComfyUI scales it, which can shift edges. Making the mask image at your exact output size avoids surprises.
Masks also let you mix regional prompting with other tools. For example, IPAdapter has an attention mask input that can give each region its own reference image (see my IPAdapter guide), and the ControlNet guide covers pose control so each subject stays in its area.
Combine vs Concat vs Average
ComfyUI has three ways to merge conditionings, and only one of them is right for regions.
| Node | What happens | Use for regions? |
|---|---|---|
| Conditioning (Combine) | Keeps both conditionings separate. The sampler runs each one (with its area or mask) and blends the predictions. | Yes. This is the one. |
| Conditioning (Concat) | Joins the text embeddings end to end into one longer prompt. | No. It loses the area. Useful as a BREAK-style prompt splitter. |
| Conditioning (Average) | Blends two prompts into one by a ratio (conditioning_to_strength). |
No. Good for mixing two styles across the whole image. |
Each extra region adds another model run per step, so every region you add makes sampling slower. Two or three regions plus a background is a sensible limit.
Cleaner Seams with Timestep Ranges
The first steps of sampling decide the layout. The last steps add detail. You can use that to get the regional layout without hard edges.
- Pass each region’s conditioning through ConditioningSetTimestepRange with
start0.0 andend0.5. - Pass a full-image prompt that describes everything (the knight and the dragon) through another ConditioningSetTimestepRange with
start0.5 andend1.0. - Combine them all into the positive input.
The regions place the subjects in the first half, then a single prompt finishes the image as one coherent scene. Try an end of 0.3-0.6 and keep the one that looks best on your seed.
Which Models It Works Best With
| Model family | How well it works | Tips |
|---|---|---|
| SD 1.5 | Very well. The official examples were built on SD 1.5 models. | Areas around 512 px suit its training size. |
| SDXL, Pony, Illustrious | Well | Keep areas at least 512 px on the short side. See my SDXL guide. |
| Flux-style and other DiT models | Mixed | Area nodes run, but results vary. These models follow long prompts well, so “on the left… on the right…” in plain words often works without regions. |
If plain-word placement isn’t enough on a newer model, a mask with a second inpainting pass over one subject is usually more reliable than area conditioning.
Troubleshooting
Colors or details still bleed between subjects
Take the subject words out of the background prompt. If the background says “knight and dragon”, both regions inherit both. Then raise the strength of the weak region a little, or add the timestep trick.
A region is ignored
Check the area is inside the image (x plus width must not pass the latent width) and that its Combine node actually reaches the KSampler. Very small areas tend to have a weak effect, so make them bigger or raise their strength.
Visible seams or a split image
Overlap neighboring areas by 64-128 px, keep a strong background prompt, and lower region strength towards 0.8. A short img2img pass at denoise 0.3 with a single prompt also smooths seams.
Two copies of a subject
The subject is described in more than one region. Keep each subject’s words in exactly one region prompt.
Sampling got very slow
That’s expected. Each region is an extra model run per step. Fewer regions, or regions only for the first part of sampling with the timestep trick, brings the speed back.
FAQ
Does ComfyUI support regional prompting without custom nodes?
Yes. Conditioning (Set Area), Set Area with Percentage, Set Mask and Conditioning (Combine) are all built in.
What’s the difference between Set Area and Set Mask?
Set Area uses a rectangle given by numbers. Set Mask uses any painted shape. Use Set Area for simple left/right layouts and Set Mask for organic shapes.
Why does my area need to be a multiple of 8?
The latent image is 8 times smaller than the final image, so areas snap to 8 px steps. The node only lets you enter multiples of 8.
How many regions can I use?
There’s no fixed limit, but each one slows sampling. Two to four regions plus a background prompt works well.
Should I use Combine or Concat for regions?
Combine. Concat merges the text into one prompt and loses the area information.
Can I use different LoRAs per region?
Not with the area nodes alone, because a LoRA changes the whole model. Apply the LoRA globally and describe its subject in one region, or use a mask with an inpainting pass for that subject. See how to use LoRAs in ComfyUI.
Does regional prompting work for img2img?
Yes. Feed a VAE Encoded image into the KSampler and lower denoise to 0.5-0.7. The regions then steer each part of the existing image.
Sources
- ComfyUI Examples: Area Composition
- ComfyUI source: nodes.py (ConditioningSetArea, SetAreaPercentage, SetMask, Combine, Concat, Average, SetTimestepRange inputs and defaults)



