{"id":27079141,"url":"https://github.com/yanwenkun/sd-webui-docker-base","last_synced_at":"2025-07-04T10:04:23.372Z","repository":{"id":135212869,"uuid":"611356513","full_name":"YanWenKun/sd-webui-docker-base","owner":"YanWenKun","description":"🐳 Dockerfile for 🖼️ Stable Diffusion WebUI, only runtime environment \u0026 bootstrapping scripts. | SD-WebUI 的容器镜像，但仅含运行环境与安装启动脚本。","archived":false,"fork":false,"pushed_at":"2024-09-29T07:21:16.000Z","size":135,"stargazers_count":23,"open_issues_count":0,"forks_count":4,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-06T01:32:28.152Z","etag":null,"topics":["automatic1111","docker","stable-diffusion","stable-diffusion-webui"],"latest_commit_sha":null,"homepage":"https://hub.docker.com/r/yanwk/sd-webui-base","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mulanpsl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/YanWenKun.png","metadata":{"files":{"readme":"README.adoc","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2023-03-08T16:53:02.000Z","updated_at":"2025-02-14T08:34:21.000Z","dependencies_parsed_at":null,"dependency_job_id":"b4a13baf-291b-4f1a-98ac-49ff3fe5a62a","html_url":"https://github.com/YanWenKun/sd-webui-docker-base","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/YanWenKun/sd-webui-docker-base","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/YanWenKun%2Fsd-webui-docker-base","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/YanWenKun%2Fsd-webui-docker-base/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/YanWenKun%2Fsd-webui-docker-base/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/YanWenKun%2Fsd-webui-docker-base/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/YanWenKun","download_url":"https://codeload.github.com/YanWenKun/sd-webui-docker-base/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/YanWenKun%2Fsd-webui-docker-base/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263489675,"owners_count":23474526,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["automatic1111","docker","stable-diffusion","stable-diffusion-webui"],"created_at":"2025-04-06T01:32:28.865Z","updated_at":"2025-07-04T10:04:23.316Z","avatar_url":"https://github.com/YanWenKun.png","language":"Shell","readme":"# Yet another Docker image for Stable Diffusion WebUI\n\nimage::https://github.com/YanWenKun/sd-webui-docker-base/actions/workflows/on-push.yml/badge.svg[\"GitHub Workflow Status\"]\n\nimage::docs/chart-concept.svg[\"Concept Design\"]\n\n*link:README.zh.adoc[\u003e\u003e 中文文档 \u003c\u003c]*\n\nThis repo is inspired by https://github.com/AbdBarho/stable-diffusion-webui-docker[AbdBarho], with a different approach, and only supports https://github.com/AUTOMATIC1111/stable-diffusion-webui[AUTOMATIC1111].\n\n## Idea\n\nA heavy user of SD-WebUI would probably have a lot of models, extensions, and want everything up-to-date. This Docker image is how I figured out to manage them: \n\nKeeping the app \u0026 data in one place, and leaving the dependency in Docker.\n\n\n## How it works\n\n1. At first start, a script will download latest SD-WebUI, some extensions and essential models.\n2. The whole SD-WebUI will be stored in a local folder (`./storage/stable-diffusion-webui`).\n3. If you already have a SD-WebUI bundle, put it there and make an empty file (`./storage/.sdw-download-complete`) so the start script will skip downloading.\n4. At every restart of the container, a script will update SD-WebUI \u0026 its extensions.\n\n\n## Prerequisites\n\n* NVIDIA GPU with ≥6GB VRAM (for 4GB see \u003c\u003cq-n-a, Q \u0026 A\u003e\u003e).\n\n* Latest NVIDIA GPU Drivers, Both Game and Studio version will work.\n\n* Docker Installed\n** Windows user could use https://www.docker.com/products/docker-desktop/[Docker Desktop] with WSL2 enabled.\n\n\n## Usage\n\n.A. Using `docker compose`\n[source,sh]\n----\ngit clone https://github.com/YanWenKun/sd-webui-docker-base.git\n\ncd sd-webui-docker-base\n\ndocker compose up --detach\n\n# Update image (only when Python components is outdated)\ngit pull\ndocker compose pull\ndocker compose up --detach --remove-orphans\ndocker image prune\n----\n\n.B. Using `docker run`\n[source,sh]\n----\nmkdir -p storage\n\ndocker run -it \\\n  --name sd-webui \\\n  --gpus all \\\n  -p 7860:7860 \\\n  -v \"$(pwd)\"/storage:/home/runner \\\n  --env CLI_ARGS=\"--xformers --medvram --allow-code --api --enable-insecure-extension-access\" \\\n  yanwk/sd-webui-base\n\n# Update image (only when Python components is outdated)\ndocker rm sd-webui\ndocker pull yanwk/sd-webui-base\n# Then re-run 'docker run' above again\n----\n\nOnce the app is loaded, visit http://localhost:7860/\n\n\n// ## (Deprecated) link:nightly/README.adoc[Nightly Build] \n\n// For image tag `nightly`:\n\n// * It builds more frequently.\n// * It's ready for https://github.com/d8ahazard/sd_dreambooth_extension[DreamBooth Extension].\n// * It come with dev version of xFormers.\n// ** (Don't expect performance boost, the stable version is good enough now.)\n\n// link:nightly/README.adoc[Read more about using nightly].\n\n// The base `latest` will keep simple and easy for people to modify.\n\n\n[[q-n-a]]\n## Q \u0026 A\n\nQ: My GPU only has 4GB VRAM +\nA: Modify args in `CLI_ARGS`, change `--medvram` to `--lowvram`.\n\nQ: Can I run it without a NVIDIA GPU? +\nA: Use CPU!\n\n1. In `docker-compose.yml`, delete `deploy:` section.\n** Or in `docker run`, delete `--gpus all`.\n2. In `CLI_ARGS`, change `--xformers --medvram` to \n`--use-cpu all --no-half --precision full`.\n\nMore `CLI_ARGS` available at https://github.com/AUTOMATIC1111/stable-diffusion-webui/wiki/Command-Line-Arguments-and-Settings[SD-WebUI Wiki].\n\nQ: Why are you using latest version of dependencies? +\nA: Try to squeeze more performance out of GPUs (using latest stable version of PyTorch \u0026 xFormers).\n\nQ: Will upstream changes break this image? +\nA: Probably will with major changes in `launch.py` \u0026 `requirements_versions.txt`, otherwise unlikely. User's data will always stay safe. User just need to update Docker image after I update this repo.\n\n\n## Some commands for debugging\n\n.Build the image, print all logs to STDOUT.\n[source,sh]\n----\ndocker build . -f Dockerfile -t yanwk/sd-webui-base --progress=plain\n----\n\n.Run a one-time container\n[source,sh]\n----\ndocker run -it --rm --gpus all -p 7860:7860 \\\n  -v \"$(pwd)\"/storage:/home/runner \\\n  --env CLI_ARGS=\"--xformers --medvram\" \\\n  yanwk/sd-webui-base\n----\n\n.Run into a root bash\n[source,sh]\n----\ndocker run -it --rm --gpus all \\\n  -v \"$(pwd)\"/storage:/home/runner \\\n  -p 7860:7860 \\\n  --user root \\\n  -e CLI_ARGS=\"--xformers --medvram --allow-code --api --enable-insecure-extension-access --ckpt ./test/test_files/empty.pt\" \\\n  yanwk/sd-webui-base:latest /bin/bash\n----\n\n.Run a rootless container (Podman)\n\nInside the pod, Podman will mount volume as root, scripts will run as root. And from the host side, we see files keep their original ownership.\n\n[source,sh]\n----\nmkdir -p storage\n\npodman pull docker.io/yanwk/sd-webui-base:latest\n\npodman run -it --rm \\\n  --name sd-webui-rootless \\\n  --device nvidia.com/gpu=all \\\n  --security-opt label=disable \\\n  -p 7860:7860 \\\n  -v \"$(pwd)\"/storage:/root \\\n  --user root \\\n  --workdir /root \\\n  -e CLI_ARGS=\"--xformers --medvram --allow-code --api --enable-insecure-extension-access\" \\\n  yanwk/sd-webui-base:latest \\\n  /bin/bash /home/scripts/root-wrapper.sh\n----\n\n## Special Thanks\n\nThank again for https://github.com/AbdBarho/stable-diffusion-webui-docker[AbdBarho]'s devotion and brilliant works, which my inspiration emerged from. I would definitely consider `webui-docker` if I want to deploy multiple WebUIs and only one set of models.\n\n## License\n\nlink:LICENSE[Mulan Permissive Software License，Version 2]\n\nThis open source license is written and valid both in Chinese and English, how good is that!\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyanwenkun%2Fsd-webui-docker-base","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyanwenkun%2Fsd-webui-docker-base","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyanwenkun%2Fsd-webui-docker-base/lists"}