Spaces:
Runtime error
Runtime error
Update Dockerfile
Browse files- Dockerfile +17 -119
Dockerfile
CHANGED
|
@@ -1,125 +1,23 @@
|
|
| 1 |
-
|
| 2 |
-
FROM nvidia/cuda:11.7.1-cudnn8-devel-ubuntu22.04
|
| 3 |
-
|
| 4 |
ENV DEBIAN_FRONTEND noninteractive
|
| 5 |
-
ENV PYTHONUNBUFFERED=1
|
| 6 |
-
ENV PIP_DISABLE_PIP_VERSION_CHECK=1
|
| 7 |
-
ENV PIP_NO_CACHE_DIR=1
|
| 8 |
-
|
| 9 |
-
# OS setup
|
| 10 |
-
RUN apt-get update -y \
|
| 11 |
-
&& apt-get upgrade -y \
|
| 12 |
-
&& apt-get install -y \
|
| 13 |
-
libgl1 \
|
| 14 |
-
libglib2.0-0 \
|
| 15 |
-
curl \
|
| 16 |
-
vim \
|
| 17 |
-
wget \
|
| 18 |
-
git \
|
| 19 |
-
git-lfs \
|
| 20 |
-
tzdata \
|
| 21 |
-
bash \
|
| 22 |
-
ca-certificates \
|
| 23 |
-
libreadline8 \
|
| 24 |
-
bzip2 \
|
| 25 |
-
psmisc \
|
| 26 |
-
procps \
|
| 27 |
-
netbase \
|
| 28 |
-
openssh-client \
|
| 29 |
-
libsqlite3-dev \
|
| 30 |
-
python3-pip \
|
| 31 |
-
python3-venv \
|
| 32 |
-
python-is-python3 \
|
| 33 |
-
build-essential \
|
| 34 |
-
libssl-dev \
|
| 35 |
-
libffi-dev \
|
| 36 |
-
aria2 \
|
| 37 |
-
\
|
| 38 |
-
&& pip3 install --upgrade pip \
|
| 39 |
-
\
|
| 40 |
-
&& git lfs install \
|
| 41 |
-
\
|
| 42 |
-
&& apt-get clean autoclean \
|
| 43 |
-
&& apt-get autoremove --yes \
|
| 44 |
-
&& rm -rf /var/lib/apt/lists/*
|
| 45 |
-
|
| 46 |
-
# OS timezone setting (UTC)
|
| 47 |
-
RUN echo "UTC" > /etc/timezone
|
| 48 |
-
ENV TZ=UTC
|
| 49 |
|
| 50 |
-
|
| 51 |
-
|
| 52 |
-
|
| 53 |
-
|
| 54 |
-
|
| 55 |
-
|
|
|
|
| 56 |
|
| 57 |
-
|
| 58 |
-
ENV ENV="/etc/profile"
|
| 59 |
-
RUN adduser --disabled-password --gecos '' user && \
|
| 60 |
-
mkdir -p /app && \
|
| 61 |
-
chown -R user:user /app && \
|
| 62 |
-
printf "\n. /etc/profile\n" >> /home/user/.profile \
|
| 63 |
-
printf "\n. /etc/profile\n" >> /home/user/.bashrc
|
| 64 |
-
|
| 65 |
-
# Sets up virtualenv for dependencies
|
| 66 |
-
ENV VIRTUAL_ENV="/opt/venv"
|
| 67 |
-
ENV VIRTUAL_ENV_DISABLE_PROMPT=1
|
| 68 |
-
ENV POETRY_ACTIVE=1
|
| 69 |
-
ENV PATH="$VIRTUAL_ENV/bin:$PATH"
|
| 70 |
-
RUN echo "export PATH=$PATH" >> /home/user/.bashrc \
|
| 71 |
-
&& python3 -m venv $VIRTUAL_ENV \
|
| 72 |
-
&& /opt/venv/bin/pip install --upgrade --no-cache-dir pip \
|
| 73 |
-
&& chown -R user:user /opt/venv
|
| 74 |
-
|
| 75 |
-
# Run as non-root user
|
| 76 |
USER user
|
| 77 |
-
WORKDIR /app
|
| 78 |
-
|
| 79 |
-
# Installation of basic Python dependencies specified in pyproject.toml
|
| 80 |
-
COPY --chown=user:user pyproject.toml poetry.lock /app/
|
| 81 |
-
RUN poetry install
|
| 82 |
-
|
| 83 |
-
# AUTOMATIC1111' WebUI
|
| 84 |
-
RUN git clone https://github.com/AUTOMATIC1111/stable-diffusion-webui /app/stable-diffusion-webui \
|
| 85 |
-
&& (cd /app/stable-diffusion-webui && git checkout a9fed7c364061ae6efb37f797b6b522cb3cf7aa2)
|
| 86 |
-
|
| 87 |
-
# Deforum extension
|
| 88 |
-
RUN git clone https://github.com/deforum-art/deforum-for-automatic1111-webui /app/stable-diffusion-webui/extensions/deforum-for-automatic1111-webui \
|
| 89 |
-
&& (cd /app/stable-diffusion-webui/extensions/deforum-for-automatic1111-webui && git checkout 2366bfdb47c226df0d14e712445414e459febad3)
|
| 90 |
-
|
| 91 |
-
# Images Browser WebUI extension
|
| 92 |
-
RUN git clone https://github.com/yfszzx/stable-diffusion-webui-images-browser /app/stable-diffusion-webui/extensions/stable-diffusion-webui-images-browser \
|
| 93 |
-
&& (cd /app/stable-diffusion-webui/extensions/stable-diffusion-webui-images-browser && git checkout a42c7a30181636a05815e62426d5eff4d3340529)
|
| 94 |
-
|
| 95 |
-
# CiviTAI Browser WebUI extension
|
| 96 |
-
RUN git clone https://github.com/Vetchems/sd-civitai-browser /app/stable-diffusion-webui/extensions/sd-civitai-browser \
|
| 97 |
-
&& (cd /app/stable-diffusion-webui/extensions/sd-civitai-browser && git checkout b25a5daf7df3f6340d3e243d533228d8ade5288d)
|
| 98 |
-
|
| 99 |
-
# Additional Networks WebUI extension
|
| 100 |
-
RUN git clone https://github.com/kohya-ss/sd-webui-additional-networks /app/stable-diffusion-webui/extensions/sd-webui-additional-networks \
|
| 101 |
-
&& (cd /app/stable-diffusion-webui/extensions/sd-webui-additional-networks && git checkout d2758b6c8e2e8e956865a87b31fd74d3d7c010cb) \
|
| 102 |
-
&& mkdir -p /app/stable-diffusion-webui/extensions/sd-webui-additional-networks/models/LoRA
|
| 103 |
-
|
| 104 |
-
# ControlNet WebUI extension
|
| 105 |
-
RUN git clone https://github.com/Mikubill/sd-webui-controlnet /app/stable-diffusion-webui/extensions/sd-webui-controlnet \
|
| 106 |
-
&& (cd /app/stable-diffusion-webui/extensions/sd-webui-controlnet && git checkout 274dd5df217a03e059e9cf052447aece81bbd1cf) \
|
| 107 |
-
&& mkdir -p /app/stable-diffusion-webui/models/ControlNet
|
| 108 |
-
|
| 109 |
-
# Prepare WebUI environment
|
| 110 |
-
WORKDIR /app/stable-diffusion-webui
|
| 111 |
-
RUN /opt/venv/bin/python launch.py --exit --skip-torch-cuda-test --xformers
|
| 112 |
-
|
| 113 |
-
# Patch WebUI
|
| 114 |
-
RUN sed -i -e 's/ show_progress=False,/ show_progress=True,/g' modules/ui.py
|
| 115 |
-
RUN sed -i -e 's/shared.demo.launch/shared.demo.queue().launch/g' webui.py
|
| 116 |
-
RUN sed -i -e 's/ outputs=\[/queue=False, &/g' modules/ui.py
|
| 117 |
-
RUN sed -i -e 's/ queue=False, / /g' modules/ui.py
|
| 118 |
-
|
| 119 |
-
# Copy startup scripts
|
| 120 |
-
COPY --chown=user:user run.py on_start.sh config.json ui-config.json shared-config.json shared-ui-config.json header_patch.py /app/stable-diffusion-webui/
|
| 121 |
-
RUN chmod +x on_start.sh
|
| 122 |
|
| 123 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 124 |
|
| 125 |
-
|
|
|
|
|
|
| 1 |
+
FROM nvidia/cuda:12.2.0-base-ubuntu22.04
|
|
|
|
|
|
|
| 2 |
ENV DEBIAN_FRONTEND noninteractive
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3 |
|
| 4 |
+
RUN apt-get update -y && \
|
| 5 |
+
apt-get install -y aria2 libgl1 libglib2.0-0 wget git git-lfs python3-pip python-is-python3 && \
|
| 6 |
+
pip install -q torchtext==0.15.2 torchdata==0.6.1 --extra-index-url https://download.pytorch.org/whl/cu118 && \
|
| 7 |
+
pip install xformers==0.0.20 triton==2.0.0 packaging==23.1 && \
|
| 8 |
+
adduser --disabled-password --gecos '' user && \
|
| 9 |
+
mkdir /content && \
|
| 10 |
+
chown -R user:user /content
|
| 11 |
|
| 12 |
+
WORKDIR /content
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 13 |
USER user
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 14 |
|
| 15 |
+
RUN git clone -b v2.6 https://github.com/camenduru/stable-diffusion-webui /content/test && \
|
| 16 |
+
git clone https://github.com/etherealxx/batchlinks-webui /content/test/extensions/batchlinks-webui && \
|
| 17 |
+
sed -i -e 's/ start()/ #start()/g' /content/test/launch.py && \
|
| 18 |
+
cd /content/test && \
|
| 19 |
+
python launch.py --skip-torch-cuda-test && \
|
| 20 |
+
git reset --hard
|
| 21 |
|
| 22 |
+
# 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
|
| 23 |
+
CMD cd /content/test && python launch.py --xformers --cors-allow-origins=* --api
|