Skip to content

Commit 1cfb915

Browse files
authored
1 parent fb9d1e5 commit 1cfb915

File tree

7 files changed

+34
-12
lines changed

7 files changed

+34
-12
lines changed

data/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,5 @@
1414
/ScuNET
1515
/LDSR
1616
/Hypernetworks
17+
/VAE
1718
/embeddings

docker-compose.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ services:
5151
<<: *base_service
5252
profiles: ["lstein"]
5353
build: ./services/lstein/
54-
image: sd-lstein:4
54+
image: sd-lstein:5
5555
environment:
5656
- PRELOAD=true
57-
- CLI_ARGS=
57+
- CLI_ARGS=--max_loaded_models=1

services/download/checksums.sha256

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,4 @@ e2cd4703ab14f4d01fd1383a8a8b266f9a5833dacee8e6a79d3bf21a1b6be5ad /data/GFPGAN/G
44
f872d837d3c90ed2e05227bed711af5671a6fd1c9f7d7e91c911a61f155e99da /data/RealESRGAN/RealESRGAN_x4plus_anime_6B.pth
55
c209caecac2f97b4bb8f4d726b70ac2ac9b35904b7fc99801e1f5e61f9210c13 /data/LDSR/model.ckpt
66
9d6ad53c5dafeb07200fb712db14b813b527edd262bc80ea136777bdb41be2ba /data/LDSR/project.yaml
7+
c6a580b13a5bc05a5e16e4dbb80608ff2ec251a162311590c1f34c013d7f3dab /data/VAE/vae-ft-mse-840000-ema-pruned.ckpt

services/download/links.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ magnet:?xt=urn:btih:2daef5b5f63a16a9af9169a529b1a773fc452637&dn=v1-5-pruned-emao
88
check-integrity=true
99
https://drive.yerf.org/wl/?id=EBfTrmcCCUAGaQBXVIj5lJmEhjoP1tgl&mode=grid&download=1
1010
out=StableDiffusion/model.ckpt
11+
https://huggingface.co/stabilityai/sd-vae-ft-mse-original/resolve/main/vae-ft-mse-840000-ema-pruned.ckpt
12+
out=VAE/vae-ft-mse-840000-ema-pruned.ckpt
1113
https://github.com/TencentARC/GFPGAN/releases/download/v1.3.4/GFPGANv1.4.pth
1214
out=GFPGAN/GFPGANv1.4.pth
1315
https://github.com/xinntao/Real-ESRGAN/releases/download/v0.1.0/RealESRGAN_x4plus.pth

services/lstein/Dockerfile

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,21 +8,22 @@ ENV DEBIAN_FRONTEND=noninteractive PIP_EXISTS_ACTION=w PIP_PREFER_BINARY=1 PIP_
88

99
# now it requires python3.9
1010
RUN conda install python=3.9 && conda clean -a -y
11-
RUN conda install pytorch==1.11.0 torchvision==0.12.0 cudatoolkit=11.3 -c pytorch && conda clean -a -y
11+
RUN conda install cudatoolkit=11.6 -c conda-forge && conda clean -a -y
12+
RUN conda install pytorch==1.12.1 -c pytorch && conda clean -a -y
1213

1314
RUN apt-get update && apt install fonts-dejavu-core -y && apt-get clean
1415

1516
RUN <<EOF
1617
git clone https://github.com/invoke-ai/InvokeAI.git stable-diffusion
1718
cd stable-diffusion
18-
git reset --hard 986cc49d7a8441a70c709c04a55016a1c783f2ed
19+
git reset --hard 6b89adfa7ebd4591ed91a76ecf152e3517cda385
1920
git config --global http.postBuffer 1048576000
20-
# conda env update --file environment.yml -n base
21+
conda env update --file environment.yml -n base
2122
conda clean -a -y
2223
EOF
2324

2425

25-
ARG BRANCH=development SHA=fdf9b1c40c243d6806e787877e42ae4c115790ee
26+
ARG BRANCH=main SHA=6b89adfa7ebd4591ed91a76ecf152e3517cda385
2627
RUN <<EOF
2728
cd stable-diffusion
2829
git fetch
@@ -33,18 +34,18 @@ conda env update --file environment.yml -n base
3334
conda clean -a -y
3435
EOF
3536

36-
RUN pip uninstall opencv-python -y && pip install --prefer-binary --force-reinstall --no-cache-dir opencv-python-headless
37+
RUN pip uninstall opencv-python -y && pip install --force-reinstall opencv-python-headless==4.5.5.64
3738

3839
COPY . /docker/
3940
RUN <<EOF
4041
python3 /docker/info.py /stable-diffusion/frontend/dist/index.html
41-
chmod +x /docker/mount.sh
4242
EOF
4343

4444

4545
ENV PRELOAD=false CLI_ARGS=""
4646
WORKDIR /stable-diffusion
4747
EXPOSE 7860
4848

49-
CMD /docker/mount.sh && \
50-
python3 -u scripts/invoke.py --outdir /output --web --host 0.0.0.0 --port 7860 ${CLI_ARGS}
49+
50+
ENTRYPOINT ["/docker/entrypoint.sh"]
51+
CMD python3 -u scripts/invoke.py --outdir /output --web --host 0.0.0.0 --port 7860 ${CLI_ARGS}
Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ declare -A MOUNTS
77
# cache
88
MOUNTS["/root/.cache"]=/data/.cache
99
# ui specific
10-
MOUNTS["${PWD}/models/ldm/stable-diffusion-v1/model.ckpt"]=/data/StableDiffusion/model.ckpt
1110
MOUNTS["${PWD}/src/gfpgan/experiments/pretrained_models/GFPGANv1.4.pth"]=/data/GFPGAN/GFPGANv1.4.pth
1211
MOUNTS["${PWD}/ldm/invoke/restoration/codeformer/weights"]=/data/Codeformer
12+
MOUNTS["${PWD}/configs/models.yaml"]=/docker/models.yaml
1313
# hacks
1414
MOUNTS["/opt/conda/lib/python3.9/site-packages/facexlib/weights"]=/data/.cache
1515
MOUNTS["/opt/conda/lib/python3.9/site-packages/realesrgan/weights"]=/data/RealESRGAN
@@ -25,5 +25,7 @@ for to_path in "${!MOUNTS[@]}"; do
2525
done
2626

2727
if "${PRELOAD}" == "true"; then
28-
python3 -u scripts/preload_models.py
28+
python3 -u scripts/preload_models.py --no-interactive
2929
fi
30+
31+
exec "$@"

services/lstein/models.yaml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# This file describes the alternative machine learning models
2+
# available to InvokeAI script.
3+
#
4+
# To add a new model, follow the examples below. Each
5+
# model requires a model config file, a weights file,
6+
# and the width and height of the images it
7+
# was trained on.
8+
stable-diffusion-1.5:
9+
description: The newest Stable Diffusion version 1.5 weight file (4.27 GB)
10+
weights: /data/StableDiffusion/v1-5-pruned-emaonly.ckpt
11+
config: ./configs/stable-diffusion/v1-inference.yaml
12+
width: 512
13+
height: 512
14+
vae: /data/VAE/vae-ft-mse-840000-ema-pruned.ckpt
15+
default: true

0 commit comments

Comments
 (0)