Frequently Asked Questions

Q&A

"Unrecognized data format" error

../public/torch_error.png

It may be a permission problem, please change the model save directory use --model-dir argument.

How to update to the latest version?

  • For installer: Rerun win_config.bat will install the newest version of lama-cleaner
  • For pip: pip install -U lama-cleaner

Where are models downloaded?

By default, models will be downloaded to the user folder

  • sd/paint_by_example models: ~/.cache/huggingface/diffusers. For Windows users, it's C:\Users\your_name\.cache\huggingface\diffusers
  • lama and other models: ~/.cache/torch/hub/checkpoints. For Windows users, it's C:\Users\your_name\.cache\torch\hub\checkpoints

How to change the directory of model downloaded?

Add command line arg --model-dir=xxxx (new in 0.32.0)

How to add command line args to the windows installer?

Double click win_config.bat, and you can config all command line args in web UI.

How to change GPU device to use in windows installer?

Assume two GPUs, and you want to use second one, add SET CUDA_VISIBLE_DEVICES=1 before lama-cleaner start in win_start.bat (opens in a new tab)

windows installer error

window-installer-change-folder

This is caused by moving the directory after unpacking zip.

How to install Xformers in Windows Installer v2?

Change three lines in win_confg.bat:

@call conda install -y -c conda-forge cudatoolkit=11.7
@call pip install torch==1.13.1+cu117 --extra-index-url https://download.pytorch.org/whl/cu117
@call pip install xformers

m1/m2 chip error: illegal hardware instruction

see: https://github.com/Sanster/lama-cleaner/issues/268 (opens in a new tab)

How to completely uninstall lama-cleaner?

Delete lama-cleaner program

  • For windows installer: delete the unzipped folder
  • For pip: pip uninstall lama-cleaner

Delete downloaded models:

By default lama-cleaner download model to ~/.cache/torch/hub/checkpoints/ or ~/.cache/huggingface/diffusers(sd/paint_by_example). For Windows users, it's C:\Users\your_name\.cache\torch\hub\checkpoints\ or C:\Users\your_name\.cache\huggingface\diffusers.

⚠️

The default model cache directory may contain other models, so you should only delete the lama-cleaner related models.

If you used --model-dir=xxxx to change the model directory, you safely delete the directory you specified.

Why do I get all black or green results?

  • sd1.5/sd2
  • paint_by_example

Some GPUs don't support half-precision floating point numbers (a known issue with 16xx cards), a green or black screen may appear instead of the generated pictures. This may be fixed by using the command line arguments --no-half

How to avoid GPU memory OOM?

See Memory (opens in a new tab)