https://github.com/eljandoubi/ai-photo-editing-with-inpainting
A web app that allows you to select a subject and then change its background, OR keep the background and change the subject.
https://github.com/eljandoubi/ai-photo-editing-with-inpainting
bitsandbytes gradio-interface huggingface-accelerate huggingface-diffusers huggingface-transformers pytroch
Last synced: 3 months ago
JSON representation
A web app that allows you to select a subject and then change its background, OR keep the background and change the subject.
- Host: GitHub
- URL: https://github.com/eljandoubi/ai-photo-editing-with-inpainting
- Owner: eljandoubi
- License: mit
- Created: 2024-02-15T13:57:04.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2024-02-15T17:42:09.000Z (about 1 year ago)
- Last Synced: 2024-11-25T01:09:53.274Z (5 months ago)
- Topics: bitsandbytes, gradio-interface, huggingface-accelerate, huggingface-diffusers, huggingface-transformers, pytroch
- Language: Jupyter Notebook
- Homepage:
- Size: 10.9 MB
- Stars: 7
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# AI-Photo-Editing-with-Inpainting
## About
In this project I build a little app that allows you to select a subject and then change its background, OR keep the background and change the subject.The process involves a user uploading an image and selecting the main object by clicking on it. The Segment Anything Model (SAM) is activated to create a mask around the selected object, choosing the most accurate mask generated. The user is shown this result to either accept it or refine the mask further with additional points. Once the mask is finalized, the user gives a text description (and possibly a negative prompt) to specify a new background for the selected object. An infill model then creates this new background, and the final image is displayed. Optionally, the user can choose to invert the mask and substitute the subject while keeping the background, as in the example above.
This little app can be used to swap backgrounds, swap subjects, remove objects, and more!
## Installation
If you are trying this locally, follow these instructions first:
```bash
conda create -n "impating" python=3.11conda activate impating
git clone https://github.com/eljandoubi/AI-Photo-Editing-with-Inpainting.git
cd AI-Photo-Editing-with-Inpainting
pip install -r requirements.txt
jupyter notebook
```## Samples


