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

comfyui-inpaint-nodes: Fooocus, LaMa, MAT, and Mask Pre-processing for ComfyUI SDXL Inpainting

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

1,244 stars72 forksPythonGPL-3.0

At a glance

What is it?
comfyui-inpaint-nodes (version 1.4.3) is a GPL-3.0 node pack for ComfyUI that brings the Fooocus inpainting patch to any SDXL checkpoint, integrates the LaMa and MAT fast inpaint models, and adds a suite of mask pre-processing and post-processing tools. The Fooocus patch works only on regular SDXL checkpoints and not on distilled merges such as Turbo, Lightning, or Hyper variants.
Who is it for?
Artists and developers who run SDXL workflows in ComfyUI and want Fooocus inpainting, object removal via LaMa or MAT, or finer mask control should install this node pack via ComfyUI Manager or by cloning into ComfyUI/custom_nodes. Those using distilled SDXL variants such as Turbo, Lightning, or Hyper cannot use the Fooocus patch and should rely on ComfyUI's native inpainting nodes instead.
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 5 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 29, 2026, and from our analysis. They are not legal advice.

Editorial analysis

What comfyui-inpaint-nodes Adds Beyond ComfyUI's Built-in Inpainting

ComfyUI ships with a VAE Encode (for Inpainting) node that handles basic masked replacement. This node pack extends that baseline in three directions: it brings the Fooocus inpainting patch to SDXL checkpoints, it integrates the LaMa and MAT inpaint models for fast non-generative fill, and it adds a suite of mask manipulation nodes that control the shape, edge quality, and fill content of the masked area before the sampler runs.

The distinction between the standard VAE Encode (for Inpainting) approach and the new VAE Encode and Inpaint Conditioning node matters in practice. The original approach does not allow existing content in the masked area and requires denoise strength at 1.0, meaning no content from the original image is preserved under the mask. The new node outputs two latents simultaneously: latent_inpaint (connected to Apply Fooocus Inpaint) and latent_samples (connected to KSampler), allowing content refinement rather than full replacement at any denoise strength. The README notes this also avoids encoding the image twice through the VAE, which reduces processing overhead.

How the Fooocus Inpaint Patch Works and Its Core Constraint

The Fooocus inpaint model is described as a small, flexible patch that transforms any standard SDXL checkpoint into an inpaint-capable model without requiring a separately trained inpaint checkpoint. The patch is loaded via the Apply Fooocus Inpaint node after downloading the model files from lllyasviel/fooocus_inpaint on HuggingFace and placing them in ComfyUI/models/inpaint.

The critical constraint is stated directly in the README: this only works with the regular version of an SDXL checkpoint. Distilled merges, including Turbo, Lightning, and Hyper variants, do not work with the Fooocus patch. This is a hard technical limitation, not a configuration issue. A user running a Turbo checkpoint for speed must switch to the base SDXL model or a non-distilled fine-tune to use this patch.

The patch approach means no separate inpaint-specific checkpoint download is required for SDXL inpainting beyond the small patch files themselves. This reduces model storage overhead compared to maintaining both a base checkpoint and a dedicated inpaint variant.

Pre-processing Masks Before Inference

Six pre-processing nodes let you condition the masked area before it reaches the sampler. Expand Mask and Shrink Mask grow or erode a binary mask by a pixel count and can apply blur for edge feathering. Stabilize Mask addresses a specific numerical issue: ComfyUI treats a noise mask as opaque only at exactly 1.0, and floating-point rounding from earlier mask operations can produce values like 0.9999 that fail this check. The Stabilize Mask node clamps near-1 values to exactly 1.0 to prevent masks from silently not working.

Fill Masked provides three fill modes for the masked area before inference: neutral (grey fill, useful for generating entirely new content), telea (fills with colors from the surrounding border using the Telea algorithm), and navier-stokes (fills from the border using a fluid-dynamics approach). The telea and navier-stokes modes require OpenCV; the neutral mode does not. Blur Masked blurs the image content into the masked region with an edge-tapering effect, good for preserving general color tone when refining existing content.

For outpainting specifically, the LaMa and MAT inpaint models can also run as a pre-processing step via the Load Inpaint Model and Inpaint (using Model) nodes, filling the expanded canvas area before the main sampler refines the result.

