πΎ Inpaint Mask Pro
Stop letting sloppy inpaint regions bleed into the frame
- image
- inpaint_mask
- mask
- image_thru
- mask
- mask_bw
- preview_out
If you've ever drawn an inpaint mask freehand - or let an external tool generate one - you know they come out sloppy: bleeding over edges, covering half the face, feathering where they shouldn't. And because ComfyUI's Load Image node doesn't take a mask input, you've probably wrestled with whether your mask even made it into the sampler. Inpaint Mask Pro exists for exactly this mess. It combines your inpaint mask with an optional clean silhouette mask, so the inpaint only fires where you actually want it, and hands you the cleaned result plus a color overlay so you can see what you're about to regenerate.
How it works
Two masks go in:
inpaint_mask(required) - your sloppy inpaint region. You can flip it withinvert_mask, grow or shrink it withinpaint_expand(β100 to 100), and soften its edges withinpaint_blur(0β50). This is the mask the sampler will actually use.mask(optional, gated byuse_mask) - a clean silhouette, e.g. the subject cut out by a background-removal node. When enabled, the inpaint region gets cropped to this silhouette, which is the whole trick: a messy inpaint stroke that wanders off the subject gets clipped back to the subject's boundary instead of regenerating the background.mask_expandandmask_blurtune that crop mask too.
Outputs: image_thru (the original image, passed through for easy chaining), mask (the final processed mask - wire this to your ConditioningSetMask or sampler), mask_bw (the same mask as a viewable B&W image), and preview_out (a color overlay composite).
The preview that saves your skin
The color overlay is where this node earns its keep. Each mask gets its own color and opacity, both independently toggleable: the inpaint layer (show_in_mask, default red at 0.5) and the crop layer (show_mask, default lime green at 0.3). You get red = "will be regenerated," green = "the crop boundary," and you can see at a glance whether your inpaint is going to eat the subject's hair or stop at its ear. That's the difference between a good inpaint and a "why did it regrow the ear" inpaint.
Install
MachinePainting Nodes pack:
cd ComfyUI/custom_nodes
git clone https://github.com/machinepainting/ComfyUI-MachinePaintingNodes.git
pip install -r requirements.txt
or ComfyUI Manager β "MachinePaintingNodes" β install β restart.
Gotchas
Version history matters here: in v2.1.2 the pack removed SEGS support and made inpaint_mask required - so if a workflow you downloaded expects an older signature, update the pack. Mask-to-image resolution mismatches are handled (the crop mask is resized to the image), but the inpaint mask should already match your image or you'll get silent misalignment. And don't forget the mask-inpaint's place in the 2026 landscape: for small, precise fixes nothing beats mask-based inpainting because the untouched pixels stay bit-identical, while whole-image edit models drift everything. This node is how you keep that workflow clean and visible instead of flying blind.
Inputs (15)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | β | |
| inpaint_mask | MASK | β | |
| invert_maskopt | BOOLEAN | false | β |
| inpaint_expandopt | INT | 0-100β100 | β |
| inpaint_bluropt | FLOAT | 0.00β50 | β |
| show_in_maskopt | BOOLEAN | true | β |
| in_mask_coloropt | COMBO | red | 4 options: red, light_blue, black, white |
| in_mask_opacityopt | FLOAT | 0.500β1 | β |
| use_maskopt | BOOLEAN | false | β |
| maskopt | MASK | β | |
| mask_bluropt | FLOAT | 0.00β50 | β |
| mask_expandopt | INT | 0-100β100 | β |
| show_maskopt | BOOLEAN | false | β |
| mask_coloropt | COMBO | lime_green | 4 options: lime_green, purple, black, white |
| mask_opacityopt | FLOAT | 0.300β1 | β |
Outputs (4)
| Name | Type | Description |
|---|---|---|
| image_thru | IMAGE | β |
| mask | MASK | β |
| mask_bw | IMAGE | β |
| preview_out | IMAGE | β |