Skip to content

A simple web application that lets you replace any part of an image with an image generated based on your description.

Notifications You must be signed in to change notification settings

yuqwu/Replace-Anything

Repository files navigation

Replace Anything

A simple web application that lets you replace any part of an image with an image generated based on your description.

Demo

✂️ Generate a mask using the Segment Anything Model (SAM) by Meta AI Research. SAM is able to accurately identify and isolate the specific areas of the image that you want to edit.

Original Segmented

🎨 Replace the specific parts of the image based on a text prompt using Diffusers library Inpaint Pipeline by Hugging Face. This ensures smooth and seamless blending of the edited portions with the rest of the image, resulting in a natural and realistic final product.

Mask Replaced

🍱 Serve the application and models with Gradio on BentoML.

Getting Started

First download the trained model checkpoint ViT-H SAM model.

./download_model.sh

Before running the scripts, make sure you install the dependencies.

pip install -r requirements.txt

Use bentoml to serve the model.

bentoml serve

You can access the WebUI through the /interface endpoint. The root / path is the Swagger debugging page provided by BentoML.

This project is intended for research purposes only and is not intended for commercial use or profit. This project is based on two open source models, Meta Segment Anything and Stable Diffusion, which are made available under the respective licenses.

About

A simple web application that lets you replace any part of an image with an image generated based on your description.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published