@@ -11,53 +11,48 @@ ENV DEBIAN_FRONTEND=noninteractive PIP_EXISTS_ACTION=w PIP_PREFER_BINARY=1
1111
1212RUN --mount=type=cache,target=/root/.cache/pip pip install torch==1.13.1+cu117 torchvision --extra-index-url https://download.pytorch.org/whl/cu117
1313
14- RUN apt-get update && apt-get install git -y && apt-get clean
15-
16- RUN git clone https://github.com/invoke-ai/InvokeAI.git /stable-diffusion
17-
18- WORKDIR /stable-diffusion
19-
20- RUN --mount=type=cache,target=/root/.cache/pip \
21- git reset --hard f232068ab89bd80e4f5f3133dcdb62ea78f1d0f7 && \
22- git config --global http.postBuffer 1048576000 && \
23- egrep -v '^-e .' environments-and-requirements/requirements-lin-cuda.txt > req.txt && \
24- pip install -r req.txt && \
25- rm req.txt
26-
2714
2815# patch match:
2916# https://github.com/invoke-ai/InvokeAI/blob/main/docs/installation/INSTALL_PATCHMATCH.md
30- RUN \
17+ RUN --mount=type=cache,target=/var/cache/apt \
3118 apt-get update && \
32- # apt-get install build-essential python3-opencv libopencv-dev -y && \
33- apt-get install make g++ libopencv-dev -y && \
19+ apt-get install make g++ git libopencv-dev -y && \
3420 apt-get clean && \
3521 cd /usr/lib/x86_64-linux-gnu/pkgconfig/ && \
3622 ln -sf opencv4.pc opencv.pc
3723
3824
39- ARG BRANCH=main SHA=6e0c6d9cc9f6bdbdefc4b9e94bc1ccde1b04aa42
25+
26+ ENV ROOT=/InvokeAI
27+ RUN git clone https://github.com/invoke-ai/InvokeAI.git ${ROOT}
28+ WORKDIR ${ROOT}
29+
30+ RUN --mount=type=cache,target=/root/.cache/pip \
31+ git reset --hard 4463124bddd221c333d4c70e73aa2949ad35453d && \
32+ pip install .
33+
34+
35+ ARG BRANCH=main SHA=50eb02f68be912276a9c106d5e8038a5671a0386
4036RUN --mount=type=cache,target=/root/.cache/pip \
4137 git fetch && \
4238 git reset --hard && \
4339 git checkout ${BRANCH} && \
4440 git reset --hard ${SHA} && \
45- pip install .
46-
41+ pip install -U .
4742
4843RUN --mount=type=cache,target=/root/.cache/pip \
49- --mount=type=bind,from=xformers,source=/wheel.whl,target=/xformers-0.0.15 -cp310-cp310-linux_x86_64.whl \
50- pip install -U opencv-python-headless huggingface_hub triton /xformers-0.0.15 -cp310-cp310-linux_x86_64.whl && \
44+ --mount=type=bind,from=xformers,source=/wheel.whl,target=/xformers-0.0.17 -cp310-cp310-linux_x86_64.whl \
45+ pip install -U opencv-python-headless triton /xformers-0.0.17 -cp310-cp310-linux_x86_64.whl && \
5146 python3 -c "from patchmatch import patch_match"
5247
5348
54- RUN touch invokeai.init
5549COPY . /docker/
5650
5751ENV NVIDIA_DRIVER_CAPABILITIES=compute,utility
5852ENV NVIDIA_VISIBLE_DEVICES=all
59- ENV PYTHONUNBUFFERED=1 ROOT=/stable-diffusion PYTHONPATH= "${PYTHONPATH}:${ROOT}" PRELOAD=false CLI_ARGS= "" HF_HOME=/root/.cache/huggingface
53+ ENV PYTHONUNBUFFERED=1 PRELOAD=false HF_HOME=/root/.cache/huggingface CONFIG_DIR=/data/config/invoke CLI_ARGS= ""
6054EXPOSE 7860
6155
6256ENTRYPOINT ["/docker/entrypoint.sh" ]
63- CMD invokeai --web --host 0.0.0.0 --port 7860 --config /docker/models.yaml --root_dir ${ROOT} --outdir /output/invoke ${CLI_ARGS}
57+ CMD invokeai --web --host 0.0.0.0 --port 7860 --root_dir ${ROOT} --config ${CONFIG_DIR}/models.yaml --outdir /output/invoke ${CLI_ARGS}
58+ # TODO: make sure the config is persisted between sessions
0 commit comments