Spaces:
Runtime error
Runtime error
Update Dockerfile
Browse files- Dockerfile +45 -44
Dockerfile
CHANGED
@@ -1,49 +1,50 @@
|
|
|
|
|
|
|
|
|
|
1 |
FROM nvidia/cuda:12.1.0-cudnn8-devel-ubuntu22.04
|
|
|
2 |
|
3 |
-
ENV DEBIAN_FRONTEND=noninteractive \
|
4 |
-
TZ=America/Los_Angeles
|
5 |
-
|
6 |
-
ARG USE_PERSISTENT_DATA
|
7 |
-
|
8 |
-
RUN apt-get update && apt-get install -y \
|
9 |
-
git libgl1 libglib2.0-0 \
|
10 |
-
make build-essential libssl-dev zlib1g-dev \
|
11 |
-
libbz2-dev libreadline-dev libsqlite3-dev wget curl llvm \
|
12 |
-
libncursesw5-dev xz-utils tk-dev libxml2-dev libxmlsec1-dev libffi-dev liblzma-dev git git-lfs \
|
13 |
-
ffmpeg libsm6 libxext6 cmake libgl1-mesa-glx \
|
14 |
-
&& rm -rf /var/lib/apt/lists/* \
|
15 |
-
&& git lfs install \
|
16 |
-
apt-get install nvidia-container-runtime
|
17 |
-
|
18 |
WORKDIR /content
|
19 |
|
20 |
-
|
21 |
-
RUN
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
22 |
USER user
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
RUN curl https://pyenv.run | bash
|
28 |
-
ENV PATH=$HOME/.pyenv/shims:$HOME/.pyenv/bin:$PATH
|
29 |
-
|
30 |
-
ARG PYTHON_VERSION=3.10.12
|
31 |
-
# Python
|
32 |
-
RUN pyenv install $PYTHON_VERSION && \
|
33 |
-
pyenv global $PYTHON_VERSION && \
|
34 |
-
pyenv rehash && \
|
35 |
-
pip install --no-cache-dir --upgrade pip setuptools wheel && \
|
36 |
-
pip install --no-cache-dir \
|
37 |
-
datasets \
|
38 |
-
huggingface-hub "protobuf<4" "click<8.1"
|
39 |
-
|
40 |
-
RUN git clone https://github.com/AUTOMATIC1111/stable-diffusion-webui /content/test && \
|
41 |
-
git clone https://github.com/etherealxx/batchlinks-webui /content/test/extensions/batchlinks-webui && \
|
42 |
-
sed -i -e 's/ start()/ #start()/g' /content/test/launch.py && \
|
43 |
-
cd /content/test && \
|
44 |
-
python launch.py --skip-torch-cuda-test && \
|
45 |
-
git reset --hard
|
46 |
-
|
47 |
-
RUN aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/ckpt/sd15/resolve/main/v1-5-pruned-emaonly.ckpt -d /content/test/models/Stable-diffusion -o v1-5-pruned-emaonly.ckpt
|
48 |
-
|
49 |
-
CMD cd /content/test && python launch.py --xformers --cors-allow-origins=* --api
|
|
|
1 |
+
|
2 |
+
# Dockerfile Public Nightly A10G
|
3 |
+
|
4 |
+
# https://gitlab.com/nvidia/container-images/cuda/-/blob/master/dist/11.7.1/ubuntu2204/devel/cudnn8/Dockerfile
|
5 |
FROM nvidia/cuda:12.1.0-cudnn8-devel-ubuntu22.04
|
6 |
+
ENV DEBIAN_FRONTEND noninteractive
|
7 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
8 |
WORKDIR /content
|
9 |
|
10 |
+
RUN apt-get update -y && apt-get upgrade -y && apt-get install -y libgl1 libglib2.0-0 wget git git-lfs python3-pip python-is-python3 && pip3 install --upgrade pip
|
11 |
+
RUN pip install xformers==0.0.27
|
12 |
+
RUN pip install --pre triton
|
13 |
+
RUN pip install numexpr
|
14 |
+
|
15 |
+
RUN git clone https://github.com/AUTOMATIC1111/stable-diffusion-webui
|
16 |
+
RUN sed -i -e '''/prepare_environment()/a\ os.system\(f\"""sed -i -e ''\"s/dict()))/dict())).cuda()/g\"'' /content/stable-diffusion-webui/repositories/stable-diffusion-stability-ai/ldm/util.py""")''' /content/stable-diffusion-webui/launch.py
|
17 |
+
RUN sed -i -e 's/ start()/ #start()/g' /content/stable-diffusion-webui/launch.py
|
18 |
+
RUN cd stable-diffusion-webui && python launch.py --skip-torch-cuda-test
|
19 |
+
|
20 |
+
ADD https://github.com/camenduru/webui-docker/raw/main/env_patch.py /content/env_patch.py
|
21 |
+
RUN sed -i -e '/import image_from_url_text/r /content/env_patch.py' /content/stable-diffusion-webui/modules/ui.py
|
22 |
+
ADD https://github.com/camenduru/webui-docker/raw/main/header_patch.py /content/header_patch.py
|
23 |
+
RUN sed -i -e '/demo:/r /content/header_patch.py' /content/stable-diffusion-webui/modules/ui.py
|
24 |
+
|
25 |
+
RUN sed -i -e '/(modelmerger_interface, \"Checkpoint Merger\", \"modelmerger\"),/d' /content/stable-diffusion-webui/modules/ui.py
|
26 |
+
RUN sed -i -e '/(train_interface, \"Train\", \"ti\"),/d' /content/stable-diffusion-webui/modules/ui.py
|
27 |
+
RUN sed -i -e '/extensions_interface, \"Extensions\", \"extensions\"/d' /content/stable-diffusion-webui/modules/ui.py
|
28 |
+
RUN sed -i -e '/settings_interface, \"Settings\", \"settings\"/d' /content/stable-diffusion-webui/modules/ui.py
|
29 |
+
RUN sed -i -e "s/document.getElementsByTagName('gradio-app')\[0\].shadowRoot/!!document.getElementsByTagName('gradio-app')[0].shadowRoot ? document.getElementsByTagName('gradio-app')[0].shadowRoot : document/g" /content/stable-diffusion-webui/script.js
|
30 |
+
RUN sed -i -e 's/ show_progress=False,/ show_progress=True,/g' /content/stable-diffusion-webui/modules/ui.py
|
31 |
+
RUN sed -i -e 's/default_enabled=False/default_enabled=True/g' /content/stable-diffusion-webui/webui.py
|
32 |
+
RUN sed -i -e 's/ outputs=\[/queue=False, &/g' /content/stable-diffusion-webui/modules/ui.py
|
33 |
+
RUN sed -i -e 's/ queue=False, / /g' /content/stable-diffusion-webui/modules/ui.py
|
34 |
+
|
35 |
+
RUN rm -rfv /content/stable-diffusion-webui/scripts/
|
36 |
+
|
37 |
+
ADD https://github.com/camenduru/webui-docker/raw/main/shared-config.json /content/shared-config.json
|
38 |
+
ADD https://github.com/camenduru/webui-docker/raw/main/shared-ui-config.json /content/shared-ui-config.json
|
39 |
+
|
40 |
+
ADD https://huggingface.co/andite/anything-v4.0/resolve/main/anything-v4.5-pruned.ckpt /content/stable-diffusion-webui/models/Stable-diffusion/anything-v4.5-pruned.ckpt
|
41 |
+
ADD https://huggingface.co/andite/anything-v4.0/resolve/main/anything-v4.0.vae.pt /content/stable-diffusion-webui/models/Stable-diffusion/anything-v4.5-pruned.vae.pt
|
42 |
+
|
43 |
+
RUN adduser --disabled-password --gecos '' user
|
44 |
+
RUN chown -R user:user /content
|
45 |
+
RUN chmod -R 777 /content
|
46 |
USER user
|
47 |
+
|
48 |
+
EXPOSE 7860
|
49 |
+
|
50 |
+
CMD cd /content/stable-diffusion-webui && python webui.py --xformers --listen --disable-console-progressbars --enable-console-prompts --no-progressbar-hiding --ui-config-file /content/shared-ui-config.json --ui-settings-file /content/shared-config.json
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|