lama-cleaner-0.4.0.mp4
- Support multiple model architectures
- High resolution support
- Run as a desktop APP
- Multi stroke support. Press and hold the
cmd/ctrlkey to enable multi stroke mode. - Zoom & Pan
- Keep image EXIF data
pip install lama-cleaner
lama-cleaner --device=cpu --port=8080Available commands:
| Name | Description | Default |
|---|---|---|
| --model | lama or ldm. See details in Model Comparison | lama |
| --device | cuda or cpu | cuda |
| --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 |
| --port | Port for flask web server | 8080 |
| --debug | Enable debug mode for flask web server |
Diffusion model(ldm) is MUCH MORE slower than GANs(lama)(1080x720 image takes 8s on 3090), but it's possible to get better result, see below example:
| Original Image | LaMa | LDM |
|---|---|---|
![]() |
![]() |
![]() |
Blogs about diffusion models:
- https://lilianweng.github.io/posts/2021-07-11-diffusion-models/
- https://yang-song.github.io/blog/2021/score/
Only needed if you plan to modify the frontend and recompile yourself.
Frontend code are modified from cleanup.pictures, You can experience their great online services here.
- Install dependencies:
cd lama_cleaner/app/ && yarn - Start development server:
yarn start - Build:
yarn build
Run within a Docker container. Set the CACHE_DIR to models location path. Optionally add a -d option to
the docker run command below to run as a daemon.
docker build -f Dockerfile -t lamacleaner .
docker run -p 8080:8080 -e CACHE_DIR=/app/models -v $(pwd)/models:/app/models -v $(pwd):/app --rm lamacleaner python3 main.py --device=cpu --port=8080
docker run --gpus all -p 8080:8080 -e CACHE_DIR=/app/models -v $(pwd)/models:/app/models -v $(pwd):/app --rm lamacleaner python3 main.py --device=cuda --port=8080
Then open http://localhost:8080


