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.
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:
clipmask_imagebase_promptregion_1_prompttoregion_8_promptregion_countregion_strengthbase_strengthmask_tolerancemask_feathermin_mask_alphaset_cond_area
Outputs:
conditioningregion_1_masktoregion_8_maskregion_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
- Create a white-background color mask image.
- Paint each intended region with the palette color for that region.
- Load the mask image in ComfyUI.
- Connect it to
Regional Mask Prompt Encode. - Enter shared tags in
base_prompt. - Enter region-specific tags in each region prompt.
- 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_featherif boundaries look harsh. - Increase
mask_toleranceif 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