Nodes/aioli-nodes/๐Ÿ—บ๏ธ Regional Mask Conditioning
ComfyUI Node

๐Ÿ—บ๏ธ Regional Mask Conditioning

Different prompt per region, one sampler pass โ€” for your own masks

By aiolicollectiveยทCreated 6 months agoยทUpdated 2 months agoยท 0
๐Ÿ—บ๏ธ Regional Mask Conditioning
  • conditioning
  • masks
  • base_conditioning
  • conditioning
  • covered_mask
โ—„strength1.00โ–บ
โ—„set_area_to_boundsfalseโ–บ
โ—„base_strength0.50โ–บ

Regional prompting is the standing answer to a specific, maddening failure: prompt adherence is global, so one prompt describing two subjects reliably smears their attributes together. The girl on the left keeps getting the boy's jacket. The fix has always been the same - split the canvas into areas, give each its own prompt - and the tooling has been rebuilt after every architecture shift since Latent Couple. This node is the 2026 rebuild, and the twist is that your "areas" are whatever masks you have: SAM3 objects, hand-drawn blobs from MaskSplitRegions, anything.

The core ComfyUI primitive for this has always been Conditioning (Set Mask) - one node per region. That works beautifully for two or three fixed regions and collapses the moment the count is dynamic, which it always is when masks come from a segmentation model. RegionalMaskConditioning folds a list of (conditioning, mask) pairs into a single regional conditioning that a one-pass KSampler consumes directly. Any N.

How it works

Each pair becomes a Conditioning (Set Mask) with a mask_strength, and they're all concatenated - that's the whole mechanism, the same regional-conditioning trick the ecosystem has used for years, just turned into a list operation ComfyUI can't do on its own. Because it's INPUT_IS_LIST, the conditioning input takes one entry per region; or you can supply a single conditioning for N masks and it's broadcast to every region - handy for debugging or when all regions share a prompt.

Two genuinely useful extras. First, an optional global layer: connect base_conditioning - a prompt describing the whole image - and it's applied over the full frame, blended with the regional prompts via base_strength (which becomes its mask_strength). Inside a region you get a weighted mix of global and regional; outside every region the global applies alone. The blend happens at the sampler level, so prompts of different lengths mix cleanly with no tensor interpolation. Leave base_strength at 0 or skip the input for pure regional behaviour.

Second, set_area_to_bounds = True restricts each region's compute to its mask's bounding box - a real speed win when regions are small relative to the canvas.

Inputs and outputs

  • conditioning - one per region (list), or a single one to broadcast.
  • masks - the regional masks (list).
  • strength - per-region mask_strength, default 1.0.
  • set_area_to_bounds - restrict each region to its bbox, default False.
  • base_conditioning (optional) - the whole-image prompt.
  • base_strength - weight of the global layer, default 0.5.

Outputs: conditioning (wire into the KSampler's positive input) and covered_mask, the union of all regions - mostly a debugging view of what's actually covered.

Installing it

Ships in the Aioli Nodes pack. ComfyUI Manager โ†’ search "Aioli Nodes", or:

cd ComfyUI/custom_nodes
git clone https://github.com/aiolicollective/aioli-nodes

Restart ComfyUI; it's under Aioli Nodes. No extra dependencies - torch only.

The honest cost

Regional conditioning is inherently slower: the sampler runs one model forward pass per distinct masked prompt, per step. N regions plus an optional global layer is N+1 passes a step, and at high resolution with DyPE each pass is expensive. The README is blunt about it, and the practice matches: keep the region count down, and turn on set_area_to_bounds whenever your regions are small. If a workflow suddenly feels Nร— slower than the same image with one global prompt, this is why. As with the rest of this young pack from a small studio, genuine bugs get answered on the GitHub issues page - don't expect a big forum trail.

CategoryAioli Nodes

Inputs (6)

NameTypeDefaultDescription
conditioningCONDITIONINGโ€”
masksMASKโ€”
strengthoptFLOAT1.000โ€“10โ€”
set_area_to_boundsoptBOOLEANfalseโ€”
base_conditioningoptCONDITIONINGโ€”
base_strengthoptFLOAT0.500โ€“10โ€”

Outputs (2)

NameTypeDescription
conditioningCONDITIONINGโ€”
covered_maskMASKโ€”