Skip to content

An absolutely minimalist UI for playing around with a self-hosted stable diffusion.

License

Notifications You must be signed in to change notification settings

aaronkaplan/simple-stable-diffusion-ui

Repository files navigation

Simple Stable Diffusion UI

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.

Requirements

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/

How to install it?

The manual way

  1. git clone it
  2. pip install -r requirements
  3. Install redis-stack. Note: of course, you can also just use plain redis]
  4. 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

How to explore the cache?

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/

redis-insights

More documentation on redis-stack here.

How to report bugs?

Please create a pull request and improve.

About

An absolutely minimalist UI for playing around with a self-hosted stable diffusion.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published