Happy new year 🎆 ! I just recovered from COVID and it's been really hard to be sick, hope everyone is doing well.
File Manager
https://user-images.githubusercontent.com/3998421/211202244-57093aef-7d76-4ce6-91e0-c63cb0211755.mov
I realize that some users will use this tool to process lots of photos and I thought a FileManager would be helpful. Users can search images by name, and browser images in both the image directory and the output directory. To enable the FileManager, set two command line args when starting Lama Cleaner.
- `--input`: a directory contains images you want to clean up
- `--output-dir`: The directory where you want to save the resulting image when clicking the download button on the web page, the resulting image will download to the output directory. **A folder will be created in this directory to store the thumbnails**
A folder icon will appear on the left-top corner, click this icon to open FileManager, or use shortcut `f`.
<img width="180" alt="image" src="https://user-images.githubusercontent.com/3998421/211227320-29073a0b-98a2-42c0-879f-c2b36a82e223.png">
SD/PaintByExample Image Resize
https://user-images.githubusercontent.com/3998421/211202340-4ac928ff-23fe-49a2-9b4b-dea31c16bd99.mov
Resize the image before inpainting, then scale up the inpainting area to fill the origin area, the area outside the mask will not lose quality. This option can be used to save vRAM.
cpu_offload
new command line arg: `--cpu-offload` for sd/paint_by_example model, offloads all models to CPU, reducing vRAM usage.
According to [diffusers's document](https://huggingface.co/docs/diffusers/optimization/fp16#offloading-to-cpu-with-accelerate-for-memory-savings), vRAM can be reduced to 2GB, but that doesn't seem to be the case [in my tests](https://github.com/huggingface/diffusers/issues/1934), you can try it yourself.