CoolFace
Apppublic

tkawano/object-removal

sourceHugging Faceapache-2.0updated 3mo agoView on Hugging Face
0likes
App README

Object Removal (LaMa Inpainting)

Upload an image, paint over the object you want to remove, and LaMa fills the hole with plausible background — a content-aware erase. LaMa (Large Mask inpainting with Fast Fourier Convolutions) is resolution-robust and runs on CPU.

It's generative: it invents a believable background, not the true hidden pixels. Great for removing things (people, signs, blemishes); for text-guided replacement you'd use a diffusion inpainting model.

Run locally

bash
pip install -r requirements.txt
python app.py

Open http://127.0.0.1:7860. On first use, the big-lama model downloads automatically.

How it works (short)

You give a 3-channel image + a 1-channel binary mask (white = remove). LaMa predicts the content under the mask in one forward pass. Fast Fourier Convolutions give each layer a global receptive field, so even large holes get a coherent fill — the key reason LaMa handles big masks better than classical patch methods.

The mask can come from anywhere

Here you brush the mask by hand, but any binary mask works — e.g. a Segment Anything cut-out (click to select an object, then inpaint its region). Select → remove.

Companion demos

  • click-to-segment — click any object (SAM) to get a mask
  • image-upscaler — general upscaling with Real-ESRGAN
  • face-restoration — restore low-quality faces (GFPGAN)

License

Apache-2.0 (app code). See the LaMa repository for model licenses.