Spaces:
Runtime error
Runtime error
Update Dockerfile
Browse files- Dockerfile +14 -24
Dockerfile
CHANGED
@@ -1,4 +1,4 @@
|
|
1 |
-
# Dockerfile Public
|
2 |
|
3 |
# https://gitlab.com/nvidia/container-images/cuda/-/blob/master/dist/11.7.1/ubuntu2204/devel/cudnn8/Dockerfile
|
4 |
# FROM nvidia/cuda:11.7.1-cudnn8-devel-ubuntu22.04
|
@@ -13,35 +13,24 @@ RUN mkdir /content && chown -R user:user /content
|
|
13 |
WORKDIR /content
|
14 |
USER user
|
15 |
|
16 |
-
RUN pip install "fastapi[all]"
|
17 |
-
RUN pip install Pillow
|
18 |
-
|
19 |
-
# Add Hugging Face cache setup
|
20 |
-
ENV HF_HOME=/content/huggingface
|
21 |
-
ENV TRANSFORMERS_CACHE=$HF_HOME
|
22 |
-
RUN mkdir -p $HF_HOME
|
23 |
-
|
24 |
-
# Install transformers and download tokenizer
|
25 |
RUN pip3 install --upgrade pip
|
26 |
-
RUN pip install transformers==4.26.1
|
27 |
-
RUN python -c "from transformers import CLIPTokenizer; CLIPTokenizer.from_pretrained('openai/clip-vit-large-patch14')"
|
28 |
-
|
29 |
RUN pip install torchmetrics==0.11.4
|
30 |
-
RUN pip install https://github.com/camenduru/stable-diffusion-webui-colab/releases/download/0.0.16/xformers-0.0.16+814314d.
|
31 |
RUN pip install --pre triton
|
32 |
RUN pip install numexpr
|
|
|
33 |
|
34 |
-
|
35 |
-
RUN
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
|
42 |
ADD --chown=user https://github.com/camenduru/webui-docker/raw/main/env_patch.py /content/env_patch.py
|
43 |
RUN sed -i -e '/import image_from_url_text/r /content/env_patch.py' /content/stable-diffusion-webui/modules/ui.py
|
44 |
-
ADD --chown=user https://raw.githubusercontent.com/darkstorm2150/webui/main/
|
45 |
RUN sed -i -e '/demo:/r /content/header_patch.py' /content/stable-diffusion-webui/modules/ui.py
|
46 |
|
47 |
RUN sed -i -e '/(modelmerger_interface, \"Checkpoint Merger\", \"modelmerger\"),/d' /content/stable-diffusion-webui/modules/ui.py
|
@@ -57,10 +46,11 @@ RUN sed -i -e 's/ queue=False, / /g' /content/stab
|
|
57 |
RUN rm -rfv /content/stable-diffusion-webui/scripts/
|
58 |
|
59 |
ADD --chown=user https://github.com/camenduru/webui-docker/raw/main/shared-config.json /content/shared-config.json
|
60 |
-
ADD --chown=user https://
|
|
|
61 |
|
62 |
ADD --chown=user https://huggingface.co/darkstorm2150/OpenGen/resolve/main/OpenGen%20v1.0.safetensors /content/stable-diffusion-webui/models/Stable-diffusion/OpenGen%20v1.0.safetensors
|
63 |
|
64 |
EXPOSE 7860
|
65 |
|
66 |
-
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
|
|
|
1 |
+
# Dockerfile Public T4
|
2 |
|
3 |
# https://gitlab.com/nvidia/container-images/cuda/-/blob/master/dist/11.7.1/ubuntu2204/devel/cudnn8/Dockerfile
|
4 |
# FROM nvidia/cuda:11.7.1-cudnn8-devel-ubuntu22.04
|
|
|
13 |
WORKDIR /content
|
14 |
USER user
|
15 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
16 |
RUN pip3 install --upgrade pip
|
|
|
|
|
|
|
17 |
RUN pip install torchmetrics==0.11.4
|
18 |
+
RUN pip install https://github.com/camenduru/stable-diffusion-webui-colab/releases/download/0.0.16/xformers-0.0.16+814314d.d20230118-cp310-cp310-linux_x86_64.whl
|
19 |
RUN pip install --pre triton
|
20 |
RUN pip install numexpr
|
21 |
+
RUN pip install httpx==0.24.1
|
22 |
|
23 |
+
RUN git clone -b v1.6 https://github.com/camenduru/stable-diffusion-webui
|
24 |
+
RUN pip install pip==23.3.1 # Downgrade pip to fix metadata issue
|
25 |
+
RUN pip install pytorch_lightning==1.7.6
|
26 |
+
RUN sed -i '$a fastapi==0.90.0' /content/stable-diffusion-webui/requirements_versions.txt
|
27 |
+
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
|
28 |
+
RUN sed -i -e 's/ start()/ #start()/g' /content/stable-diffusion-webui/launch.py
|
29 |
+
RUN cd stable-diffusion-webui && python launch.py --skip-torch-cuda-test
|
30 |
|
31 |
ADD --chown=user https://github.com/camenduru/webui-docker/raw/main/env_patch.py /content/env_patch.py
|
32 |
RUN sed -i -e '/import image_from_url_text/r /content/env_patch.py' /content/stable-diffusion-webui/modules/ui.py
|
33 |
+
ADD --chown=user https://raw.githubusercontent.com/darkstorm2150/webui/main/header_patch.py /content/header_patch.py
|
34 |
RUN sed -i -e '/demo:/r /content/header_patch.py' /content/stable-diffusion-webui/modules/ui.py
|
35 |
|
36 |
RUN sed -i -e '/(modelmerger_interface, \"Checkpoint Merger\", \"modelmerger\"),/d' /content/stable-diffusion-webui/modules/ui.py
|
|
|
46 |
RUN rm -rfv /content/stable-diffusion-webui/scripts/
|
47 |
|
48 |
ADD --chown=user https://github.com/camenduru/webui-docker/raw/main/shared-config.json /content/shared-config.json
|
49 |
+
ADD --chown=user https://github.com/camenduru/webui-docker/raw/main/shared-ui-config.json /content/shared-ui-config.json
|
50 |
+
|
51 |
|
52 |
ADD --chown=user https://huggingface.co/darkstorm2150/OpenGen/resolve/main/OpenGen%20v1.0.safetensors /content/stable-diffusion-webui/models/Stable-diffusion/OpenGen%20v1.0.safetensors
|
53 |
|
54 |
EXPOSE 7860
|
55 |
|
56 |
+
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
|