Skip to content

Commit 7ef011d

Browse files
committed
docs: initial documentation
1 parent f8863fa commit 7ef011d

File tree

3 files changed

+167
-1
lines changed

3 files changed

+167
-1
lines changed

README.md

Lines changed: 120 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,123 @@ SPDX-License-Identifier: GPL-3.0-only
55
-->
66
# AUTOMATIC1111 Docker Image
77

8-
Docker image of AUTOMATIC1111.
8+
Docker image of
9+
[AUTOMATIC1111 Stable Diffusion Web UI.](https://github.com/AUTOMATIC1111/stable-diffusion-webui)
10+
running on Python 3.10.
11+
12+
Images are available of v1.7.0 and later.
13+
14+
To use CUDA you must have a Docker host (Docker Desktop or a server) with the appropriate hardware
15+
support in place, these links may help you get started:
16+
17+
* [Getting Started | Docker](https://www.docker.com/get-started/)
18+
* [Enable GPU support | Docker Docs](https://docs.docker.com/compose/how-tos/gpu-support/)
19+
20+
## Getting Started
21+
22+
To run AUTOMATIC1111:
23+
24+
1. Download `docker-compose.yml` to a suitable directory on your Docker host.
25+
* To build the image locally, download `docker-compose.build.yml` instead and rename it to
26+
`docker-compose.yml`. You will also need to set `A1111_VERSION` inside the file to the
27+
desired AUTOMATIC1111 version (with preceding `v`).
28+
2. Open a terminal in the chosen directory.
29+
3. Start the service by running:
30+
31+
```sh
32+
docker compose up -d
33+
```
34+
35+
4. Monitor the container's startup by running:
36+
37+
```sh
38+
docker compose logs -f
39+
```
40+
41+
5. Once `Running on local URL: http://0.0.0.0:7860` is logged by the container, AUTOMATIC1111
42+
should be accessible at http://localhost:7860/ from the Docker host.
43+
44+
## Installing Models and Other Files
45+
46+
Once AUTOMATIC1111 is running, you may want to install specific models or add other content.
47+
48+
The easiest way to do this is to install an extension to manage models with, however to do this
49+
manually copy files into the persisted `data` volume using the following command syntax:
50+
51+
```sh
52+
docker compose cp ./v1-5-pruned-emaonly.safetensors comfyui:/data/models/Stable-diffusion/
53+
```
54+
55+
The initial directory structure of `/data` after first start up is:
56+
57+
```
58+
/
59+
└── data
60+
├── cache
61+
│   ├── hashes
62+
│   └── safetensors-metadata
63+
├── extensions
64+
└── models
65+
├── Codeformer
66+
├── GFPGAN
67+
├── hypernetworks
68+
├── Lora
69+
└── Stable-diffusion
70+
```
71+
72+
Additional directories will be created as needed during use.
73+
74+
## Network Access
75+
76+
By default, AUTOMATIC1111 is only available on the docker host, to allow network access edit
77+
`docker-compose.yml` - replacing `- 127.0.0.1:7860:7860` with `- '7860:7860'` - and restart the
78+
container by running:
79+
80+
```sh
81+
docker compose up -d --force-recreate
82+
```
83+
84+
Once complete, AUTOMATIC1111 should be accessible at http://{docker host IP / FQDN}:7860/.
85+
86+
**NOTE:** If a host-based firewall is present on the Docker host, or a network firewall is between
87+
the docker host and clients, rules will need to be added to allow access.
88+
89+
## More Details
90+
91+
### Image Tags
92+
93+
There are four types of tags applied to the images:
94+
95+
| Type | Example | Referenced Version |
96+
|------|---------|--------------------|
97+
| Latest | `ghcr.io/joepitt91/automatic1111:latest` | The latest release. |
98+
| Major | `ghcr.io/joepitt91/automatic1111:1` | The latest v1.x.x release. |
99+
| Minor | `ghcr.io/joepitt91/automatic1111:1.10` | The latest v1.10.x release |
100+
| Patch | `ghcr.io/joepitt91/automatic1111:1.10.1` | Specifically v1.10.1 |
101+
102+
### Environment Variables
103+
104+
AUTOMATIC1111 can be customised using the following environment variables, these can be configured
105+
by creating a file named `a1111.env` with one variable per line in the format `VARIABLE_NAME=VALUE`,
106+
only variables being set need to be present in the file.
107+
108+
| Variable | Purpose | Example |
109+
| -------- | ------- |---------|
110+
| `API_AUTH` | Enables the API and sets up authentication credentials for it. | `app1:super_secret,app2:Sup3r_S3Cr3T` |
111+
| `CPU` | Runs all functions on the CPU (very slow). Any value will enable this. | `1` |
112+
| `CONSOLE_PROMPTS` | Enables logging of positive prompts to Docker logs. Any value will enable this | `on` |
113+
| `CORS_ORIGINS` | Sets the permitted Cross-Origin Resource Sharing (CORS) domains, comma separated. | `*.example.com,*.example.net`|
114+
| `CUSTOM_CODE` | Allows custom code to run in the web UI. Any value will enable this. | `yes` |
115+
| `LOG_LEVEL` | Sets the log level to one of: CRITICAL, ERROR, WARNING, INFO, DEBUG. Defaults to INFO. | `WARNING` |
116+
| `NO_PROMPT_HISTORY` | Disables saving and loading of the last prompt. Any value will enable this. | `True` |
117+
| `NO_WEB_UI` | If `API_AUTH` is also set, disables the web UI, exposing only the API. Any value will enable this. | `t` |
118+
| `SERVER_NAME` | Sets the server hostname. | `sd.ai.example.com` |
119+
| `UI_AUTH` | Sets user credentials for hte web UI. Same format as `API_AUTH` | `user1:super_secret,user2:Sup3r_S3Cr3T` |
120+
| `UI_AUTH_FILE` | Points to a file containing web UI credentials. The file has the same format as `API_AUTH`. Mutually exclusive with `UI_AUTH` | `/run/secrets/ui_auth` |
121+
| `XFORMERS` | Enables xformers for cross attention layers. Any value will enable this. | `y` |
122+
123+
### Volumes
124+
125+
The image uses one volume:
126+
127+
* `automatic1111` (mounted as `/data/`) for user-content such as models, uploads, output files ,etc.

docker-compose.build.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
---
2+
services:
3+
automatic1111_build:
4+
build:
5+
args:
6+
- A1111_VERSION=v1.10.1
7+
context: .
8+
deploy:
9+
resources:
10+
reservations:
11+
devices:
12+
- capabilities: [ gpu ]
13+
count: all
14+
driver: nvidia
15+
env_file:
16+
- path: a1111.env
17+
required: false
18+
ports:
19+
- '127.0.0.1:7860:7860'
20+
pull_policy: always
21+
restart: unless-stopped
22+
volumes:
23+
- automatic1111:/data
24+
volumes:
25+
automatic1111: null

docker-compose.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
---
2+
services:
3+
automatic1111:
4+
deploy:
5+
resources:
6+
reservations:
7+
devices:
8+
- capabilities: [ gpu ]
9+
count: all
10+
driver: nvidia
11+
env_file:
12+
- path: a1111.env
13+
required: false
14+
image: ghcr.io/joepitt91/automatic1111:latest
15+
ports:
16+
- '127.0.0.1:7860:7860'
17+
pull_policy: always
18+
restart: unless-stopped
19+
volumes:
20+
- automatic1111:/data
21+
volumes:
22+
automatic1111: null

0 commit comments

Comments
 (0)