Invoke AI v2.1 (#195)

6b89adfa7e
This commit is contained in:
AbdBarho
2022-11-04 22:35:44 +01:00
committed by GitHub
parent fb9d1e579c
commit 1cfb915d12
7 changed files with 34 additions and 12 deletions

View File

@@ -8,21 +8,22 @@ ENV DEBIAN_FRONTEND=noninteractive PIP_EXISTS_ACTION=w PIP_PREFER_BINARY=1 PIP_
# now it requires python3.9
RUN conda install python=3.9 && conda clean -a -y
RUN conda install pytorch==1.11.0 torchvision==0.12.0 cudatoolkit=11.3 -c pytorch && conda clean -a -y
RUN conda install cudatoolkit=11.6 -c conda-forge && conda clean -a -y
RUN conda install pytorch==1.12.1 -c pytorch && conda clean -a -y
RUN apt-get update && apt install fonts-dejavu-core -y && apt-get clean
RUN <<EOF
git clone https://github.com/invoke-ai/InvokeAI.git stable-diffusion
cd stable-diffusion
git reset --hard 986cc49d7a8441a70c709c04a55016a1c783f2ed
git reset --hard 6b89adfa7ebd4591ed91a76ecf152e3517cda385
git config --global http.postBuffer 1048576000
# conda env update --file environment.yml -n base
conda env update --file environment.yml -n base
conda clean -a -y
EOF
ARG BRANCH=development SHA=fdf9b1c40c243d6806e787877e42ae4c115790ee
ARG BRANCH=main SHA=6b89adfa7ebd4591ed91a76ecf152e3517cda385
RUN <<EOF
cd stable-diffusion
git fetch
@@ -33,12 +34,11 @@ conda env update --file environment.yml -n base
conda clean -a -y
EOF
RUN pip uninstall opencv-python -y && pip install --prefer-binary --force-reinstall --no-cache-dir opencv-python-headless
RUN pip uninstall opencv-python -y && pip install --force-reinstall opencv-python-headless==4.5.5.64
COPY . /docker/
RUN <<EOF
python3 /docker/info.py /stable-diffusion/frontend/dist/index.html
chmod +x /docker/mount.sh
EOF
@@ -46,5 +46,6 @@ ENV PRELOAD=false CLI_ARGS=""
WORKDIR /stable-diffusion
EXPOSE 7860
CMD /docker/mount.sh && \
python3 -u scripts/invoke.py --outdir /output --web --host 0.0.0.0 --port 7860 ${CLI_ARGS}
ENTRYPOINT ["/docker/entrypoint.sh"]
CMD python3 -u scripts/invoke.py --outdir /output --web --host 0.0.0.0 --port 7860 ${CLI_ARGS}

View File

@@ -7,9 +7,9 @@ declare -A MOUNTS
# cache
MOUNTS["/root/.cache"]=/data/.cache
# ui specific
MOUNTS["${PWD}/models/ldm/stable-diffusion-v1/model.ckpt"]=/data/StableDiffusion/model.ckpt
MOUNTS["${PWD}/src/gfpgan/experiments/pretrained_models/GFPGANv1.4.pth"]=/data/GFPGAN/GFPGANv1.4.pth
MOUNTS["${PWD}/ldm/invoke/restoration/codeformer/weights"]=/data/Codeformer
MOUNTS["${PWD}/configs/models.yaml"]=/docker/models.yaml
# hacks
MOUNTS["/opt/conda/lib/python3.9/site-packages/facexlib/weights"]=/data/.cache
MOUNTS["/opt/conda/lib/python3.9/site-packages/realesrgan/weights"]=/data/RealESRGAN
@@ -25,5 +25,7 @@ for to_path in "${!MOUNTS[@]}"; do
done
if "${PRELOAD}" == "true"; then
python3 -u scripts/preload_models.py
python3 -u scripts/preload_models.py --no-interactive
fi
exec "$@"

View File

@@ -0,0 +1,15 @@
# This file describes the alternative machine learning models
# available to InvokeAI script.
#
# To add a new model, follow the examples below. Each
# model requires a model config file, a weights file,
# and the width and height of the images it
# was trained on.
stable-diffusion-1.5:
description: The newest Stable Diffusion version 1.5 weight file (4.27 GB)
weights: /data/StableDiffusion/v1-5-pruned-emaonly.ckpt
config: ./configs/stable-diffusion/v1-inference.yaml
width: 512
height: 512
vae: /data/VAE/vae-ft-mse-840000-ema-pruned.ckpt
default: true