This commit is contained in:
AbdBarho 2023-04-10 11:41:31 +02:00
parent a76aeba4f4
commit b8c9e46091
2 changed files with 7 additions and 10 deletions

View file

@ -32,7 +32,7 @@ RUN --mount=type=cache,target=/root/.cache/pip \
pip install .
ARG BRANCH=main SHA=4463124bddd221c333d4c70e73aa2949ad35453d
ARG BRANCH=main SHA=f05095770c0b41fefc85f486a60b8df4f86de354
RUN --mount=type=cache,target=/root/.cache/pip \
git fetch && \
git reset --hard && \
@ -40,7 +40,6 @@ RUN --mount=type=cache,target=/root/.cache/pip \
git reset --hard ${SHA} && \
pip install -U .
RUN --mount=type=cache,target=/root/.cache/pip \
--mount=type=bind,from=xformers,source=/wheel.whl,target=/xformers-0.0.17-cp310-cp310-linux_x86_64.whl \
pip install -U opencv-python-headless triton /xformers-0.0.17-cp310-cp310-linux_x86_64.whl && \
@ -51,9 +50,9 @@ COPY . /docker/
ENV NVIDIA_DRIVER_CAPABILITIES=compute,utility
ENV NVIDIA_VISIBLE_DEVICES=all
ENV PYTHONUNBUFFERED=1 PYTHONPATH="${PYTHONPATH}:${ROOT}" PRELOAD=false HF_HOME=/root/.cache/huggingface CLI_ARGS=""
ENV PYTHONUNBUFFERED=1 PRELOAD=false HF_HOME=/root/.cache/huggingface CONFIG_DIR=/data/config/invoke CLI_ARGS=""
EXPOSE 7860
ENTRYPOINT ["/docker/entrypoint.sh"]
CMD invokeai --web --host 0.0.0.0 --port 7860 --root_dir ${ROOT} --outdir /output/invoke ${CLI_ARGS}
CMD invokeai --web --host 0.0.0.0 --port 7860 --root_dir ${ROOT} --config ${CONFIG_DIR}/models.yaml --outdir /output/invoke ${CLI_ARGS}
# TODO: make sure the config is persisted between sessions

View file

@ -4,10 +4,12 @@ set -Eeuo pipefail
declare -A MOUNTS
mkdir -p ${CONFIG_DIR}
# cache
MOUNTS["/root/.cache"]=/data/.cache/
# this is really a hack to avoid migrations
# this is really just a hack to avoid migrations
rm -rf ${HF_HOME}/diffusers
# ui specific
@ -16,9 +18,6 @@ MOUNTS["${ROOT}/models/gfpgan/GFPGANv1.4.pth"]=/data/GFPGAN/GFPGANv1.4.pth
MOUNTS["${ROOT}/models/gfpgan/weights"]=/data/GFPGAN/
MOUNTS["${ROOT}/models/realesrgan"]=/data/RealESRGAN/
MOUNTS["${ROOT}/models/bert-base-uncased"]=/data/.cache/huggingface/transformers/
MOUNTS["${ROOT}/models/openai/clip-vit-large-patch14"]=/data/.cache/huggingface/transformers/
MOUNTS["${ROOT}/models/CompVis/stable-diffusion-safety-checker"]=/data/.cache/huggingface/transformers/
MOUNTS["${ROOT}/models/ldm"]=/data/.cache/invoke/ldm/
MOUNTS["${ROOT}/embeddings"]=/data/embeddings/
@ -42,8 +41,7 @@ done
if "${PRELOAD}" == "true"; then
set -Eeuo pipefail
invokeai-configure --root ${ROOT} --yes
cp ${ROOT}/configs/models.yaml ${CONFIG_DIR}/models.yaml
fi
sed -i 's|chunksize=4096|chunksize=16777216|' ${ROOT}/invokeai/backend/model_management/model_manager.py
exec "$@"