EasyRegion (Mask-Based)
Draw a box, type a prompt, done
- clip
- conditioning
You ask for "a red sports car on the left, a giraffe on the right," and the model hands you one of them - or both, with their attributes smeared together. That's the classic regional-prompting failure, and the fix has always been to give each part of the canvas its own prompt. The catch is that the plain ComfyUI way to do that is a mini-graph: five CLIP Text Encode nodes, some Conditioning (Set Area) math, masks bolted on top. EasyRegion (Mask-Based) collapses the whole thing into one node with a box-drawing canvas, built for the mask-based model generation: Flux, SD3/SD3.5, Chroma, Qwen-Image.
It's exactly what the name promises: CLIP in, conditioning out, and between those two points you type a background prompt, up to four region prompts, and drag boxes on the canvas. No external text encoders, no conditioning chain to babysit. For a technique that historically means a dozen nodes, this is the version you'll actually keep installed.
How it works
The interesting part is the attention masking. Each region prompt gets CLIP-encoded like normal, and the background prompt is quietly prepended to every region so they all share scene context - that's what keeps it from looking like three stickers pasted on a photo. Then the node builds a binary mask (feathered at the edges when soften_masks is on) and, crucially, a strict attention mask that blocks the model from attending across region boundaries.
That last bit is the whole game. Without it, "bird in the top-right box" renders a bird in the center of the frame because that's where birds naturally go, and your box ends up empty. The attention mask forces the bird pixels to exist only inside the bird box. The trade-off is that regions become less aware of each other, which is why the per-region strength dials exist - you're balancing placement against cohesion.
The inputs that matter
- clip - from your checkpoint, same as any text encoder.
- width / height - must match your latent exactly, and stay multiples of 64.
- soften_masks - edge feathering; the tooltip says recommended ON, and it is.
- background_prompt / background_strength - the scene. Lower background strength (the tooltip's user-tested band is 0.7–1.2) and the regions show more.
- region1–4_prompt / region1–4_strength - per-box content and intensity.
The box geometry lives on the canvas: a region selector plus box_x, box_y, box_w, box_h. The single output is conditioning, which wires straight into your sampler's positive input. One honesty note: the README's generic advice ("start with strength 2.5–4.5") is older than what ships now - the defaults are 0.7 / 0.8 / 1.5 / 2.5 and the per-field tooltips are the current calibration. Trust the tooltips.
Install
Same as the whole pack - either ComfyUI Manager (search ComfyUI_EasyRegion) or:
cd ComfyUI/custom_nodes
git clone https://github.com/EnragedAntelope/ComfyUI_EasyRegion
Then restart ComfyUI. There's no requirements.txt and no model download - it uses the CLIP from your existing checkpoint, pure Python plus torch you already have. The one real requirement is a reasonably recent ComfyUI: the attention masking needs the attention_mask_img_shape API that landed around version 0.3.71.
Troubleshooting
- Regions not showing: raise the region's strength, lower
background_strength, and double-check width/height match your latent exactly. Keep boxes apart - overlapping or touching regions compete. - Soft or blurry regions: strength too high. The sweet spot per the tooltips is roughly 0.5–1.0 for region 1, creeping up to 2.5–3.0 for region 4.
KeyError: 'attention_mask_img_shape': your ComfyUI predates the attention-mask API - update it.- Flux: CFG 1.0 and no negative prompt; higher CFG just blurs. And stick to 3–4 regions max - more than that and the pack itself warns most models fall apart.
Inputs (14)
| Name | Type | Default | Description |
|---|---|---|---|
| clip | CLIP | CLIP model from your checkpoint | |
| width | INT | 134464–16384 | Output width - must match your latent/sampler |
| height | INT | 76864–16384 | Output height - must match your latent/sampler |
| soften_masks | BOOLEAN | true | Enable feathering at region edges - recommended ON |
| background_prompt | STRING | photo of empty city street at night, high quality | Scene description (applies to entire image as base) |
| background_strengthopt | FLOAT | 1.00–10 | Background conditioning strength (lower = regions show more, user-tested: 0.7-1.2) |
| region1_promptopt | STRING | red sports car | Region 1 - TIP: Include size/detail keywords (e.g. 'closeup', 'full body', 'large') |
| region1_strengthopt | FLOAT | 0.70–10 | Region 1 strength (user-tested: 0.7, range: 0.5-1.0) |
| region2_promptopt | STRING | closeup full body giraffe wearing sunglasses | Region 2 - TIP: Include size/detail keywords (e.g. 'closeup', 'full body', 'large') |
| region2_strengthopt | FLOAT | 0.80–10 | Region 2 strength (user-tested: 0.8, range: 0.6-1.2) |
| region3_promptopt | STRING | blue bird flying | Region 3 - Optional third region |
| region3_strengthopt | FLOAT | 1.50–10 | Region 3 strength (user-tested: 1.5, range: 1.0-2.0) |
| region4_promptopt | STRING | Region 4 - Optional fourth region | |
| region4_strengthopt | FLOAT | 2.50–10 | Region 4 strength (recommended: 2.5-3.0, higher values may cause artifacts) |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| conditioning | CONDITIONING | — |