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
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 34 additions and 12 deletions

1
data/.gitignore vendored
View File

@ -14,4 +14,5 @@
/ScuNET
/LDSR
/Hypernetworks
/VAE
/embeddings

View File

@ -51,7 +51,7 @@ services:
<<: *base_service
profiles: ["lstein"]
build: ./services/lstein/
image: sd-lstein:4
image: sd-lstein:5
environment:
- PRELOAD=true
- CLI_ARGS=
- CLI_ARGS=--max_loaded_models=1

View File

@ -4,3 +4,4 @@ e2cd4703ab14f4d01fd1383a8a8b266f9a5833dacee8e6a79d3bf21a1b6be5ad /data/GFPGAN/G
f872d837d3c90ed2e05227bed711af5671a6fd1c9f7d7e91c911a61f155e99da /data/RealESRGAN/RealESRGAN_x4plus_anime_6B.pth
c209caecac2f97b4bb8f4d726b70ac2ac9b35904b7fc99801e1f5e61f9210c13 /data/LDSR/model.ckpt
9d6ad53c5dafeb07200fb712db14b813b527edd262bc80ea136777bdb41be2ba /data/LDSR/project.yaml
c6a580b13a5bc05a5e16e4dbb80608ff2ec251a162311590c1f34c013d7f3dab /data/VAE/vae-ft-mse-840000-ema-pruned.ckpt

View File

@ -8,6 +8,8 @@ magnet:?xt=urn:btih:2daef5b5f63a16a9af9169a529b1a773fc452637&dn=v1-5-pruned-emao
check-integrity=true
https://drive.yerf.org/wl/?id=EBfTrmcCCUAGaQBXVIj5lJmEhjoP1tgl&mode=grid&download=1
out=StableDiffusion/model.ckpt
https://huggingface.co/stabilityai/sd-vae-ft-mse-original/resolve/main/vae-ft-mse-840000-ema-pruned.ckpt
out=VAE/vae-ft-mse-840000-ema-pruned.ckpt
https://github.com/TencentARC/GFPGAN/releases/download/v1.3.4/GFPGANv1.4.pth
out=GFPGAN/GFPGANv1.4.pth
https://github.com/xinntao/Real-ESRGAN/releases/download/v0.1.0/RealESRGAN_x4plus.pth

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