@@ -11,53 +11,48 @@ ENV DEBIAN_FRONTEND=noninteractive PIP_EXISTS_ACTION=w PIP_PREFER_BINARY=1
11
11
12
12
RUN --mount=type=cache,target=/root/.cache/pip pip install torch==1.13.1+cu117 torchvision --extra-index-url https://download.pytorch.org/whl/cu117
13
13
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
-
27
14
28
15
# patch match:
29
16
# https://github.com/invoke-ai/InvokeAI/blob/main/docs/installation/INSTALL_PATCHMATCH.md
30
- RUN \
17
+ RUN --mount=type=cache,target=/var/cache/apt \
31
18
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 && \
34
20
apt-get clean && \
35
21
cd /usr/lib/x86_64-linux-gnu/pkgconfig/ && \
36
22
ln -sf opencv4.pc opencv.pc
37
23
38
24
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
40
36
RUN --mount=type=cache,target=/root/.cache/pip \
41
37
git fetch && \
42
38
git reset --hard && \
43
39
git checkout ${BRANCH} && \
44
40
git reset --hard ${SHA} && \
45
- pip install .
46
-
41
+ pip install -U .
47
42
48
43
RUN --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 && \
51
46
python3 -c "from patchmatch import patch_match"
52
47
53
48
54
- RUN touch invokeai.init
55
49
COPY . /docker/
56
50
57
51
ENV NVIDIA_DRIVER_CAPABILITIES=compute,utility
58
52
ENV 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= ""
60
54
EXPOSE 7860
61
55
62
56
ENTRYPOINT ["/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