Skip to content

Dockerized Stable-Diffusion-Webui based on AUTOMATIC1111/stable-diffusion-webui

License

Notifications You must be signed in to change notification settings

kestr31/docker-stable-diffusion-webui

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

70 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Stable-Diffusion-Webui-Docker

0 Prequisites

1 Building and Running docker-stable-diffusion-webui Docker Image

1.1 Building the Docker Image

  • Use convenience script build.sh to build your own image.
./scripts/build.sh <IMAGE_NAME> <CUDA_VERSION>
# Example: ./scripts/build.sh kestr3l/stable-diffusion-webui 12.2.2
# This will build "kestr3l/stable-diffusion-webui:1.3.0-12.2.2"

The variable "${REPO_VERSION}" is hardcoded in the script.

1.2 Running docker-stable-diffusion-webui Container

  • Run sd-webui.sh to deploy the container
  • By default, the script will make a workspace directory at ${HOME}/Documents/sd-webui.
    • Then, the script will copy compose.yml and run.env to the workspace.
    • Values that need to be changed will be modified automatically.
    • Lastly, the script will clone the stable-diffusion-webui repository to the workspace and run the container.
./scripts/sd-webui.sh run <WORKSPACE_DIR (Optional)>
# Example: ./scripts/sd-webui.sh run
# This will create a workspace at ${HOME}/Documents/sd-webui
# and copy/clone necessary files to the workspace.
  • After running the script, you can access the webui at http://localhost:8000.
    • By default --listen argument is set. Please be aware of the security issues.
    • I strongly recommend to block port or set password as soon as possible.

The container name will be default to sd-webui. This value is hardcoded in run.env. CUDA version and sd-webui version to use are also hardcoded in run.env.

1.3. Stop docker-stable-diffusion-webui Docker Container

  • Run sd-webui.sh with stop argument to stop the container.
./scripts/sd-webui.sh stop

1.4. Debugging stable-diffusion-webui Docker Image

  • Run sd-webui.sh with debug argument to run the container in debug mode.
  • The entrypoint will be overridden with sleep infinity so that you can access the container for debugging.
./scripts/sd-webui.sh debug
# You can access the container by running:
# docker exec -it sd-webui /bin/bash

2. Customizing stable-diffusion-webui

2.1. Changing the Access Port

  • The port can be changed by modifying run.env file.
...
WEBUI_PORT=7860

2.2. Adding additional arguments to stable-diffusion-webui

  • Resources of stable-diffusion-webui if located at ${HOME}/Documents/sd-webui/stable-diffusion-webui by default.
    • It may vary based on your workspace setting.
  • You can add additional arguments to stable-diffusion-webui by modifying webui-user.sh file.
    • By default, --listen --enable-insecure-extension-access is set.
    • Check the official documentation for more information.
...
export COMMANDLINE_ARGS="--gradio-auth yourAccount:yourPass --xformers"
...

2 Future Plans

  • CI/CD for automated image update
  • Image for training environment

3 References

  1. AUTOMATIC1111/stable-diffusion-webui

About

Dockerized Stable-Diffusion-Webui based on AUTOMATIC1111/stable-diffusion-webui

Resources

License

Stars

Watchers

Forks

Packages

No packages published