Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ services:
<<: *base_service
profiles: ["invoke"]
build: ./services/invoke/
image: sd-invoke:30
image: sd-invoke:31
environment:
- PRELOAD=true
- CLI_ARGS=--xformers
Expand Down
23 changes: 8 additions & 15 deletions services/invoke/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ RUN apk add --no-cache aria2
RUN aria2c -x 5 --dir / --out wheel.whl 'https://github.com/AbdBarho/stable-diffusion-webui-docker/releases/download/6.0.0/xformers-0.0.21.dev544-cp310-cp310-manylinux2014_x86_64-pytorch201.whl'


# TODO: next version is going to support pytorch/pytorch:2.1.0-cuda12.1-cudnn8-runtime
FROM pytorch/pytorch:2.0.1-cuda11.7-cudnn8-runtime

ENV DEBIAN_FRONTEND=noninteractive PIP_EXISTS_ACTION=w PIP_PREFER_BINARY=1
Expand All @@ -17,26 +18,19 @@ RUN --mount=type=cache,target=/var/cache/apt \
ln -sf opencv4.pc opencv.pc


WORKDIR /
ENV ROOT=/InvokeAI
RUN git clone https://github.com/invoke-ai/InvokeAI.git ${ROOT}
WORKDIR ${ROOT}
RUN git clone --depth 1 https://github.com/invoke-ai/InvokeAI.git ${ROOT}

WORKDIR ${ROOT}
RUN --mount=type=cache,target=/root/.cache/pip \
git reset --hard f3b2e02921927d9317255b1c3811f47bd40a2bf9 && \
# dont fetch entire repo, it is HUGE!
git fetch origin dedead672f2e9f995b6b96d7ada37456dab15b55 --depth=1 && \
git reset --hard dedead672f2e9f995b6b96d7ada37456dab15b55 && \
pip install -e .


ARG BRANCH=main SHA=f3b2e02921927d9317255b1c3811f47bd40a2bf9
RUN --mount=type=cache,target=/root/.cache/pip \
git fetch && \
git reset --hard && \
git checkout ${BRANCH} && \
git reset --hard ${SHA} && \
pip install -U -e .

RUN --mount=type=cache,target=/root/.cache/pip \
--mount=type=bind,from=xformers,source=/wheel.whl,target=/xformers-0.0.21-cp310-cp310-linux_x86_64.whl \
pip install -U opencv-python-headless triton /xformers-0.0.21-cp310-cp310-linux_x86_64.whl && \
pip install -U opencv-python-headless xformers==0.0.22 && \
python3 -c "from patchmatch import patch_match"


Expand All @@ -50,4 +44,3 @@ ENTRYPOINT ["/docker/entrypoint.sh"]
CMD invokeai --web --host 0.0.0.0 --port 7860 --root_dir ${ROOT} --config ${CONFIG_DIR}/models.yaml \
--outdir /output/invoke --embedding_directory /data/embeddings/ --lora_directory /data/models/Lora \
--no-nsfw_checker --no-safety_checker ${CLI_ARGS}

6 changes: 6 additions & 0 deletions services/invoke/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,9 @@ if "${PRELOAD}" == "true"; then
fi

exec "$@"

# TODO: We still need to adapt our code to the new structure, it seems that our current folder structure is not
# supported anymore by invoke, they have their own nested folder hierarchy with different models and different kinds
# separate v1 and v2, upscalers, etc...
# it is likely the case the we would need to have a separate folder for invoke stuff, merging it with our `data` might
# be uselessly complicated.