Commit 7189aa9a authored by nanahira's avatar nanahira

add xformers build

parent 65186593
Pipeline #17734 failed
.git*
Dockerfile
Dockerfile*
.dockerignore
/test
......
stages:
- build
- build2
- deploy
variables:
GIT_DEPTH: "1"
......@@ -9,17 +10,39 @@ before_script:
.build-image:
stage: build
tags:
- docker
script:
- docker build --pull -t $TARGET_IMAGE .
- docker push $TARGET_IMAGE
build-x86:
build-base:
extends: .build-image
tags:
- docker
variables:
TARGET_IMAGE: $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG
.build-xformers:
extends: .build-image
stage: build2
script:
- docker build --pull --build-arg BASE=$CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG --build-arg=GRAPHIC_VERSION=$GRAPHIC_VERSION -f Dockerfile.xformers -t $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG-xformers-$GRAPHIC_VERSION .
- docker push $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG-xformers-$GRAPHIC_VERSION
build-xformers-7.5:
extends: .build-xformers
variables:
GRAPHIC_VERSION: 7.5
build-xformers-8.6:
extends: .build-xformers
variables:
GRAPHIC_VERSION: 8.6
build-xformers-6.1:
extends: .build-xformers
variables:
GRAPHIC_VERSION: 6.1
.deploy:
stage: deploy
tags:
......@@ -27,7 +50,7 @@ build-x86:
script:
- docker pull $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG
- docker tag $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG $TARGET_IMAGE
- docker push $TARGET_IMAGE
- docker push $TARGET_IMAGE
deploy_latest:
extends: .deploy
......@@ -35,3 +58,29 @@ deploy_latest:
TARGET_IMAGE: $CI_REGISTRY_IMAGE:latest
only:
- master
.deploy-xformers:
extends: .deploy
variables:
TARGET_IMAGE: $CI_REGISTRY_IMAGE:latest
only:
- master
script:
- docker pull $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG-xformers-$GRAPHIC_VERSION
- docker tag $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG-xformers-$GRAPHIC_VERSION $CI_REGISTRY_IMAGE:xformers-$GRAPHIC_VERSION
- docker push $CI_REGISTRY_IMAGE:xformers-$GRAPHIC_VERSION
deploy-xformers-7.5:
extends: .deploy-xformers
variables:
GRAPHIC_VERSION: 7.5
deploy-xformers-8.6:
extends: .deploy-xformers
variables:
GRAPHIC_VERSION: 8.6
deploy-xformers-6.1:
extends: .deploy-xformers
variables:
GRAPHIC_VERSION: 6.1
......@@ -8,7 +8,7 @@ RUN apt update \
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
RUN pip install --no-cache-dir torch==1.12.1+cu113 torchvision==0.13.1+cu113 --extra-index-url https://download.pytorch.org/whl/cu113
RUN mkdir /home/sd/stable-diffusion-webui
WORKDIR /home/sd/stable-diffusion-webui
......@@ -39,9 +39,9 @@ RUN mkdir repositories && \
pip install -r repositories/latent-diffusion/requirements.txt --prefer-binary && \
# update numpy to latest version
pip install -U numpy --prefer-binary && \
pip install --no-cache-dir -U numpy --prefer-binary && \
pip install \
pip install --no-cache-dir \
# install requirements of Stable Diffusion
transformers==4.19.2 diffusers invisible-watermark triton \
......@@ -56,7 +56,7 @@ RUN mkdir repositories && \
git+https://github.com/openai/CLIP.git@d50d76daa670286dd6cacf3bcd80b5e4823fc8e1 \
# install xformers
git+https://github.com/facebookresearch/xformers.git@v0.0.13#egg=xformers \
# git+https://github.com/facebookresearch/xformers.git@v0.0.13#egg=xformers \
# install deepdanbooru
git+https://github.com/KichangKim/DeepDanbooru.git@d91a2963bf87c6a770d74894667e9ffa9f6de7ff#egg=deepdanbooru[tensorflow] tensorflow==2.10.0 tensorflow-io==0.27.0 \
......@@ -68,7 +68,7 @@ RUN mkdir repositories && \
pip install -r repositories/CodeFormer/requirements.txt --prefer-binary
COPY --chown=sd ./requirements.txt ./requirements.txt
RUN pip install -r requirements.txt --prefer-binary
RUN pip install --no-cache-dir -r requirements.txt --prefer-binary
COPY --chown=sd . ./
# Plugins
......
ARG BASE
FROM ${BASE}
ARG GRAPHIC_VERSION
RUN env FORCE_CUDA=1 CUDA_VISIBLE_DEVICES=0 TORCH_CUDA_ARCH_LIST=${GRAPHIC_VERSION} \
pip install --no-cache-dir git+https://github.com/facebookresearch/xformers.git@v0.0.13#egg=xformers
CMD ["--listen", "--port", "8080", "--xformers"]
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