This commit is contained in:
fapoverflow 2025-07-07 07:58:25 +02:00
parent 802d0bcd68
commit ab47d2c699
15 changed files with 435 additions and 65 deletions

72
docs/FAQ.md Normal file
View file

@ -0,0 +1,72 @@
# General
Unfortunately, AMD GPUs [#63](https://github.com/AbdBarho/stable-diffusion-webui-docker/issues/63) and MacOs [#35](https://github.com/AbdBarho/stable-diffusion-webui-docker/issues/35) are not supported, contributions to add support are very welcome.
## `auto` exists with error code 137
This is an indicator that the container does not have enough RAM, you need at least 12GB, recommended 16GB.
You might need to [adjust the size of the docker virtual machine RAM](https://github.com/AbdBarho/stable-diffusion-webui-docker/issues/296#issuecomment-1480318829) depending on your OS.
## Dockerfile parse error
```
Error response from daemon: dockerfile parse error line 33: unknown instruction: GIT
ERROR: Service 'model' failed to build : Build failed
```
Update docker to the latest version, and make sure you are using `docker compose` instead of `docker-compose`. [#16](https://github.com/AbdBarho/stable-diffusion-webui-docker/issues/16), also, try setting the environment variable `DOCKER_BUILDKIT=1`
## Unknown Flag `--profile`
Update docker to the latest version, and see [this comment](https://github.com/AbdBarho/stable-diffusion-webui-docker/issues/165#issuecomment-1296155667), try setting the environment variable mentioned in the previous point.
## Output is a always green image
use `--precision full --no-half`. [#9](https://github.com/AbdBarho/stable-diffusion-webui-docker/issues/9)
## Found no NVIDIA driver on your system even though the drivers are installed and `nvidia-smi` shows it
add `NVIDIA_DRIVER_CAPABILITIES=compute,utility` and `NVIDIA_VISIBLE_DEVICES=all` to container can resolve this problem [#348](https://github.com/AbdBarho/stable-diffusion-webui-docker/issues/348#issuecomment-1449250332)
---
# Linux
### Error response from daemon: could not select device driver "nvidia" with capabilities: `[[gpu]]`
Install [NVIDIA Container Toolkit](https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/latest/install-guide.html) and restart the docker service [#81](https://github.com/AbdBarho/stable-diffusion-webui-docker/issues/81)
### `docker compose --profile auto up --build` fails with `OSError`
This might be related to the `overlay2` storage driver used by docker overlayed on zfs, change to the `zfs` storage driver [#433](https://github.com/AbdBarho/stable-diffusion-webui-docker/issues/433#issuecomment-1694520689)
---
# Windows / WSL
## Build fails at [The Shell command](https://github.com/AbdBarho/stable-diffusion-webui-docker/blob/5af482ed8c975df6aa0210225ad68b218d4f61da/build/Dockerfile#L11), `/bin/bash` not found in WSL.
Edit the corresponding docker file, and change the SHELL from `/bin/bash` to `//bin/bash` [#21](https://github.com/AbdBarho/stable-diffusion-webui-docker/issues/21), note: this is a hack and something in your wsl is messed up.
## Build fails with credentials errors when logged in via SSH on WSL2/Windows
You can try forcing plain text auth creds storage by removing line with "credStore" from ~/.docker/config.json (in WSL). [#56](https://github.com/AbdBarho/stable-diffusion-webui-docker/issues/56)
## `unable to access 'https://github.com/...': Could not resolve host: github.com` or any domain
Set the `build/network` of the service you are starting to `host` [#114](https://github.com/AbdBarho/stable-diffusion-webui-docker/issues/114#issue-1393683083)
## Other build errors on windows
* Make sure:
* Windows 10 release >= 2021H2 (required for WSL to see the GPU)
* WSL2 (check with `wsl -l -v`)
* Latest Docker Desktop
* You might need to create a [`.wslconfig`](https://docs.microsoft.com/en-us/windows/wsl/wsl-config#example-wslconfig-file) and increase memory, if you have 16GB RAM, set the limit to something around 12GB, [#34](https://github.com/AbdBarho/stable-diffusion-webui-docker/issues/34) [#64](https://github.com/AbdBarho/stable-diffusion-webui-docker/issues/64)
* You might also need to [force wsl to allow file permissions](https://superuser.com/a/1646556)
---
# AWS
You have to use one of AWS's GPU-enabled VMs and their Deep Learning OS images. These have the right divers, the toolkit and all the rest already installed and optimized. [#70](https://github.com/AbdBarho/stable-diffusion-webui-docker/issues/70)

1
docs/Home.md Normal file
View file

@ -0,0 +1 @@
Welcome to the stable-diffusion-webui-docker wiki!

25
docs/Podman-Support.md Normal file
View file

@ -0,0 +1,25 @@
Thanks to [RedTopper](https://github.com/RedTopper) for this guide! [#352](https://github.com/AbdBarho/stable-diffusion-webui-docker/issues/352)
On an selinux machine like Fedora, append `:z` to the volume mounts. This tells selinux that the files are shared between containers (required for download and your UI of choice to access the same files). *Properly merging :z with an override will work in podman compose 1.0.7, specifically commit https://github.com/containers/podman-compose/commit/0b853f29f44b846bee749e7ae9a5b42679f2649f*
```yaml
x-base_service: &base_service
volumes:
- &v1 ./data:/data:z
- &v2 ./output:/output:z
```
You'll also need to add the runtime and security opts to allow access to your GPU. This can be specified in an override, no new versions required! More information can be found at this RedHat post: [How to enable NVIDIA GPUs in containers](https://www.redhat.com/en/blog/how-use-gpus-containers-bare-metal-rhel-8).
```yaml
x-base_service: &base_service
...
runtime: nvidia
security_opt:
- label=type:nvidia_container_t
```
I also had to add `,Z` to the pip/apt caches for them to work. On the first build everything will be fine without the fix, but on the second+ build, you may get a "file not found" when pip goes to install a package from the cache. Here's a script to do this easily, along with more info: https://github.com/RedTopper/Stable-Diffusion-Webui-Podman/blob/podman/selinux-cache.sh.
Lastly, delete all the services you don't want to use. *Using `--profile` will work in podman compose 1.0.7, specifically commit https://github.com/containers/podman-compose/commit/8d8df0bc2816d8e8fa142781d9018a06fe0d08ed*

11
docs/Screenshots.md Normal file
View file

@ -0,0 +1,11 @@
# AUTOMATIC1111
| Text to image | Image to image | Extras |
| ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- |
| ![](https://user-images.githubusercontent.com/24505302/189541954-46afd772-d0c8-4005-874c-e2eca40c02f2.jpg) | ![](https://user-images.githubusercontent.com/24505302/189541956-5b528de7-1b5d-479f-a1db-d3f5a53afc59.jpg) | ![](https://user-images.githubusercontent.com/24505302/189541957-cf78b352-a071-486d-8889-f26952779a61.jpg) |
# lstein (invokeAI)
| Text to image | Image to image | Extras |
| ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- |
| ![](https://user-images.githubusercontent.com/24505302/195158552-39f58cb6-cfcc-4141-9995-a626e3760752.jpg) | ![](https://user-images.githubusercontent.com/24505302/195158553-152a0ab8-c0fd-4087-b121-4823bcd8d6b5.jpg) | ![](https://user-images.githubusercontent.com/24505302/195158548-e118206e-c519-4915-85d6-4c248eb10fc0.jpg) |

51
docs/Setup.md Normal file
View file

@ -0,0 +1,51 @@
# Make sure you have the *latest* version of docker and docker compose installed
TLDR:
clone this repo and run:
```bash
docker compose --profile download up --build
# wait until its done, then:
docker compose --profile [ui] up --build
# where [ui] is one of: auto | auto-cpu | comfy | comfy-cpu
```
if you don't know which ui to choose, `auto` is good start.
Then access from http://localhost:7860/
Unfortunately, AMD GPUs [#63](https://github.com/AbdBarho/stable-diffusion-webui-docker/issues/63) and Mac [#35](https://github.com/AbdBarho/stable-diffusion-webui-docker/issues/35) are not supported, contributions to add support are very welcome!!!!!!!!!!
If you face any problems, check the [FAQ page](https://github.com/AbdBarho/stable-diffusion-webui-docker/wiki/FAQ), or [create a new issue](https://github.com/AbdBarho/stable-diffusion-webui-docker/issues).
### Detailed Steps
First of all, clone this repo, you can do this with `git`, or you can download a zip file. Please always use the most up-to-date state from the `master` branch. Even though we have releases, everything is changing and breaking all the time.
After cloning, open a terminal in the folder and run:
```
docker compose --profile download up --build
```
This will download all of the required models / files, and validate their integrity. You only have to download the data once (regardless of the UI). There are roughly 12GB of data to be downloaded.
Next, choose which UI you want to run (you can easily change later):
- `auto`: The most popular fork, many features with neat UI, [Repo by AUTOMATIC1111](https://github.com/AUTOMATIC1111/stable-diffusion-webui)
- `auto-cpu`: for users without a GPU.
- `comfy`: A graph based workflow UI, very powerful, [Repo by comfyanonymous](https://github.com/comfyanonymous/ComfyUI)
After the download is done, you can run the UI using:
```bash
docker compose --profile [ui] up --build
# for example:
# docker compose --profile invoke up --build
# or
# docker compose --profile auto up --build
```
Will start the app on http://localhost:7860/. Feel free to try out the different UIs.
Note: the first start will take some time since other models will be downloaded, these will be cached in the `data` folder, so next runs are faster. First time setup might take between 15 minutes and 1 hour depending on your internet connection, other times are much faster, roughly 20 seconds.

73
docs/Usage.md Normal file
View file

@ -0,0 +1,73 @@
Assuming you [setup everything correctly](https://github.com/AbdBarho/stable-diffusion-webui-docker/wiki/Setup), you can run any UI (interchangeably, but not in parallel) using the command:
```bash
docker compose --profile [ui] up --build
```
where `[ui]` is one of `auto`, `auto-cpu`, `comfy`, or `comfy-cpu`.
### Mounts
The `data` and `output` folders are always mounted into the container as `/data` and `/output`, use them so if you want to transfer anything from / to the container.
### Updates
if you want to update to the latest version, just pull the changes
```bash
git pull
```
You can also checkout specific tags if you want.
### Customization
If you want to customize the behaviour of the uis, you can create a `docker-compose.override.yml` and override whatever you want from the [main `docker-compose.yml` file](https://github.com/AbdBarho/stable-diffusion-webui-docker/blob/master/docker-compose.yml). Example:
```yml
services:
auto:
environment:
- CLI_ARGS=--lowvram
```
Possible configuration:
# `auto`
By default: `--medvram` is given, which allow you to use this model on a 6GB GPU, you can also use `--lowvram` for lower end GPUs. Remove these arguments if you are using a (relatively) high end GPU, like 40XX series cards, as these arguments will slow you down.
[You can find the full list of cli arguments here.](https://github.com/AUTOMATIC1111/stable-diffusion-webui/blob/master/modules/shared.py)
### Custom models
Put the weights in the folder `data/StableDiffusion`, you can then change the model from the settings tab.
### General Config
There is multiple files in `data/config/auto` such as `config.json` and `ui-config.json` which let you which contain additional config for the UI.
### Scripts
put your scripts `data/config/auto/scripts` and restart the container
### Extensions
You can use the UI to install extensions, or, you can put your extensions in `data/config/auto/extensions`.
Different extensions require additional dependencies. Some of them might conflict with each other and changing versions of packages could break things. This container will try to install missing extension dependencies on startup, but it won't resolve any problems for you.
There is also the option to create a script `data/config/auto/startup.sh` which will be called on container startup, in case you want to install any additional dependencies for your extensions or anything else.
An example of your `startup.sh` might looks like this:
```sh
#!/bin/bash
# opencv-python-headless to not rely on opengl and drivers.
pip install -q --force-reinstall opencv-python-headless
```
NOTE: dependencies of extensions might get lost when you create a new container, hence the installing them in the startup script is important.
It is not recommended to modify the Dockerfile for the sole purpose of supporting some extension (unless you truly know what you are doing).
### **DONT OPEN AN ISSUE IF A SCRIPT OR AN EXTENSION IS NOT WORKING**
I maintain neither the UI nor the extension, I can't help you.
# `auto-cpu`
CPU instance of the above, some stuff might not work, use at your own risk.