LaMaInpainting ♾️Mixlab
Erase objects without a diffusion model
- image
- mask
- IMAGE
Need to make something disappear - a watermark, a stray person, a logo, a power line - and have the background fill in cleanly? That's LaMa's whole job. It's a dedicated object-removal model, not a diffusion sampler, so there's no prompt, no CFG, no steps. You give it an image and a mask, it erases what's under the mask and paints in plausible background. Fast, deterministic, and it doesn't need a checkpoint loaded.
This is a different tool from the inpainting you do with Stable Diffusion. As the inpainting KB lays out, SD-style inpainting is for generating new content in a region - swap the jacket, add an object, change the expression. LaMa is for removing content and reconstructing what was behind it. When your goal is "get rid of this and make it look like it was never there," a diffusion model is overkill and often worse; LaMa is the specialist. It's the same model behind a lot of "magic eraser" features you've seen in phone apps.
How it works
LaMa (Large Mask inpainting) is a purpose-built neural network trained specifically on the fill-a-hole task, using fast Fourier convolutions that let it reason about repeating structure across the whole image - which is why it's unusually good at reconstructing textures and periodic patterns (brick, grass, sky, fabric) even under big masks. It runs once, no iterative denoising. The masked area gets replaced with the model's reconstruction; everything outside the mask is left alone.
The catch that falls out of the mechanism: it reconstructs, it doesn't imagine. Erasing a small thing against a busy-but-regular background is where it shines. Erasing a large object against a complex, one-of-a-kind scene is where it gets blurry and vague, because there's nothing coherent for it to extrapolate.
Inputs and outputs
Two required inputs, nothing optional:
image(IMAGE) - the picture you're editing.mask(MASK) - white where you want it erased, black where you want it kept. Paint it with Edit Mask, derive it from a detector, whatever - the mask is what defines "remove this."
Output is IMAGE (a list) - your image with the masked region filled in. It goes straight to a Preview/Save, or into a further pass if you want to touch up the result.
One practical tip from how the model behaves: grow your mask a few pixels past the edge of the thing you're removing. If the mask hugs the object too tightly, LaMa leaves a faint halo of the original object's edge pixels. A little margin fixes it.
How to install it
LaMa is the one node in this pack that needs a manual step - the maintainer pulled it out of the automatic requirements because its simple-lama-inpainting dependency drags in a Pillow version that clashes with the rest of the pack. So the node only activates if you install that dependency yourself:
- Install the pack (ComfyUI Manager: search
comfyui-mixlab-nodes; orcd ComfyUI/custom_nodes && git clone https://github.com/shadowcz007/comfyui-mixlab-nodes.gitthen install requirements and restart). - Install the LaMa dependency into your ComfyUI Python:
pip install simple-lama-inpainting(use the embedded Python on a portable install:../../../python_embeded/python.exe -s -m pip install simple-lama-inpainting). - Download the weights -
big-lama.ptfrom the simple-lama-inpainting releases - and drop it inmodels/lama.
If simple-lama-inpainting isn't present, the node simply won't register. That's by design, not a bug, so if LaMa Inpainting is missing from your node list, that's the first thing to check.
Common issues
Node doesn't appear: the dependency isn't installed - see step 2 above. This is the number-one reason people can't find it.
Pillow conflicts after installing it: that's the exact clash the maintainer was avoiding. If installing simple-lama-inpainting breaks other nodes with a Pillow error, you're in dependency-version territory; pin Pillow to a version both sides tolerate, or keep LaMa in a separate environment if it's fighting your stack too hard. The maintainer's issue tracker has a running thread on LaMa problems.
Blurry or vague fill: you asked it to remove too much, or the background behind the removal was too unique to reconstruct. Shrink what you're erasing, or fall back to diffusion inpainting for a region that genuinely needs invented detail. And if you see a ghost outline of the removed object, grow the mask a few pixels and rerun.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | — | |
| mask | MASK | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| IMAGE | IMAGE | — |