Sign inSign up

sharrnah/stable-diffusion-guitard

By sharrnah

Updated about 4 years ago

Stable Diffusion including a web GUI (GUItard)

Image
10

10K+

sharrnah/stable-diffusion-guitard repository overview

Docker image for Stable Diffusion

See Repository: https://github.com/Sharrnah/Stable-Diffusion-Docker

Setup for Windows

  • For Windows using WSL2, write a .wslconfig File in your user path with following content:
[wsl2]
memory=12GB # Limits VM memory in WSL 2 to X GB
processors=3 # Makes the WSL 2 VM use X virtual processors
localhostForwarding=true
  • You can play with the values if your PC can't handle it.

  • Install Docker Desktop for Windows

  • Make sure you are running the newest NVIDIA Drivers and newest Docker Desktop Version.

Installation

With Docker
  • Build image yourself with:

    docker build -t stable-diffusion-guitard .

  • Run prebuild image with:

    docker run -d --gpus all -p 7860:8080 -v ./.cache/app:/root/.cache -v ./.cache/facexlib/:/app/src/facexlib/facexlib/weights/ -v ./.cache/gfpgan/:/app/gfpgan/weights/ -v ./models/:/models/ -v ./outputs/:/outputs/ -e RUN_MODE=false sharrnah/stable-diffusion-guitard
    

    (replace "sharrnah/stable-diffusion-guitard" image name with "stable-diffusion-guitard" to run self-build image)

    change "RUN_MODE" depending on your machine. (see Options for more info)

  • Download / Clone this repo.

    (Or just get the docker-compose.yaml file if you want to use the prebuild image and ignore "build image yourself" step.)

  • Start docker-compose project.

    • building image yourself:

    docker compose -f docker-compose.build.yaml up -d --build

    • start prebuild image with:

    docker compose up -d

  • See current logs with:

    docker compose logs stablediffusion -f

  • You can exec into the container with:

    docker compose exec stablediffusion bash

Options

  • You can set the environment variable "RUN_MODE" to one of these setting:
    • "OPTIMIZED" For reduced Memory mode (sacrificing speed)
    • "OPTIMIZED-TURBO" For lesser reduced Memory mode (sacrificing less speed)
    • "GTX16" When generated images are green (known problem on GTX 16xx GPUs)
    • "GTX16-TURBO" When generated images are green (known problem on GTX 16xx GPUs) [using OPTIMIZED-TURBO]
    • "FULL-PRECISION" use full precision
  • Set the environment variable "WEBUI_RELAUNCH" to
    • "true" (default) For automatic restarting of the WebUI
    • "false" Disables automatic restarting of the WebUI
  • Set the environment variable "ENABLE_TEXTUAL_INVERSION" to
    • "true" To clone and install Textual Inversion (Breaks Latent Diffusion SR!!!)
    • "false" (default) does not clone Textual Inversion on startup

For that you can create a .env file and set the content to

RUN_MODE=OPTIMIZED

or

RUN_MODE=GTX16

(See example.env file including all possible values)

Usage

  • after the webgui started successfully you should see a log output telling

    Running on local URL:  http://127.0.0.1:7860/
    
  • See current log with:

    docker compose logs stablediffusion -f

  • Open http://127.0.0.1:7860/ in your Browser to use it.

  • All generated images are saved into the ./outputs/ directory.

  • Find some nice example prompts here:

Model Sources

Models should be downloaded automatically on first run now!

ModelFunctionVersionSizeLocal Location (Case-Sensitive!)Download Source
Stable DiffusionImage Generationv1.4~4 GBmodels/SDv1.4.ckptWeb:
https://drive.yerf.org/wl/?id=EBfTrmcCCUAGaQBXVIj5lJmEhjoP1tgl
https://www.googleapis.com/storage/v1/b/aai-blog-files/o/sd-v1-4.ckpt?alt=media
Torrent Magnet:
magnet:?xt=urn:btih:3a4a612d75ed088ea542acac52f9f45987488d1c&dn=sd-v1-4.ckpt&tr=udp%3a%2f%2ftracker.openbittorrent.com%3a6969%2fannounce&tr=udp%3a%2f%2ftracker.opentrackr.org%3a1337
Hugging Face:
https://huggingface.co/CompVis/stable-diffusion-v1-4
GFPGANFace Correctionv1.3.0332 MBmodels/GFPGANv1.3.pthWeb:
https://github.com/TencentARC/GFPGAN/releases/download/v1.3.0/GFPGANv1.3.pth
RealESRGANUpscalingv0.1.0~64 MBmodels/RealESRGAN_x4plus.pthWeb:
https://github.com/xinntao/Real-ESRGAN/releases/download/v0.1.0/RealESRGAN_x4plus.pth
RealESRGAN animeUpscaling Animev0.2.2.4~17 MBmodels/RealESRGAN_x4plus_anime_6B.pthWeb:
https://github.com/xinntao/Real-ESRGAN/releases/download/v0.2.2.4/RealESRGAN_x4plus_anime_6B.pth
Latent DiffusionUpscaling, InpaintingJuly 2022~2 GBmodels/LDSR.ckptWeb:
https://heibox.uni-heidelberg.de/f/578df07c8fc04ffbadf3/?dl=1
Sources:

Tag summary

Content type

Image

Digest

sha256:79702f1e7

Size

7.2 GB

Last updated

about 4 years ago

docker pull sharrnah/stable-diffusion-guitard