File size: 2,948 Bytes
b2dc799
28cce76
b2dc799
 
28cce76
 
b2dc799
 
 
 
 
 
 
f16abbb
 
 
 
b2dc799
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3ad47d0
 
 
97df3ae
3cca515
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
# Dockerfile Public A10G

# https://gitlab.com/nvidia/container-images/cuda/-/blob/master/dist/12.2.0/ubuntu2204/base/Dockerfile
FROM nvidia/cuda:12.2.0-base-ubuntu22.04
ENV DEBIAN_FRONTEND noninteractive

RUN apt-get update -y && \
	apt-get install -y aria2 libgl1 libglib2.0-0 wget git git-lfs python3-pip python-is-python3 && \
	pip install -q torch==2.0.1+cu118 torchvision==0.15.2+cu118 torchaudio==2.0.2+cu118 torchtext==0.15.2 torchdata==0.6.1 --extra-index-url https://download.pytorch.org/whl/cu118 && \
	pip install xformers==0.0.20 triton==2.0.0 packaging==23.1 && \
	adduser --disabled-password --gecos '' user && \
	mkdir /content && \
	chown -R user:user /content

WORKDIR /content
USER user

RUN git clone -b v2.6 https://github.com/camenduru/stable-diffusion-webui && \
	sed -i -e 's/    start()/    #start()/g' /content/stable-diffusion-webui/launch.py && \
	cd /content/stable-diffusion-webui && \
    python launch.py --skip-torch-cuda-test && \
    git reset --hard && \
	wget https://github.com/camenduru/webui-docker/raw/main/header_patch_v2.py -O /content/header_patch_v2.py && \
    wget https://github.com/camenduru/webui-docker/raw/main/shared-config_v2.json -O /content/shared-config_v2.json && \
    wget https://github.com/camenduru/webui-docker/raw/main/shared-ui-config_v2.json -O /content/shared-ui-config_v2.json && \
	sed -i -e '/demo:/r /content/header_patch_v2.py' /content/stable-diffusion-webui/modules/ui.py && \
    sed -i -e '253,258d' /content/stable-diffusion-webui/modules/ui_settings.py && \
    sed -i -e '186,228d' /content/stable-diffusion-webui/modules/ui_settings.py && \
    sed -i -e '171,178d' /content/stable-diffusion-webui/modules/ui_settings.py && \
    sed -i -e '108,113d' /content/stable-diffusion-webui/modules/ui_settings.py && \
    sed -i -e '225,227d' /content/stable-diffusion-webui/modules/ui_loadsave.py && \
    sed -i -e '214,217d' /content/stable-diffusion-webui/modules/ui_loadsave.py && \
    rm -rfv /content/stable-diffusion-webui/scripts/ && \
	aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/ckpt/juggernaut-xl/resolve/main/juggernautXL_version2.safetensors -d /content/stable-diffusion-webui/models/Stable-diffusion -o juggernautXL_version2.safetensors && \
    aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/runwayml/stable-diffusion-v1-5/resolve/main/v1-5-pruned.ckpt -d /content/stable-diffusion-webui/models/Stable-diffusion -o v1-5-pruned.ckpt && \
    aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/hakurei/waifu-diffusion-v1-4/resolve/main/vae/kl-f8-anime2.ckpt -d /content/stable-diffusion-webui/models/Stable-diffusion -o kl-f8-anime2.ckpt

CMD cd /content/stable-diffusion-webui && python launch.py --cors-allow-origins=* --xformers --listen --theme dark --gradio-queue --ui-settings-file /content/shared-config_v2.json --ui-config-file /content/shared-ui-config_v2.json