Commit 9a29a1a3 authored by nanahira's avatar nanahira

sort dockerfile

parent bde6cdb4
Pipeline #40410 failed with stages
in 27 minutes and 49 seconds
......@@ -12,68 +12,43 @@ RUN pip install --no-cache-dir torch==2.1.2 torchvision==0.16.2 --extra-index-ur
RUN mkdir /home/sd/stable-diffusion-webui
WORKDIR /home/sd/stable-diffusion-webui
RUN mkdir repositories && \
git clone --depth=1 https://github.com/Stability-AI/stablediffusion.git repositories/stable-diffusion-stability-ai && \
cd repositories/stable-diffusion-stability-ai && git fetch origin cf1d67a6fd5ea1aa600c4df58e5b47da45f6bdbf && git checkout cf1d67a6fd5ea1aa600c4df58e5b47da45f6bdbf && \
python3 setup.py install --user && \
cd ../.. && \
RUN set -eux && \
clone_commit() { \
repo_url="$1"; subdir="$2"; commit="$3"; \
dest="repositories/$subdir"; \
if [ -d "$dest/.git" ]; then \
echo "Repo exists, skip: $dest"; \
else \
git clone --depth=1 "$repo_url" "$dest" && \
cd "$dest" && \
git fetch origin "$commit" && \
git checkout "$commit" && \
cd ../..; \
fi; \
} && \
\
clone_commit https://github.com/Stability-AI/stablediffusion.git stable-diffusion-stability-ai cf1d67a6fd5ea1aa600c4df58e5b47da45f6bdbf && \
clone_commit https://github.com/Stability-AI/generative-models.git generative-models 45c443b316737a4ab6e40413d7794a7f5657c19f && \
clone_commit https://github.com/CompVis/taming-transformers.git taming-transformers 24268930bf1dce879235a7fddd0b2355b84d7ea6 && \
clone_commit https://github.com/sczhou/CodeFormer.git CodeFormer c5b4593074ba6214284d6acd5f1719b6c5d739af && \
clone_commit https://github.com/salesforce/BLIP.git BLIP 48211a1594f1321b00f14c9f7a5b4813144b2fb9 && \
clone_commit https://github.com/crowsonkb/k-diffusion.git k-diffusion ab527a9a6d347f364e3d185ba6d714e22d80cb3c && \
clone_commit https://github.com/Hafiidz/latent-diffusion.git latent-diffusion abf33e7002d59d9085081bce93ec798dcabd49af
COPY --chown=sd ./requirements.txt ./requirements.txt
git clone --depth=1 https://github.com/Stability-AI/generative-models.git repositories/generative-models && \
cd repositories/generative-models && git fetch origin 45c443b316737a4ab6e40413d7794a7f5657c19f && git checkout 45c443b316737a4ab6e40413d7794a7f5657c19f && \
cd ../.. && \
git clone --depth=1 https://github.com/CompVis/taming-transformers.git repositories/taming-transformers && \
cd repositories/taming-transformers && git fetch origin 24268930bf1dce879235a7fddd0b2355b84d7ea6 && git checkout 24268930bf1dce879235a7fddd0b2355b84d7ea6 && \
cd ../.. && \
git clone --depth=1 https://github.com/sczhou/CodeFormer.git repositories/CodeFormer && \
cd repositories/CodeFormer && git fetch origin c5b4593074ba6214284d6acd5f1719b6c5d739af && git checkout c5b4593074ba6214284d6acd5f1719b6c5d739af && \
cd ../.. && \
git clone --depth=1 https://github.com/salesforce/BLIP.git repositories/BLIP && \
cd repositories/BLIP && git fetch origin 48211a1594f1321b00f14c9f7a5b4813144b2fb9 && git checkout 48211a1594f1321b00f14c9f7a5b4813144b2fb9 && \
cd ../.. && \
git clone --depth=1 https://github.com/crowsonkb/k-diffusion.git repositories/k-diffusion && \
cd repositories/k-diffusion && git fetch origin ab527a9a6d347f364e3d185ba6d714e22d80cb3c && git checkout ab527a9a6d347f364e3d185ba6d714e22d80cb3c && \
cd ../.. && \
git clone --depth=1 https://github.com/Hafiidz/latent-diffusion repositories/latent-diffusion && \
pip install -r repositories/latent-diffusion/requirements.txt --prefer-binary && \
# update numpy to latest version
pip install --no-cache-dir -U numpy --prefer-binary && \
pip install --no-cache-dir \
# install requirements of Stable Diffusion
transformers==4.30.2 diffusers invisible-watermark triton \
# install k-diffusion
git+https://github.com/crowsonkb/k-diffusion.git \
# (optional) install GFPGAN (face restoration)
git+https://github.com/TencentARC/GFPGAN.git@8d2447a2d918f8eba5a4a01463fd48e45126a379 \
# install CLIP
git+https://github.com/openai/CLIP.git@d50d76daa670286dd6cacf3bcd80b5e4823fc8e1 \
# install open_clip
git+https://github.com/mlfoundations/open_clip.git@bb6e834e9c70d9c27d0dc3ecedeebeaeb1ffad6b \
# install xformers
# git+https://github.com/facebookresearch/xformers.git@v0.0.20#egg=xformers \
# install deepdanbooru
git+https://github.com/KichangKim/DeepDanbooru.git@05eb3c39b0fae43e3caf39df801615fe79b27c2f#egg=deepdanbooru[tensorflow] tensorflow tensorflow-io \
# end install requirements
--prefer-binary && \
RUN pip install --no-cache-dir \
# requirements for the project
-r requirements.txt \
# (optional) install requirements for CodeFormer (face restoration)
-r repositories/CodeFormer/requirements.txt \
# requirements of latent-diffusion
-r repositories/latent-diffusion/requirements.txt \
# end of pip install
--prefer-binary
# (optional) install requirements for CodeFormer (face restoration)
pip install --no-cache-dir -r repositories/CodeFormer/requirements.txt --prefer-binary
COPY --chown=sd . ./
# Plugins
#RUN mkdir extensions && cd extensions && \
......@@ -81,10 +56,6 @@ RUN mkdir repositories && \
# jq -r '.extensions[].url' | \
# xargs -I '{}' -P 10 git clone --depth=1 '{}'
COPY --chown=sd ./requirements.txt ./requirements.txt
RUN pip install --no-cache-dir -r requirements.txt --prefer-binary
COPY --chown=sd . ./
ENV LD_PRELOAD libtcmalloc.so
ENTRYPOINT ["python3", "webui.py"]
CMD ["--listen", "--port", "8080"]
......@@ -8,7 +8,6 @@ einops==0.4.1
facexlib==0.3.0
fastapi==0.94.0
pydantic==1.10.8
gfpgan
gradio==3.41.2
inflection==0.5.1
jsonmerge==1.8.0
......@@ -22,20 +21,44 @@ piexif==1.1.3
protobuf==3.20.0
psutil==5.9.5
pytorch_lightning==1.9.4
realesrgan
requests
realesrgan==0.3.0
requests==2.31.0
resize-right==0.0.2
safetensors==0.4.2
scikit-image==0.21.0
tomesd==0.1.3
torch
# torch
torchdiffeq==0.2.3
torchsde==0.2.6
transformers==4.30.2
pillow-avif-plugin==1.4.3
# 额外补充(在 versions 里有,但原 requirements.txt 里没有)
httpcore==0.15
spandrel==0.3.4
spandrel-extra-arches==0.1.1
# deps in versions.txt not mentioned
httpcore==0.17.2
httpx==0.24.1
# deps mentioned in Dockerfile
diffusers==0.16.1
invisible-watermark==0.1.5
triton==2.0.0
tensorflow==2.9.0
tensorflow-io==0.32.0
# install k-diffusion
git+https://github.com/crowsonkb/k-diffusion.git
# (optional) install GFPGAN (face restoration)
git+https://github.com/TencentARC/GFPGAN.git@8d2447a2d918f8eba5a4a01463fd48e45126a379
# install CLIP
git+https://github.com/openai/CLIP.git@d50d76daa670286dd6cacf3bcd80b5e4823fc8e1
# install open_clip
git+https://github.com/mlfoundations/open_clip.git@bb6e834e9c70d9c27d0dc3ecedeebeaeb1ffad6b
# install xformers
# git+https://github.com/facebookresearch/xformers.git@v0.0.20#egg=xformers
# install deepdanbooru
git+https://github.com/KichangKim/DeepDanbooru.git@05eb3c39b0fae43e3caf39df801615fe79b27c2f#egg=deepdanbooru[tensorflow]
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment