-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathdocker-compose.yml
162 lines (153 loc) · 6.38 KB
/
docker-compose.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
version: '3.9'
x-gpu-base-service: &gpu_service
#runtime: nvidia
privileged: true
devices:
- /dev/nvidia0:/dev/nvidia0
- /dev/nvidiactl:/dev/nvidiactl
- /dev/nvidia-caps:/dev/nvidia-caps
- /dev/nvidia-modeset:/dev/nvidia-modeset
- /dev/nvidia-uvm:/dev/nvidia-uvm
- /dev/nvidia-uvm-tools:/dev/nvidia-uvm-tools
deploy:
resources:
reservations:
devices:
- driver: nvidia
device_ids: ['0']
capabilities: [gpu]
x-base_service: &base_service
user: "${UID:-0}:${GID:-0}"
#network_mode: "host"
ports:
- "7860:7860"
build:
context: ./services/AUTOMATIC1111
args:
# Compile time args
pyver: "3.10"
pyimage: python:3.10-slim
#
#XFORMERS_COMMAND: /bin/bash /docker/install-container-dep.sh --upgrade-strategy only-if-needed /docker/xformers-*.whl
XFORMERS_COMMAND: /bin/bash /docker/install-container-dep.sh xformers==0.0.23.post1
#
#TORCH_COMMAND: /bin/bash /docker/install-container-dep.sh /docker/tensorflow-*.whl /docker/torch-*.whl /docker/torchvision-*.whl /docker/torchaudio-*.whl
TORCH_COMMAND: /bin/bash /docker/install-container-dep.sh torch==2.1.2+cu118 torchvision==0.16.2+cu118 torchaudio==2.1.2+cu118
PYTORCH_CUDA_ALLOC_CONF: "garbage_collection_threshold:0.9,max_split_size_mb:256"
TORCH_CUDA_ARCH_LIST: 7.5+PTX
#
#TENSORFLOW_COMMAND: /bin/bash /docker/install-container-dep.sh /docker/tensorflow-*.whl
TENSORFLOW_COMMAND: /bin/bash /docker/install-container-dep.sh tensorflow[and-cuda]==2.15.0.post1
#
# General configuration
PIP_REPOSITORY: "https://download.pytorch.org/whl/cu118"
#
TRITON_VERSION: "2.1.0"
#
DEEPSPEED: False
DEEPSPEED_VERSION: "0.12.6"
# https://www.tensorflow.org/install/pip#software_requirements
# https://developer.nvidia.com/tensorrt-download
CUDNN_VERSION: "8.6.0.163"
CUDA_VERSION: cuda-11-8
#CUDA_DRIVERS: cuda-drivers
CUDA_KEYRING: https://developer.download.nvidia.com/compute/cuda/repos/debian11/x86_64/cuda-keyring_1.1-1_all.deb
#
DS_BUILD_OPS: 1
NVCC_FLAGS: --use_fast_math
JAX: False
TPU: False
#
# History time args
stableDiffusionV1_SHA: "21f890f9da3cfbeaba8e2ac3c425ee9e998d5229" # https://github.com/P2Enjoy/stable-diffusion.git
stableDiffusionV2_SHA: "cf1d67a6fd5ea1aa600c4df58e5b47da45f6bdbf" # https://github.com/P2Enjoy/stable-diffusion-v2.git
stableDiffusionXL_SHA: "9d759324e914de6c96dbd1468b3a4a50243c6528" # https://github.com/P2Enjoy/stable-diffusion-xl.git
codeFormer_SHA: "c5b4593074ba6214284d6acd5f1719b6c5d739af" # https://github.com/P2Enjoy/CodeFormer.git
BLIP_SHA: "3a29b7410476bf5f2ba0955827390eb6ea1f4f9d" # https://github.com/P2Enjoy/BLIP.git
latentDiffusion_SHA: "abf33e7002d59d9085081bce93ec798dcabd49af" # https://github.com/P2Enjoy/latent-diffusion.git
tamingTransformers_SHA: "24268930bf1dce879235a7fddd0b2355b84d7ea6" # https://github.com/P2Enjoy/taming-transformers.git
kDiffusion_SHA: "cc49cf6182284e577e896943f8e29c7c9d1a7f2c" # https://github.com/P2Enjoy/k-diffusion.git
clip_interrogator_SHA: "bc07ce62c179d3aab3053a623d96a071101d11cb" # https://github.com/P2Enjoy/clip-interrogator.git
MiDas_SHA: "1645b7e1675301fdfac03640738fe5a6531e17d6" # https://github.com/P2Enjoy/MiDaS.git
GFPGAN_SHA: "2eac2033893ca7f427f4035d80fe95b92649ac56" # https://github.com/P2Enjoy/GFPGAN.git
CLIP_SHA: "a1d071733d7111c9c014f024669f959182114e33" # https://github.com/P2Enjoy/CLIP.git
open_clip_SHA: "73ad04ae7fb93ede1c02dc9040a828634cb1edf1" # https://github.com/P2Enjoy/open_clip.git
AUTO1111_SHA: "5ef669de080814067961f28357256e8fe27544f4" # https://github.com/P2Enjoy/stable-diffusion-webui.git
volumes:
- &v1 ./data:/data
- &v2 ./output:/output
- &v3 ./data/config/auto/extensions:/stable-diffusion-webui/extensions
- &v4 /tmp/.X11-unix:/tmp/.X11-unix
deploy:
restart_policy:
delay: 5s
max_attempts: 10
window: 120s
name: webui-docker
services:
download:
build: ./services/download/
profiles: ["download"]
volumes:
- *v1
xformers:
<<: *gpu_service
build: ./services/xformers/
profiles: ["xformers"]
volumes:
- ./services/xformers/data:/deploy
environment:
- TORCH_CUDA_ARCH_LIST=7.5+PTX
- NVCC_FLAGS=--use_fast_math
tensorflow:
<<: *gpu_service
build: ./services/tensorflow/
profiles: ["tensorflow"]
environment:
- LIBNVINFER_VERSION=7.2.2
- LIBNVINFER_MAJOR_VERSION=7
- LIBNVINFER_CUDA_VERSION=11.1
- CUDNN_VERSION=8.1.1.33
- CUDNN_MAJOR_VERSION=8
- CUDNN_CUDA_VERSION=11.2
- CUDA_NVRTC=cuda-nvrtc-11-1
- CUDA_NVRTC_DEV=cuda-nvrtc-dev-11-1
- CUDA_NVRTC_VERSION=11.1.105-1
- COMPUTE=7.5
- MAX_GCC_VERSION=9
- GIT_BRANCH=v2.11.0
volumes:
- ./services/tensorflow/data:/deploy
auto: &automatic
<<: [*base_service, *gpu_service]
profiles: ["auto"]
environment:
- ACCELERATE=False
- TF_ENABLE_ONEDNN_OPTS=1
- USE_MEMORY_EFFICIENT_ATTENTION=0
- DISPLAY=unix$DISPLAY
- CLI_ARGS=--medvram --medvram-sdxl --opt-sdp-attention --xformers --opt-sub-quad-attention --opt-split-attention
- RUN_ARGS=/stable-diffusion-webui/webui.py --listen --enable-insecure-extension-access --port 7860 --allow-code --api
- RUNNER=/docker/run.sh
auto_debug:
<<: *automatic
profiles: ["auto_debug"]
stdin_open: true
tty: true
environment:
- ACCELERATE=False
- TF_ENABLE_ONEDNN_OPTS=1
- USE_MEMORY_EFFICIENT_ATTENTION=0
- DISPLAY=unix$DISPLAY
- NO_TCMALLOC="True"
- NVIDIA_VISIBLE_DEVICES=all
- NVIDIA_DRIVER_CAPABILITIES=compute,utility
- CLI_ARGS=--always-batch-cond-uncond --opt-sdp-attention --xformers --opt-sub-quad-attention --opt-split-attention
- RUN_ARGS=/stable-diffusion-webui/webui.py --listen --enable-insecure-extension-access --port 7860 --allow-code --api
- DEBUG=/docker/run.sh $$RUN_ARGS --ckpt-dir $${ROOT}/models/Stable-diffusion $$CLI_ARGS
- RUNNER=/docker/debug.sh
auto-cpu:
<<: *base_service
profiles: ["auto-cpu"]
environment:
- CLI_ARGS=--no-half --precision full