[Inference.Core] Inpaint Preprocessor
Better Mask Blending Than Standard Inpainting
- image
- mask
- IMAGE
There are two completely different ways to inpaint in ComfyUI, and mixing them up is a common source of confusion. Standard model inpainting (VAE Encode for Inpainting, or an inpainting checkpoint) bakes the masked region directly into the latent and asks the model to fill it in. ControlNet-style inpainting is a different animal: the mask itself becomes the condition, fed to a ControlNet that was specifically trained to be mask-aware. The payoff is edge blending - because the ControlNet learned what "masked but should blend seamlessly" looks like, seams are noticeably less visible than with plain latent inpainting. This node is the prep step for that second path.
The mechanism is straightforward: it takes your original image and your mask and merges them into a single hint image formatted the way an Inpaint ControlNet expects - the masked region gets marked in a way the model can distinguish from "this pixel is genuinely black in the source" rather than "this pixel is missing and needs filling." That distinction matters; without it, a ControlNet has no way to tell the difference between an intentionally dark area and a hole it's supposed to paint over.
Inputs are as simple as it gets: image, your source picture, and mask, the region you want inpainted - both required, no optional parameters at all. Standard ComfyUI mask convention applies (white/1.0 = the area to inpaint), and getting the polarity backwards is the single most common mistake people make with any mask-driven node, this one included - if your "inpainted" region is everywhere except where you drew, that's the first thing to check, not a bug in the node. The single IMAGE output is the merged hint, and it goes into a ControlNet Apply node paired with an Inpaint ControlNet checkpoint you load separately (SD 1.5's control_v11p_sd15_inpaint, or on newer bases, the inpaint mode baked into the current union models - several of the 2026-era unions, including Z-Image's and Flux 2's, ship an inpaint mode alongside their other conditions).
Installing it: this node comes from LykosAI's ComfyUI-Inference-Core-Nodes pack. LykosAI is the team behind Stability Matrix, the meta-installer a lot of people use to manage multiple local SD UIs, so this pack's dependency handling is a notch more deliberate than a typical solo project. Easiest install is through ComfyUI Manager - search "ComfyUI-Inference-Core-Nodes." Manually: cd ComfyUI/custom_nodes && git clone https://github.com/LykosAI/ComfyUI-Inference-Core-Nodes, then either run install.py with ComfyUI's own Python environment, or pick the right pip extra for your hardware - pip install -e .[cuda], .[cuda12], .[rocm], .[directml], or .[cpu] - to get an accelerated onnxruntime, or a plain pip install -e . if you don't need that. Restart ComfyUI to pick it up.
Troubleshooting: this node itself is simple enough that runtime failures are rare - the two things that actually go wrong are mask polarity (covered above) and pack-level install issues shared across the whole node set. The recurring real-world one is ModuleNotFoundError: No module named 'inference_core_nodes' after a git clone, which means the Python install step never ran (or ran against the wrong interpreter - a frequent trap on portable ComfyUI installs, where you need to explicitly target the bundled python_embeded). If ComfyUI reports the whole pack as IMPORT FAILED rather than just this node, that points to a broader dependency problem - a few users have specifically reported this pack failing to load on Mac due to platform-specific dependency conflicts, so if you're off Windows/Linux that's worth checking before assuming your setup is uniquely broken. And if edges still look rough despite using this node, confirm the ControlNet checkpoint you loaded is actually the inpaint-trained one - a generic Canny or Depth model fed this hint image won't understand what it's looking at.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | — | |
| mask | MASK | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| IMAGE | IMAGE | — |