Skip to content

rachelspark/anything-ai

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

34 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Anything AI: a generative photo editing tool

Click and fill anything in your image with a simple text prompt. Segment Anything meets Stable Diffusion, in your browser.

Demo Image

anything-ai.com is a generative photo editing tool that accepts an image, creates object masks (holes) based on where you click, and then takes in a prompt to generate content and magically fill that hole with anything you want.

Background & Technical Details

Anything takes the most recent research in image inpainting, focusing on Inpaint Anything's Remove Anything and Fill Anything, and makes these powerful vision models easy to use on the web. Image segmentation is powered by Meta's Segment-Anything Model (SAM) and content generation is powered by Stable Diffusion Inpainting. The backend is served using Python (on a Modal endpoint) with a Next.js frontend. A mask prediction call should take less than 3.0s with a warm container. Stable Diffusion should take ~10s to cold start and ~3.0s per image generated.

Development

If you want to hack on Anything, install the dependencies and run the frontend development server locally using a recent version of Node.js. Navigate to frontend and run:

npm install
npm run dev

This automatically connects to the models deployed serverlessly on Modal.

To modify the backend, you will need to set up a Modal account/token and make sure you have Python 3.10+ and Poetry (Python dependency manager) installed. Run poetry install in the main directory to install all the backend dependencies, then make sure you're in the virtual environment whenever you run the server. Once you're happy with your changes, you can deploy your backend by running modal deploy main.py, which creates a public webhook such as https://rachelspark--replace-anything-fastapi-app.modal.run. You can then point the API_ENDPOINT in the web app to your new backend URL.

Acknowledgements

About

Click and fill anything in your image with a simple text prompt.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published