This is an extremely simple Stable Diffusion web based UI. The UI is using the fastapi microservice framework. The installation will also install stable-diffusion for you (note that the initial first run might take long because it will download the whole SD model).
It comes with:
- a totally minimalistic UI. Easy enough for anyone to understand the code and for tweaking it and making it prettier (Pull requests welcome!) :-)
- a cache (redis) which saves the prompt, the timestamp and the filename of the generated image. This is just there to save the prompts so that you can build upon them later on. Regard it as a log.
You'll need a machine with a working NVIDIA based GPU .
I tested and developed on an NVIDIA GeForce RTX 3080 with Driver Version: 520.56.06 CUDA Version: 11.8 , Ubuntu 20.04 I recommend at least 8GB of GPU RAM, 10 GB of disk space. See https://www.howtogeek.com/853529/hardware-for-stable-diffusion/
- git clone it
pip install -r requirements
- Install redis-stack. Note: of course, you can also just use plain redis]
- Run it: ```bash export REDIS_HOST=localhost export OUTPUTDIR=$(pwd)/output uvicorn --host 0.0.0.0 app.main:app
. **Note**: the first time, you run it, this will take long and download large models.
## With docker
In case you want to run everything via docker, you can build a docker image and run docker-compose up -d:
```bash
docker build -t simple-stable-diffusion-ui:0.1 . --network=host
# docker run -d --name redis-stack -p 6379:6379 -p 8001:8001 -v $(pwd)/cache/:/data -v $(pwd)/redis-stack.conf:/etc/redis-stack.conf redis/redis-stack:latest
docker-compose up -d
ls -al output/
as well as using redis-cli to explore the prompt which matched a specific file.
Also, you can use redis-insights (which comes with redis-stack) to graphically explore the filename to prompt mapping
Go to https://localhost:8001/
More documentation on redis-stack here.
Please create a pull request and improve.