Model or dataset
Acly/comfyui-inpaint-nodes avatar
Acly/comfyui-inpaint-nodes

ComfyUI Inpaint Nodes: Fooocus Inpaint, LaMa and MAT inside a normal ComfyUI graph

Nodes for better inpainting with ComfyUI: Fooocus inpaint model for SDXL, LaMa, MAT, and various other tools for pre-filling inpaint & outpaint areas.

1,241 stars73 forksPythonGPL-3.0

At a glance

What is it?
Acly/comfyui-inpaint-nodes adds Fooocus inpaint patching for SDXL checkpoints, small LaMa and MAT fill models, and mask pre-processing nodes to ComfyUI. It is a toolbox for masked editing, not a new sampler, and its value depends on how much control you want over the masked region.
Who is it for?
Adopt it if you already run ComfyUI and want Fooocus inpaint applied to an SDXL checkpoint you already have, or if you need LaMa and MAT as fast pre-fillers before a diffusion pass. Skip it if you only ever mask full regions and denoise at 1.0, because the stock VAE Encode (for Inpainting) path already covers that and this pack adds nothing.
Can I use it commercially?
Yes, with conditions. GPL-3.0 is a copyleft licence: if you distribute software that includes it, you must release that software's source code under the same licence. Running it internally without distributing it does not trigger that obligation.
Is it still maintained?
Yes. The repository last received commits 108 days ago.
What is it written in?
Mainly Python, according to GitHub's language statistics.

Answers come from the project's GitHub data, last synced on September 15, 2026, and from our analysis. They are not legal advice.

DEEP OPEN-SOURCE ANALYSIS

What problem ComfyUI Inpaint Nodes solves

ComfyUI can already run an inpaint model, but the stock path is narrow. The README states that Fooocus inpaint can be used with VAE Encode (for Inpainting) directly, with one restriction: existing content in the masked area is not allowed, so denoise strength has to be 1.0. That means full replacement of the masked pixels and nothing else. You cannot keep half of what was there and regenerate the rest.

The second stock option is InpaintModelConditioning, which does let you combine an inpaint model with existing content. But the README is explicit that the resulting latent cannot be fed directly into Apply Fooocus Inpaint. So the two halves of the job, conditioning and model patching, do not connect out of the box.

The pack targets people building masked-edit graphs in ComfyUI: retouching a face, removing an object, extending a canvas. It is for users who want per-pixel denoise strength and a choice of what fills the hole before the sampler runs, rather than a single binary mask and a full replace.

The Fooocus patch and the two-latent split

The core mechanism is a patch. According to the README, Fooocus inpaint is a small patch applied to your SDXL checkpoints that transforms them into inpaint models, which are then used like any other inpaint model. Nothing is retrained and no second checkpoint is downloaded for the UNet itself; the patch rides on top of the weights you already have.

The interesting design decision is the two-output node. VAE Encode & Inpaint Conditioning produces latent_inpaint, which connects to Apply Fooocus Inpaint, and latent_samples, which connects to KSampler. The README describes this as equivalent to running both VAE Encode (for Inpainting) and InpaintModelConditioning, but with less overhead because the image is not VAE-encoded twice. That is the whole trick: one encode, two consumers.

Around that core sit three groups of nodes. Pre-processing fills the masked area before the sampler sees it: Expand Mask and Shrink Mask grow or erode a binary mask with optional feathering, Stabilize Mask snaps values very close to 1 to exactly 1.0, and Fill Masked offers neutral, telea and navier-stokes modes. Blur Masked blurs the image into the mask with a weaker effect at the border. Separately, Load Inpaint Model plus Inpaint (using Model) run LaMa or MAT as a fast standalone filler. Post-processing has Color Match (Masked) for brightness drift and Denoise to Compositing Mask, which maps mask values in the range offset to threshold onto 0 to 1, aimed at ComfyUI's Differential Diffusion node.

Installing ComfyUI Inpaint Nodes and running a first inpaint

The README gives three install routes. The recommended one is ComfyUI Manager, searching for "ComfyUI Inpaint Nodes". The manual route is to download the repository and drop the folder into ComfyUI/custom_nodes. The third is git, run from inside the custom_nodes directory:

bash
cd ComfyUI/custom_nodes
git clone https://github.com/Acly/comfyui-inpaint-nodes.git

After that, restart ComfyUI. The README states this explicitly, and without the restart the nodes will not appear in the menu.

Two extra steps are easy to miss. First, the Fooocus inpaint models come from lllyasviel/fooocus_inpaint on Hugging Face and go into ComfyUI/models/inpaint, not into the checkpoints folder. Second, OpenCV is only needed for the telea and navier-stokes fill modes, and the README gives the install as a plain pip command:

bash
pip install opencv-python

For a first real use, start from the example workflows in the workflows directory rather than building a graph from scratch. The README lists five: inpaint-simple.json for basic 100 percent replacement, inpaint-refine.json for refining existing content at 1 to 100 percent denoise strength, outpaint.json for outpainting with pre-processing, inpaint-preprocess.json for experimenting with pre-processors, and inpaint-promptless.json, which drops the text prompt and requires IP-Adapter. Load inpaint-refine.json, point Load Checkpoint at a regular SDXL model, and the VAE Encode & Inpaint Conditioning node should already be wired with its two outputs going to Apply Fooocus Inpaint and KSampler. What you should see after a queue is the masked region regenerated while the surrounding pixels stay close to the original.

