Commit b2891e88 authored by nanahira's avatar nanahira

dockerfile

parent dd028891
Pipeline #17691 failed with stages
in 10 seconds
.git*
Dockerfile
.dockerignore
/test
/.github
/*.sh
/*.bat
/launch.py
/*.png
stages:
- build
- deploy
variables:
GIT_DEPTH: "1"
before_script:
- docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
.build-image:
stage: build
script:
- docker build --pull -t $TARGET_IMAGE .
- docker push $TARGET_IMAGE
build-x86:
extends: .build-image
tags:
- docker
variables:
TARGET_IMAGE: $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG
.deploy:
stage: deploy
tags:
- docker
script:
- docker pull $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG
- docker tag $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG $TARGET_IMAGE
- docker manifest push $TARGET_IMAGE
deploy_latest:
extends: .deploy
variables:
TARGET_IMAGE: $CI_REGISTRY_IMAGE:latest
only:
- master
FROM nvidia/cuda:11.7.1-base-ubuntu22.04
RUN apt update \
&& apt-key adv --fetch-keys \
&& apt install --no-install-recommends -y build-essential wget git curl unzip python3 python3-pip libgl1 libglib2.0-0 \
&& apt clean && rm -rf /var/lib/apt/lists/* /var/tmp/* /tmp/* /var/log/*
RUN useradd -ms /bin/bash sd
USER sd
RUN pip install torch==1.12.1+cu113 torchvision==0.13.1+cu113 --extra-index-url https://download.pytorch.org/whl/cu113
WORKDIR /home/sd/stable-diffusion-webui
RUN mkdir repositories && \
git clone https://github.com/CompVis/stable-diffusion.git repositories/stable-diffusion && \
cd repositories/stable-diffusion && git checkout 69ae4b35e0a0f6ee1af8bb9a5d0016ccb27e36dc && \
python3 setup.py install --user && \
cd ../.. && \
git clone https://github.com/CompVis/taming-transformers.git repositories/taming-transformers && \
cd repositories/taming-transformers && git checkout 24268930bf1dce879235a7fddd0b2355b84d7ea6 &&
cd ../.. && \
git clone https://github.com/sczhou/CodeFormer.git repositories/CodeFormer && \
cd repositories/CodeFormer && git checkout c5b4593074ba6214284d6acd5f1719b6c5d739af && \
cd ../.. && \
git clone https://github.com/salesforce/BLIP.git repositories/BLIP && \
cd repositories/BLIP && git checkout 48211a1594f1321b00f14c9f7a5b4813144b2fb9 && \
cd ../.. && \
git clone https://github.com/crowsonkb/k-diffusion.git repositories/k-diffusion && \
cd repositories/k-diffusion && git checkout f4e99857772fc3a126ba886aadf795a332774878 && \
cd ../.. && \
git clone https://github.com/Hafiidz/latent-diffusion repositories/latent-diffusion && \
pip install -r repositories/latent-diffusion/requirements.txt --prefer-binary && \
cd ../.. && \
# install requirements of Stable Diffusion
pip install transformers==4.19.2 diffusers invisible-watermark --prefer-binary && \
# install k-diffusion
pip install git+https://github.com/crowsonkb/k-diffusion.git --prefer-binary && \
# (optional) install GFPGAN (face restoration)
pip install git+https://github.com/TencentARC/GFPGAN.git@8d2447a2d918f8eba5a4a01463fd48e45126a379 --prefer-binary && \
# (optional) install requirements for CodeFormer (face restoration)
pip install -r repositories/CodeFormer/requirements.txt --prefer-binary && \
# update numpy to latest version
pip install -U numpy --prefer-binary && \
pip install git+https://github.com/openai/CLIP.git@d50d76daa670286dd6cacf3bcd80b5e4823fc8e1 --prefer-binary
COPY --chown=sd ./requirements.txt ./requirements.txt
RUN pip install -r requirements.txt --prefer-binary
COPY . ./
RUN git clone --depth=1 https://github.com/AUTOMATIC1111/stable-diffusion-webui-aesthetic-gradients extensions/aesthetic-gradients && \
git clone --depth=1 https://github.com/yfszzx/stable-diffusion-webui-images-browser extensions/images-browser
ENTRYPOINT ["python3", "webui.py"]
CMD ["--listen", "--port", "8080"]
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