- Clone repo
- Create virtual environment
cd stable-diffusion
python3 -m venv venv
source venv/bin/activate
- Install requirements
pip install -r requirements.txt
- Sign up for Hugging Face and generate auth token (https://huggingface.co/docs/hub/security-tokens)
- Request access to stable diffusion model https://huggingface.co/CompVis/stable-diffusion-v1-4
- Input access token to
access_token
inserver.py
andstable-diffusion.py
- Run
stable-diffusion.ipynb
- you can change the prompt and test out different results OR - Run
venv/bin/python stable-diffusion.py
to produce a single result. You can change the prompt and run it again. NOTE: loading the model into memory will be done every time, this is definitely not the most efficient way to do it.
- run
venv/bin/python server.py
- endpoint available at
<ipaddress>:port/stable-diffusion?prompt=<prompt>