Skip to content

brevdev/Stable-Diffusion-Fast-Api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

50 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

This repo will run a fast api for text to image Stable Diffusion. Most of the work here was done by Christian Cantrell. Please check him out!

To run on your own machine:

conda env create -f environment.yaml
conda activate sd-api-server
uvicorn server:app --reload --host 0.0.0.0

If you don't have conda installed, you can use pip with:

python3 -m venv sd-api-server-env
source sd-api-server-env/bin/activate
pip install -r requirements.txt -q -U/

This will create a virtual environment with all the dependencies you need and then run the server. If you don't have the Stable Diffusion model downloaded, this will download it before running the server.

To run on Brev:

Create your environment by following this link pre-populated with config you need.

Install the Brev CLI and open your Stable Diffusion Fast Api environmnent:

brev open stable-diffusion-fast-api --wait

Then activate your environment and run the server:

conda activate sd-api-server
uvicorn server:app --reload --host 0.0.0.0

Then to make requests:

  1. Forward port 8000 in VScode
  2. Go to http://127.0.0.1:8000/docs or make calls through http://127.0.0.1:8000/txt2img?prompt=Snoop+Dogg

Public ports:

With Brev exposing ports publically is super easy! Just go to console.brev.dev and under Environment Settings you'll be able to expose ports publically. Make sure you expose port 8000!

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •