stable-diffusion-webui icon indicating copy to clipboard operation
stable-diffusion-webui copied to clipboard

Added support for Docker Build/Compose and K8S

Open panpan0000 opened this issue 11 months ago • 4 comments

Description

Merging the PR from https://github.com/AUTOMATIC1111/stable-diffusion-webui/pull/16688

  • Add dockerfile for docker build

  • Added support for containerization with Docker. To run webui you need to have Docker installed, clone the repository and execute docker compose up in the root directory of the repository. The first startup installs all the dependencies and subsequent startups are much quicker. The webui is exposed at localhost:7860

  • Add support for k8s yaml

  • will add CI for automatic docker image build and pushing to dockerhub later

Screenshots/videos:

.....
################################################################
Launching launch.py...
################################################################
glibc version is 2.36
Check TCMalloc: libtcmalloc_minimal.so.4
./webui.sh: line 258: bc: command not found
./webui.sh: line 258: [: -eq: unary operator expected
libtcmalloc_minimal.so.4 is linked with libc.so,execute LD_PRELOAD=/lib/x86_64-linux-gnu/libtcmalloc_minimal.so.4
Launching Web UI with arguments: --skip-prepare-environment

/webui/venv/lib/python3.10/site-packages/timm/models/layers/__init__.py:48: FutureWarning: Importing from timm.models.layers is deprecated, please import via timm.layers
  warnings.warn(f"Importing from {__name__} is deprecated, please import via timm.layers", FutureWarning)
no module 'xformers'. Processing without...
no module 'xformers'. Processing without...
No module 'xformers'. Proceeding without it.
Warning: caught exception 'Found no NVIDIA driver on your system. Please check that you have an NVIDIA GPU and installed a driver from http://www.nvidia.com/Download/index.aspx', memory monitor disabled
Downloading: "https://huggingface.co/runwayml/stable-diffusion-v1-5/resolve/main/v1-5-pruned-emaonly.safetensors" to /webui/models/Stable-diffusion/v1-5-pruned-emaonly.safetensors

  4%|█████▉                                                                                                                                     | 174M/3.97G [02:54<59:12, 1.15MB/
.....

Loading weights [cc6cb27103] from /webui/models/Stable-diffusion/v1-5-pruned-emaonly.ckpt
Running on local URL:  http://0.0.0.0:7860

To create a public link, set `share=True` in `launch()`.
Startup time: 9.9s (import torch: 4.7s, import gradio: 1.2s, setup paths: 0.9s, initialize shared: 0.1s, other imports: 0.6s, load scripts: 0.9s, create ui: 0.9s, gradio launch: 0.5s).
Creating model from config: /webui/configs/v1-inference.yaml

Checklist:

panpan0000 avatar Dec 22 '24 06:12 panpan0000

@ShadowCrafter011 already updated his PR https://github.com/AUTOMATIC1111/stable-diffusion-webui/pull/16688 So I will refactor this one when https://github.com/AUTOMATIC1111/stable-diffusion-webui/pull/16688 merged

panpan0000 avatar Dec 23 '24 07:12 panpan0000

There is already a docker image that have been maintained for over 1½ years. If there is anything in the main repo that causes these not to work then I understand if you request some changes to make it compatible again. But as far as I can see there is no issue with the current state of it. In fact it was updated less than 24 hours ago. universonic/stable-diffusion-webui at the docker hub

You can absolutely make a repo dedicated to build/compose of the webui and have it linked by the main repo so people can find it. But introducing Dockerfiles in to the main repo doesn't make much sense.

silveroxides avatar Dec 23 '24 15:12 silveroxides

There is already a docker image that have been maintained for over 1½ years. If there is anything in the main repo that causes these not to work then I understand if you request some changes to make it compatible again. But as far as I can see there is no issue with the current state of it. In fact it was updated less than 24 hours ago. universonic/stable-diffusion-webui at the docker hub

You can absolutely make a repo dedicated to build/compose of the webui and have it linked by the main repo so people can find it. But introducing Dockerfiles in to the main repo doesn't make much sense.

we can discuss this topic in thread : https://github.com/AUTOMATIC1111/stable-diffusion-webui/pull/16688

panpan0000 avatar Dec 24 '24 06:12 panpan0000

There is already a docker image that have been maintained for over 1½ years. If there is anything in the main repo that causes these not to work then I understand if you request some changes to make it compatible again. But as far as I can see there is no issue with the current state of it. In fact it was updated less than 24 hours ago. universonic/stable-diffusion-webui at the docker hub

You can absolutely make a repo dedicated to build/compose of the webui and have it linked by the main repo so people can find it. But introducing Dockerfiles in to the main repo doesn't make much sense.

this docker image should be referenced in the wiki section https://hub.docker.com/r/universonic/stable-diffusion-webui

gimmelovn avatar Jun 20 '25 23:06 gimmelovn