LaMa Inpaint
Erase things with no prompt, no sampler, no drama
- lama_model
- images
- masks
- images
Every diffusion inpainter you've used needs the full circus: a sampler, a denoise value, a prompt, a VAE. LaMa doesn't. It's a compact neural network - not a diffusion model at all - that looks at the pixels ringing a mask and paints plausible texture straight into the hole. One forward pass, no prompt, done. That makes it the fastest way in ComfyUI to delete a watermark, a power line, a stray hand, or a logo, and to get the surrounding background to just... continue.
It's the opposite of a creative tool, and that's the point. LaMa won't reason "this is a person, let me redraw them." It hallucinates texture and pattern that blends with what's around the mask, which is exactly what object removal wants. When you need a specific new thing inside the hole, reach for a diffusion inpaint (or an edit model); when you need something erased, LaMa is faster and usually cleaner.
How it works
The node takes your image plus a mask, and passes a 4-channel tensor - the masked image stacked with the binary mask - through the Big LaMa network (the FFC architecture from Samsung Research, adapted into this pack). Then the smart part: it composites the network's output only inside the mask. Unmasked pixels are copied from the original untouched, so you get the same bit-identical-outside-the-mask guarantee that the inpainting world usually has to engineer with crop-and-stitch. No VAE, no latent, no sampler in between.
The mask itself gets two pre-treatments before the model sees it:
mask_threshold(0–255, default 250) - applied after blurring. Pixels above it become the fill region; this matches legacy 0–255 mask behavior, so a standard white-on-black mask works with the defaults.gaussblur_radius(0–20, default 8) - softens the mask edge so the fill blends instead of leaving a hard seam. Low radius + large mask = visible boundary.
Plus invert_mask, which swaps which side gets filled. Handy when your mask is inverted relative to what you want erased.
Wiring it up
It needs a lama_model from its sibling, UC_LoadLaMaModel, and then images and masks. Output is a single images tensor - preview it or save it and move on. The whole thing typically runs in well under a second on a GPU.
Common issues
- Blank or empty fill - almost always means the model didn't actually load. Check UC_LoadLaMaModel's dropdown (see its article: only
.safetensorsinmodels/lama, never auto-downloaded). - Hard seam around the fill - raise
gaussblur_radius. Default 8 is fine for most masks; big clean masks want more. - It erased the wrong region - flip
invert_mask. - The fill looks "dumb" - it fills with texture, not semantics. If the hole needs to become a specific object, LaMa is the wrong tool.
Install is just the pack plus a model file: download Big LaMa (or the Anime/Manga variant) into ComfyUI/models/lama and load it. No sampler, no scheduler, no prompt - the most relaxing node in the graph.
Inputs (6)
| Name | Type | Default | Description |
|---|---|---|---|
| lama_model | LAMA_MODEL | — | |
| images | IMAGE | — | |
| masks | MASK | — | |
| mask_threshold | INT | 2500–255 | Threshold applied after mask blur; matches legacy 0-255 behavior. |
| gaussblur_radius | INT | 80–20 | Gaussian mask blur radius in pixels. |
| invert_mask | BOOLEAN | false | Invert which mask region LaMa replaces. |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| images | IMAGE | — |