Installing the Node Pack and Downloading Models

Three installation paths are documented. The first uses ComfyUI Manager: search for "ComfyUI Inpaint Nodes" and install from there. The second downloads the repository manually and places the folder into ComfyUI/custom_nodes. The third clones via git:

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

All three paths require restarting ComfyUI after installation. The telea and navier-stokes fill modes additionally need OpenCV:

bash
pip install opencv-python

The LaMa and MAT model files are not bundled and must be downloaded separately. LaMa uses big-lama.pt from the Sanster models releases page; MAT uses Places_512_FullData_G.pth or an fp16 safetensors version from the Acly/MAT HuggingFace repository. Both belong in ComfyUI/models/inpaint alongside the Fooocus patch files from lllyasviel/fooocus_inpaint. The README does not state whether the node pack checks for missing model files at load time or fails at inference time.

Where the Node Pack Falls Short

The Fooocus patch covers SDXL only. The README documents no equivalent patch for Flux, SD 1.5, or any other architecture. Users working on Flux inpainting workflows will find the Fooocus and LaMa/MAT nodes inapplicable to their pipeline.

The LaMa and MAT models are non-generative: they fill based on surrounding texture rather than on a text prompt. The README recommends them specifically for outpainting and object removal. They produce visually inconsistent results on complex or detailed areas and are not suited for creative content-aware generative fill.

The post-processing Color Match (Masked) node is listed as useful only when the color shift occurs in the entire output, including areas excluded by the noise mask. For shifts that affect only the masked area, the README states this node does not apply. This is a narrow use case that requires reading the documentation carefully before wiring it into a workflow.

License, Version, and Example Workflows

The node pack is licensed under GPL-3.0. This copyleft license requires any derivative work distributed publicly to also carry GPL-3.0. For personal or internal commercial use within ComfyUI this is not typically a concern, but developers building proprietary extensions on top of this pack should review the license terms before distribution.

The package version is 1.4.3 as declared in pyproject.toml, which targets Python 3.12. The last push to the main branch was on 2026-09-25. The repository carries no tagged GitHub releases but tracks version increments in pyproject.toml.

Five example workflow JSON files are included in the workflows/ directory: simple inpainting, refine inpainting, outpainting, complex pre-processing, and a promptless variation that requires IP-Adapter. These files can be loaded directly into ComfyUI and serve as working starting points rather than diagrams.

Editorial conclusion

Artists and developers who run SDXL workflows in ComfyUI and want Fooocus inpainting, object removal via LaMa or MAT, or finer mask control should install this node pack via ComfyUI Manager or by cloning into ComfyUI/custom_nodes. Those using distilled SDXL variants such as Turbo, Lightning, or Hyper cannot use the Fooocus patch and should rely on ComfyUI's native inpainting nodes instead. Verify that opencv-python is installed before using the telea or navier-stokes fill modes, as those two modes require it and will fail without it.

Frequently asked questions

What is the difference between VAE Encode for Inpainting and VAE Encode and Inpaint Conditioning in comfyui-inpaint-nodes?

VAE Encode for Inpainting requires denoise strength at 1.0 and does not preserve existing content in the masked area. VAE Encode and Inpaint Conditioning outputs both latent_inpaint and latent_samples, enabling content refinement at any denoise strength while also avoiding a second VAE-encode pass.

Which SDXL checkpoints work with the Fooocus inpaint patch in comfyui-inpaint-nodes?

Only regular SDXL checkpoints work. Distilled merges such as Turbo, Lightning, and Hyper variants do not work with the Fooocus patch, as the README states directly.

Does comfyui-inpaint-nodes require OpenCV to install?

OpenCV is required only for the telea and navier-stokes fill modes in the Fill Masked node. The neutral fill mode and all other nodes in the pack work without it. Install with pip install opencv-python only if you need those two fill modes.

Official sources

  1. Acly/comfyui-inpaint-nodes on GitHub
  2. Issues
  3. License: GPL-3.0
  4. README
Add this badge to your README

If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.

Add this badge to your README

markdown
[![Hysen Labs](https://hysenlabs.com/badge/acly-comfyui-inpaint-nodes.svg)](https://hysenlabs.com/projects/acly-comfyui-inpaint-nodes)