LaMa Inpaint π
The classic model-based inpaint that refuses to download anything
- image
- mask
- image
LaMa is the elder statesman of inpainting models - the one that removes objects cleanly without a diffusion pass, which is exactly why it still has a job in the age of instruction-edit models. LaMa Inpaint π wraps the TorchScript big-lama.pt checkpoint: white areas of your mask get replaced, black areas are preserved to the pixel, and the whole thing runs in a fraction of the time a diffusion inpaint would. It's the right tool when you want something gone - a watermark, a power line, a passerby - and you don't need the model to invent new context, just to paint over it convincingly.
How it works
LaMa is a generative inpainting network (not a diffusion model) trained to fill masked regions from surrounding context. The node reads a TorchScript checkpoint from ComfyUI/models/lama/, runs it over your batch, and preserves unmasked pixels exactly. Two details are worth knowing:
- It never downloads anything. The README is explicit, and the source backs it up: the model folder is registered but never populated or fetched. You place
big-lama.ptyourself. That's deliberate - you should know what weights you're running - but it means the node does nothing until you drop the file in, so the first-time experience is: install, run, error, download, run again. - Video batches are processed one frame at a time to keep VRAM bounded, with the panel streaming each finished frame during the run. Long clips take a while but won't OOM you.
The inputs are dead simple: image, mask (one mask broadcasts across a whole batch), and the model dropdown (default big-lama.pt, listing what's in your models/lama folder). One output: the inpainted image at the original dimensions.
Install
First the pack:
cd ComfyUI/custom_nodes
git clone https://github.com/ausboss/ComfyUI-AusBoss.git
Restart ComfyUI and search for AusBoss (Manager: ComfyUI-AusBoss). Then the model - the one real setup step:
mkdir -p ComfyUI/models/lama
wget -O ComfyUI/models/lama/big-lama.pt \
https://github.com/Sanster/models/releases/download/add_big_lama/big-lama.pt
That's a ~200MB TorchScript checkpoint (the release is the same file the rest of the ecosystem calls big-lama.pt). No Python dependencies beyond what ComfyUI ships; minimum ComfyUI 0.27.1.
Troubleshooting
The number one failure is the model not being found - the node's error message tells you to place the checkpoint in ComfyUI/models/lama/, and that's the fix. Make sure it's the TorchScript big-lama.pt, not a .safetensors fine-tune, or loading will fail with a TorchScript error. If results look soft or the mask edge bleeds, that's the model's nature - LaMa is fast and clean, not detail-sharp, so pair it with a proper diffusion inpaint for regions where texture matters. And remember it only handles white-mask regions; there's no invert toggle, so flip the mask upstream if you need the opposite.
Inputs (4)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | BHWC images or video frames to inpaint. | |
| mask | MASK | White areas are replaced. One mask may be broadcast across the full image batch. | |
| model | COMBO | big-lama.pt | TorchScript LaMa checkpoint from ComfyUI/models/lama. |
| previewopt | BOOLEAN | true | Show this node's result on its face. Off skips writing the preview file to ComfyUI's temp folder. |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| image | IMAGE | Inpainted BHWC image batch with the original dimensions and unmasked pixels preserved. |