Extensions/ComfyUI-Regional-Mask-Prompt
ComfyUI Extension

ComfyUI-Regional-Mask-Prompt

Experimental ComfyUI custom nodes for applying prompt conditioning to color-painted mask regions by converting color mask images into ComfyUI tensors.

By dr1610·Created 2 months ago·Updated 2 months ago· 0
dr1610/ComfyUI-Regional-Mask-Prompt
Nodes
On cloudLocal install
Stars0
Updated2 months ago
Readme

ComfyUI Regional Mask Prompt

Experimental ComfyUI custom nodes for applying prompt conditioning to color-painted mask regions.

This is a ComfyUI-oriented sibling project of sd-webui-regional-prompter-mask-ui. It does not use BREAK prompt parsing. Instead, it converts a color mask image into ComfyUI MASK tensors and attaches each region prompt to ComfyUI conditioning with mask metadata.

Nodes

Regional Mask Prompt Encode

Inputs:

  • clip
  • mask_image
  • base_prompt
  • region_1_prompt to region_8_prompt
  • region_count
  • region_strength
  • base_strength
  • mask_tolerance
  • mask_feather
  • min_mask_alpha
  • set_cond_area

Outputs:

  • conditioning
  • region_1_mask to region_8_mask
  • region_info

Connect conditioning to the positive input of a sampler. Use the regular negative conditioning path separately.

Regional Mask Prompt Palette

Prints the expected palette for region masks. Region colors follow the same deterministic HSV style used by Regional Prompter's mask mode:

  • Region 1: #804040
  • Region 2: #408080
  • Region 3: #608040
  • Region 4: #604080

Recommended workflow

  1. Create a white-background color mask image.
  2. Paint each intended region with the palette color for that region.
  3. Load the mask image in ComfyUI.
  4. Connect it to Regional Mask Prompt Encode.
  5. Enter shared tags in base_prompt.
  6. Enter region-specific tags in each region prompt.
  7. Connect the output conditioning to your sampler.

Practical notes

  • This is regional prompt guidance, not pixel-perfect inpainting.
  • It is best for rough person/area separation, clothing, hair color, large objects, and scene zones.
  • Exact pose or small body-part control still needs ControlNet/OpenPose, reference images, or inpainting.
  • For SDXL/Illustrious style models, keep region prompts short and compatible with the base prompt.
  • Increase mask_feather if boundaries look harsh.
  • Increase mask_tolerance if imported mask colors are not detected.

Installation

Clone this repository into ComfyUI/custom_nodes:

cd ComfyUI/custom_nodes
git clone https://github.com/dr1610/ComfyUI-Regional-Mask-Prompt.git

Restart ComfyUI.

License

MIT