Nodes/ComfyUI Inspire Pack/Regional Adapter By Color Mask (Inspire)
ComfyUI Node Runs on cloud

Regional Adapter By Color Mask (Inspire)

Paint Your Regions Instead of Masking Them

By ltdrdata·Created 3 years ago·Updated about 14 hours ago· 831
Regional Adapter By Color Mask (Inspire)
  • adapter_pipe
  • color_mask
  • image
  • REGIONAL_ADAPTER
  • MASK
◄mask_color#FFFFFF►
◄weight1.00►
◄start_at0.000►
◄end_at1.000►

Masks are fine when a detector makes them. They're miserable to author by hand. If you've ever tried to draw four separate soft masks for four characters, you know the pain: an image editor, four exports, four load nodes, and a nagging feeling you got the alignment wrong.

The colour-mask idiom replaces that. You paint one image where each region is a flat colour - red here, blue there, black background - and each adapter entry picks its region by naming its colour. This node is Regional Adapter (Inspire) for that workflow: same reference image, same weight, same schedule window, but the region comes from a colour code instead of a mask input.

What it does

It reads color_mask and builds a mask from every pixel that matches mask_color. That mask becomes the entry's region, exactly as a hand-drawn mask would - and it also comes out of the node as a MASK output, which is quietly the most useful thing here: you can feed it to a paste node, a preview, or an inpainting pass without rebuilding it.

mask_color takes three forms:

  • a hex code like #FF0000 - the usual
  • a colour name like red
  • a decimal number

The README is blunt about the accepted forms, and it's worth respecting them: this isn't a fuzzy matcher. If your painted red is #FF0001 after JPEG compression, it won't match #FF0000. Paint flat colours, save lossless.

Inputs

  • adapter_pipe - the pipe from any of the four families: IPAdapter, PuLID, InstantID, Redux. One node handles all of them; the pipe's type decides what the entry does.
  • color_mask - the painted image.
  • mask_color - which colour defines this region.
  • weight - default 1.0, range -1 to 5. The tooltip carries real numbers worth copying: IPAdapter Plus 0.7, InstantID 0.8, IPAdapter SD3.5 0.5, IPAdapter FLUX with the InstantX file 1.0 with end_at 0.7, and the XLabs FLUX file 0.6 at cfg 1 (or 0.92 with cfg 3.5 and an empty negative).
  • start_at / end_at - the fraction of the sampling where the entry is active, default full range.
  • image (optional) - the reference picture. Not read when your IPAdapter pipe carries embeds from IPAdapter Pipe Options.

Outputs: REGIONAL_ADAPTER into Apply Regional Adapters (Inspire), and MASK - the extracted region, for anything else you want to do with it.

The workflow it enables

colour map PNG ──────────────────────────┐
IPAdapter Model Helper ─► Regional Adapter By Color Mask (mask_color #FF0000) ──┐
PuLID Model Helper ────► Regional Adapter By Color Mask (mask_color #00FF00) ──┤
                                                                                ├─► Apply Regional Adapters
positive / negative ────────────────────────────────────────────────────────────┘

Two characters, one colour map, one place to change the layout. Redraw the map and every entry follows - that's the payoff, and it's why the colour version is the one people actually keep using once the layout stops changing every five minutes.

One structural tip: order matters. Entries apply in the order their sockets are wired, and IPAdapter entries add to the prompt while InstantID and Redux entries modify it. For a face plus a style region, wire the IPAdapter entry and the PuLID entry so the result reads how you want before you start tuning weights.

Being honest about the ceiling

Regional adapters solve attribute bleeding, not composition. If your two characters overlap or touch, the regions can't be cleanly separated and you get the blending you were avoiding. And the whole adapter stack - InstantID, PuLID, IPAdapter - is an SDXL-era path that doesn't extend to the newer architectures. Colour masks don't change any of that.

Install

cd ComfyUI/custom_nodes
git clone https://github.com/ltdrdata/ComfyUI-Inspire-Pack
pip install -r ComfyUI-Inspire-Pack/requirements.txt

Manager: search "ComfyUI Inspire Pack". Restart. On top of that you need whichever family's pack the pipe comes from - IPAdapter Plus for IPAdapter presets, ComfyUI InstantID for the InstantID helper, plus additional_requirements.txt for the face families.

Troubleshooting

Region is empty and the picture looks untouched. Your colour doesn't match the image. Open the mask output's preview with PreviewImage on the MASK - if it's black, the match failed. Repaint, flatten, and save as PNG.

Everything is covered. mask_color matches something you didn't expect, usually a colour-name alias or a background that happens to be that value. Use hex codes to be unambiguous.

Node ignores the entry entirely. Which pipe type did you plug in? An IPAdapter pipe with embeds set doesn't read image - the tooltip says so - and a native FLUX.1/SD3.5 pipe has its own weight guidance that differs from the IPAdapter Plus numbers.

CategoryInspirePack/Regional

Inputs (7)

NameTypeDefaultDescription
adapter_pipeIPADAPTER_PIPE,PULID_PIPE,INSTANTID_PIPE,REDUX_PIPE—
color_maskIMAGE—
mask_colorSTRING#FFFFFF—
weightFLOAT1.00-1–51.0 fits most kinds. IPAdapter Plus: 0.7, as Regional IPAdapter Mask. InstantID: 0.8, as Apply InstantID. IPAdapter SD3.5: 0.5. IPAdapter FLUX with the InstantX file: 1.0 with end_at 0.7, a later end_at lays vertical stripes over the picture. IPAdapter FLUX with an XLabs file: 1.0 gives muddy pictures at cfg 1, use 0.6, or 0.92 with cfg 3.5 and an empty negative prompt.
start_atFLOAT0.0000–1—
end_atFLOAT1.0000–1—
imageoptIMAGEThe reference picture. An IPAdapter pipe with embeds does not read it.

Outputs (2)

NameTypeDescription
REGIONAL_ADAPTERREGIONAL_ADAPTER—
MASKMASK—