Fill Masked Area
Pre-fill the hole so inpainting doesn't fight itself
- image
- mask
- image
A pre-processing node, not a generation node - it runs before your sampler, not after. The idea: instead of handing your inpaint model a mask over raw, meaningless pixels (or pure noise), you fill the masked hole with something sensible first, so the model has less work to do and fewer seams to hide. It's the ComfyUI equivalent of the "masked content" dropdown people remember from A1111 (fill / original / latent noise), just implemented as its own node.
The three fill modes
That's the one real decision here, exposed as the fill dropdown:
- neutral - fills with flat grey. Use this when you're generating something genuinely new in that spot and don't want any leftover color or texture biasing the result.
- telea - pulls colors inward from the surrounding border using the Telea algorithm, a classic computer-vision inpainting method. Good for object removal, where you want the fill to plausibly continue the background.
- navier-stokes - same goal as telea, different math (fluid-dynamics-based propagation). Also aimed at removal/continuation rather than new content.
falloff (default 0) softens the transition at the mask's edge so the fill doesn't end in a hard line.
Inputs and outputs
- image / mask - what you're filling.
- fill - the mode above.
- falloff (INT, 0–8191) - edge blending amount.
Output is a single image, ready to feed into your VAE encode step like any other pre-processed image.
Installing it
Standard pack install: ComfyUI Manager, search "ComfyUI Inpaint Nodes," or:
cd ComfyUI/custom_nodes
git clone https://github.com/Acly/comfyui-inpaint-nodes.git
Restart ComfyUI. This is the one node in the pack you need to pay attention to on the dependency front:
pip install opencv-python
The README calls this out explicitly - telea and navier-stokes both depend on OpenCV under the hood. neutral mode has no such requirement.
Common issues
Telea or navier-stokes erroring out on first use, in an install where you skipped the extra pip step, points straight at the missing OpenCV dependency above. If you only ever plan to use neutral fill, you can skip it, but you'll hit the wall the moment you try the other two modes.
Picking neutral when you meant to remove an object. It's tempting to leave the dropdown on its default, but neutral grey gives the sampler nothing to anchor on for a "continue the background" task - telea or navier-stokes will usually get you closer with less denoise needed downstream, since they're not fighting a flat grey patch.
This is a pre-processing step, not the fix. Filling the mask doesn't inpaint anything by itself - it just changes what the sampler sees as its starting point. You still need a diffusion pass (or Inpaint (using Model)) afterward.
Inputs (4)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | — | |
| mask | MASK | — | |
| fill | COMBO | 3 options: neutral, telea, navier-stokes | |
| falloff | INT | 00–8191 | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| image | IMAGE | — |