Nodes/ControlAltAI Nodes/Region Mask Processor
ComfyUI Node

Region Mask Processor

Feather your Flux region masks so the seams don't show

By gseth·Created 2 years ago·Updated about a year ago· 209
Region Mask Processor
  • mask1
  • bbox1
  • mask2
  • bbox2
  • mask3
  • bbox3
  • processed_mask1
  • processed_bbox1
  • processed_mask2
  • processed_bbox2
  • processed_mask3
  • processed_bbox3
  • preview_image
  • region_count
blur_radius5
threshold0.5
feather_edgestrue
number_of_regions1

If you're staring at this node, you're building a Flux regional-prompting workflow - the thing that lets you say "red-haired woman on the left, blue-haired one on the right" and actually get it, instead of Flux smearing both descriptions across one confused face. Region Mask Processor is the second stop in that pipeline. Its whole job is to take the raw region masks and soften them so the boundaries blend instead of showing up as hard collage seams.

Regional prompting has been the standing answer to attribute bleeding since 2023, and the craft has always come down to one thing: how you handle the edges. Hold hard masks all the way through sampling and you get that characteristic cut-and-paste look with visible lines between regions. This node is where you fix that up front, before the conditioning stage ever sees your masks.

Where it sits

The ControlAltAI Flux Region pipeline runs: Region Mask Generator → Region Mask Processor → Region Mask Validator → Flux Region Conditioning → Flux Attention Control → (optional overlay) → Flux Attention Cleanup. The Generator hands you masks and bounding boxes. You feed them here. The Processor blurs and feathers them, then passes the cleaned-up versions down the line. The author's own note on the pipeline is blunt: the learning curve is high and watching their video tutorial is basically mandatory. This node is one of the gentler pieces of it.

How it works

Under the hood it's doing two ordinary image operations to your masks: a Gaussian blur and edge feathering. A region mask is just a black-and-white shape saying "condition this area." A hard-edged shape produces a hard transition in the final image. Blurring and feathering turn that cliff into a ramp, so when Flux Attention Control blends regions together the handoff is smooth. This softening is also what makes minor region overlap harmless later - feathered edges forgive the kind of small collisions the Validator would otherwise flag.

The inputs and outputs that matter

You wire mask1 and bbox1 straight from the Generator. Then there are three knobs worth understanding:

  • blur_radius (default 5, range 0–32) - how much Gaussian blur to apply to the mask. Bigger means softer, wider transition zones. Start at the default; push it up if region seams still look sharp, ease it down if regions are bleeding into each other more than you want.
  • feather_edges (default true) - the on/off for edge softening. Leave it on. This is the setting doing most of the seam-hiding work.
  • threshold (default 0.5, range 0–1) - where the mask cuts between "in the region" and "out." Middle is a sane default; it decides how much of a soft mask counts as active area.

Set number_of_regions (1–3) to match how many regions you actually defined, and connect the matching optional mask2/bbox2 and mask3/bbox3 pairs if you have them.

Outputs mirror the inputs: processed_mask1/processed_bbox1 through region 3, all feed forward into the Validator. There's a preview_image so you can eyeball the softened masks without a separate preview node, and a region_count integer you can pass along so downstream nodes know how many regions are live.

How to install it

Easiest path is ComfyUI Manager: open the Manager, search ControlAltAI Nodes, install, restart ComfyUI. Manually:

cd ComfyUI/custom_nodes
git clone https://github.com/gseth/ControlAltAI-Nodes

then restart. Region Mask Processor itself has no special dependencies - it's plain mask math. But the node it ultimately feeds, Flux Attention Control, requires XFormers, and the pack ships an xformers_instructions.txt because you have to match XFormers to your exact PyTorch version. Sort that out before you build the full pipeline, or the last stage will fail and this node's output will have nowhere useful to go.

Common issues & troubleshooting

Seams still visible between regions. Raise blur_radius and confirm feather_edges is on. The whole point of this node is soft transitions; a hard-looking result usually means not enough blur.

Regions bleeding into each other. Opposite problem, same knob - too much blur widens the transition zone until neighboring prompts overlap. Pull blur_radius back down.

The pack installed but nodes are missing or acting odd. This pack has a history of Manager-install hiccups (one commonly reported case was a fresh 1.1.1 install showing no options at all). If nodes don't appear, restart ComfyUI fully, and if that fails, delete the folder and re-clone with git rather than trusting a half-finished Manager install. Nothing here downloads a model, so a missing-model error means you're looking at the wrong node in the graph.

CategoryControlAltAI Nodes/Flux Region

Inputs (10)

NameTypeDefaultDescription
mask1MASK
bbox1BBOX
blur_radiusINT50–32
thresholdFLOAT0.50–1
feather_edgesBOOLEANtrue
number_of_regionsINT11–3
mask2optMASK
bbox2optBBOX
mask3optMASK
bbox3optBBOX

Outputs (8)

NameTypeDescription
processed_mask1MASK
processed_bbox1BBOX
processed_mask2MASK
processed_bbox2BBOX
processed_mask3MASK
processed_bbox3BBOX
preview_imageIMAGE
region_countINT