A free and open-source inpainting tool powered by SOTA AI model.
![img](./assets/dark.jpg) ## Features - Completely free and open-source - Fully self-hosted - Multiple SOTA AI models 1. [LaMa](https://github.com/saic-mdal/lama) 1. [LDM](https://github.com/CompVis/latent-diffusion) 1. [ZITS](https://github.com/DQiaole/ZITS_inpainting) 1. [MAT](https://github.com/fenglinglwb/MAT) 1. [FcF](https://github.com/SHI-Labs/FcF-Inpainting) 1. [SD](https://github.com/CompVis/stable-diffusion) - Support CPU & GPU - Various inpainting [strategy](#inpainting-strategy) - Run as a desktop APP ## Usage | Usage | Before | After | | ---------------------- | --------------------------------------------- | --------------------------------------------------- | | Remove unwanted things | ![unwant_object2](./assets/unwant_object.jpg) | ![unwant_object2](./assets/unwant_object_clean.jpg) | | Remove unwanted person | ![unwant_person](./assets/unwant_person.jpg) | ![unwant_person](./assets/unwant_person_clean.jpg) | | Remove Text | ![text](./assets/unwant_text.jpg) | ![text](./assets/unwant_text_clean.jpg) | | Remove watermark | ![watermark](./assets/watermark.jpg) | ![watermark_clean](./assets/watermark_cleanup.jpg) | | Fix old photo | ![oldphoto](./assets/old_photo.jpg) | ![oldphoto_clean](./assets/old_photo_clean.jpg) | ## Quick Start ```bash pip install lama-cleaner # Model will be downloaded automatically lama-cleaner --model=lama --device=cpu --port=8080 # Lama Cleaner is now running at http://localhost:8080 ``` Available arguments: | Name | Description | Default | | ----------------- | -------------------------------------------------------------------------------------------------------- | -------- | | --model | lama/ldm/zits/mat/fcf/sd. See details in [Inpaint Model](#inpainting-model) | lama | | --hf_access_token | stable-diffusion(sd) model need huggingface access token https://huggingface.co/docs/hub/security-tokens | | | --device | cuda or cpu | cuda | | --port | Port for backend flask web server | 8080 | | --gui | Launch lama-cleaner as a desktop application | | | --gui_size | Set the window size for the application | 1200 900 | | --input | Path to image you want to load by default | None | | --debug | Enable debug mode for flask web server | | ## Inpainting Model | Model | Description | Config | | ----- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | LaMa | :+1: Generalizes well on high resolutions(~2k)