Where this pack stops being the right tool

The Fooocus patch is tied to SDXL. The README frames it as a patch for SDXL checkpoints, and the note under the Fooocus section is blunt: use the regular version of a checkpoint, because distilled merges such as Turbo, Lightning and Hyper do not work. If your workflow is built on SD 1.5, Flux or a distilled SDXL variant, this half of the pack is not available to you, and you are left with the pre-processing and LaMa/MAT nodes.

The LaMa and MAT path is a different kind of limitation. These are small, fast inpaint models run on the masked area, and the README positions them for outpainting and object removal. They fill plausibly, but they do not follow a prompt. If you need the filled region to match a description, the model path is a pre-fill and the diffusion pass still has to do the semantic work.

Color Match (Masked) is narrower than its name suggests. The README says it is useful only if the color shift occurs in the entire output, including the parts excluded by the noise mask, and that colors are analysed from changes outside the masked area. If your shift is confined to the masked region, this node is the wrong instrument. The README also does not document rollback or an uninstall procedure, so removing the pack means deleting the folder and re-opening the workflows that referenced its nodes.

ComfyUI Inpaint Nodes against a dedicated inpaint checkpoint

The obvious alternative is to download a purpose-built inpaint checkpoint and skip the patch entirely. That approach is simpler to reason about: one model file, no Apply Fooocus Inpaint node, no two-latent split. The difference in approach is that a dedicated checkpoint bakes inpainting into the weights, while this pack leaves your existing SDXL checkpoint intact and changes how it is conditioned and patched at runtime. If you switch base models often, or you already have a library of SDXL checkpoints you like, patching avoids maintaining a parallel set of inpaint builds. If you only ever run one model, a dedicated checkpoint removes a whole class of wiring mistakes.

The second alternative is ComfyUI's own nodes: VAE Encode (for Inpainting) plus InpaintModelConditioning, which the README names as the combination that VAE Encode & Inpaint Conditioning replaces. Those stock nodes work, and the README's stated advantage here is avoided double VAE encoding rather than a capability the stock nodes lack. The genuine additions are the pre-processing and post-processing nodes, which have no stock equivalent in the README's account.

Maintenance, licence and upgrade cost

The last push to the repository was on 2026-05-31, so the project is not archived and has moved within the last few months. There are no releases retrieved for it, which means upgrades arrive as commits on main rather than as tagged versions, and the version string in pyproject.toml is the only version marker the repository exposes. The practical cost is that pinning to a known-good state means pinning to a commit hash rather than a release tag.

The licence is GPL-3.0, declared in pyproject.toml as a file reference to LICENSE. That is a copyleft licence, and it is worth understanding what that means for your own code before you build on it, particularly if you redistribute a modified version. This is not legal advice; read the LICENSE file itself.

One upgrade detail worth noting is that the pack depends on ComfyUI internals. The README's warning about noise masks needing to be >= 1.0, and the existence of Stabilize Mask to work around values like 0.9999, both describe behaviour of the host application rather than of this pack. When ComfyUI changes how it rounds or interprets masks, nodes like Stabilize Mask exist precisely to absorb that.

Editorial conclusion

Adopt it if you already run ComfyUI and want Fooocus inpaint applied to an SDXL checkpoint you already have, or if you need LaMa and MAT as fast pre-fillers before a diffusion pass. Skip it if you only ever mask full regions and denoise at 1.0, because the stock VAE Encode (for Inpainting) path already covers that and this pack adds nothing. Before committing, verify that your checkpoint is a regular SDXL build rather than a Turbo, Lightning or Hyper merge, since the README states distilled merges do not work with the Fooocus patch, and confirm that the two model files land in ComfyUI/models/inpaint rather than the checkpoints folder, because Load Inpaint Model looks there.

Frequently asked questions

How do I inpaint in ComfyUI with these nodes?

Install the pack, restart ComfyUI, and load one of the example workflows from the workflows directory, such as inpaint-simple.json for full replacement or inpaint-refine.json for partial denoise. The Fooocus path also needs the models from lllyasviel/fooocus_inpaint placed in ComfyUI/models/inpaint.

What is the difference between inpainting and outpainting in ComfyUI Inpaint Nodes?

Inpainting fills a masked area inside the existing image, while outpainting extends the canvas beyond its current edges. The README provides a separate outpaint.json workflow for the outpainting case, and notes that the LaMa and MAT models work well for outpainting or object removal.

What is the best model for inpainting with ComfyUI Inpaint Nodes?

The README does not rank models. It describes Fooocus inpaint as a patch applied to regular SDXL checkpoints, noting that distilled merges such as Turbo, Lightning and Hyper do not work, and lists LaMa and MAT as small, fast models suited to outpainting or object removal.

How do I insert an image in ComfyUI inpainting?

The README does not document a separate image-insertion node. The pre-processing nodes fill the masked area before inpainting, and Fill Masked offers neutral, telea and navier-stokes modes, while Blur Masked blurs the image into the masked area to keep the general colors the same.

Official sources

  1. Acly/comfyui-inpaint-nodes on GitHub
  2. Issues
  3. License: GPL-3.0
  4. README
Community notes

Community notes