Inpaint not Masked
Inpaint not Masked
Read the name carefully, because it's doing the opposite of what most people expect on first glance. Regular inpainting regenerates whatever you paint and leaves everything else alone. This node flips that: paint a mask, and it's the area outside your mask that gets regenerated - whatever you painted is protected instead. If what you actually want is "swap the background but keep the subject exactly as it is," this is the inpaint node you want, not the plain one.
It's the pack's Inpaint example with one line changed - the README calls it "largely identical to the Inpaint node but inverts the image mask" - bundled into a single node the same way txt2img bundles a full generation loop: Load Checkpoint, two prompt encodes, a Load Image, VAE Encode (for Inpainting), KSampler, VAE Decode, Save Image, all in one box.
How it works
Underneath, this is standard model inpainting - any checkpoint can do it, there's no dedicated inpainting fine-tune required. The image gets VAE-encoded together with an (inverted) mask, the masked region gets partially or fully renoised depending on your denoise setting, and the KSampler denoises it back guided by your prompts. Because it's not a mask-aware model, expect the usual standard-inpainting tradeoff: cleaner results the smaller and better-blended your mask is, and a real risk of seams or a slight color mismatch at the boundary if you crank denoise too high with a big mask.
The one setting that's specific to this node and worth understanding is grow_mask_by. It pads the mask by that many pixels before encoding, giving the model a little buffer of context around the boundary so the transition blends rather than showing a hard edge. Default is 6; push it up if you're seeing a visible seam, but don't go overboard - too much padding starts eating into the region you meant to protect.
Inputs and outputs
Same shape as a full inpaint workflow:
- ckpt_name - any installed checkpoint.
- text / text_2 - positive and negative prompts.
- image - pick a previously uploaded image (or upload one), then use ComfyUI's mask editor on it to paint your mask.
- grow_mask_by - mask padding, described above.
- seed, steps, cfg, sampler_name, scheduler, denoise - standard KSampler settings. Denoise matters more here than in a plain txt2img node: lower values keep the regenerated area closer to the original pixels, higher values let it depart further.
- filename_prefix - passed to Save Image.
Like txt2img, this node is an output node with Save Image baked in - no output socket, the result lands directly in your output folder. That also means you can't chain it into a further pass without either editing the underlying workflow file or falling back to the individual nodes.
Installing it
Ships as part of the same pack, not separately:
- ComfyUI Manager - search "Integrated Nodes for ComfyUI."
- Manual -
cd ComfyUI/custom_nodes && git clone https://github.com/palant/integrated-nodes-comfyui, then restart ComfyUI.
No extra models or dependencies - you just need a checkpoint you already have.
Common issues
You forgot to paint a mask. If the whole image is unmasked, "not masked" means the entire frame - you'll get a full regeneration of the whole picture at your denoise setting, not a selective edit. Always check the mask editor before running.
You grabbed the wrong node. Inpaint and Inpaint not Masked look nearly identical in the node list and differ by one word. Since the whole point of masking is protecting the part you care about, loading the wrong one means you protect exactly the part you meant to change, and regenerate everything else. Worth double-checking the node's title before you queue a long render.
Only one image shows in the node preview. This is a genuine ComfyUI limitation, not specific to this pack - ComfyUI can't render multiple images on one node at once, so with both an input and an output image living on the same node, you'll only ever see whichever one changed most recently. It's not a sign that your input didn't load; check the actual output file if you're unsure.
Seams or color mismatch at the mask edge. Bump grow_mask_by a little, and consider lowering denoise if the mismatch looks more like a style shift than a hard edge.
Inputs (12)
| Name | Type | Default | Description |
|---|---|---|---|
| seed | INT | 00–18446744073709550000 | The random seed used for creating the noise. |
| steps | INT | 201–10000 | The number of steps used in the denoising process. |
| cfg | FLOAT | 8.00–100 | The Classifier-Free Guidance scale balances creativity and adherence to the prompt. Higher values result in images more closely matching the prompt however too high values will negatively impact quality. |
| sampler_name | COMBO | The algorithm used when sampling, this can affect the quality, speed, and style of the generated output. | |
| scheduler | COMBO | The scheduler controls how noise is gradually removed to form the image. | |
| denoise | FLOAT | 1.000–1 | The amount of denoising applied, lower values will maintain the structure of the initial image allowing for image to image sampling. |
| ckpt_name | COMBO | The name of the checkpoint (model) to load. | |
| text | STRING | The text to be encoded. | |
| text_2 | STRING | The text to be encoded. | |
| filename_prefix | STRING | ComfyUI | The prefix for the file to save. This may include formatting information such as %date:yyyy-MM-dd% or %Empty Latent Image.width% to include values from nodes. |
| image | COMBO | 1 options: example.png | |
| grow_mask_by | INT | 60–64 | — |
Outputs (0)
No outputs