parent
660c098da0
commit
cdde93b8bb
28
.devscripts/migratev7tov8.sh
Normal file
28
.devscripts/migratev7tov8.sh
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
set -Eeuo pipefail
|
||||||
|
|
||||||
|
echo "Renaming..."
|
||||||
|
|
||||||
|
# compatible with default auto-names
|
||||||
|
mv -v ./data/StableDiffusion ./data/Stable-diffusion
|
||||||
|
mv -v ./data/Deepdanbooru ./data/torch_deepdanbooru
|
||||||
|
|
||||||
|
# casing problem on windows
|
||||||
|
mv -v ./data/Hypernetworks ./data/hypernetworks1
|
||||||
|
mv -v ./data/hypernetworks1 ./data/hypernetworks
|
||||||
|
|
||||||
|
mv -v ./data/MiDaS ./data/midas1
|
||||||
|
mv -v ./data/midas1 ./data/midas
|
||||||
|
|
||||||
|
|
||||||
|
echo "Moving folders..."
|
||||||
|
|
||||||
|
mkdir -pv ./final
|
||||||
|
|
||||||
|
mv -v ./data/config ./final/config
|
||||||
|
mv -v ./data/.cache ./final/.cache
|
||||||
|
mv -v ./data/embeddings ./final/embeddings
|
||||||
|
mv -v ./data ./final/models
|
||||||
|
|
||||||
|
mv -v ./final ./data
|
26
data/.gitignore
vendored
26
data/.gitignore
vendored
@ -1,28 +1,4 @@
|
|||||||
# for all of the stuff downloaded by transformers, pytorch, and others
|
|
||||||
/.cache
|
/.cache
|
||||||
# for UIs
|
|
||||||
/config
|
/config
|
||||||
# for all stable diffusion models (main, waifu diffusion, etc..)
|
|
||||||
/StableDiffusion
|
|
||||||
# others
|
|
||||||
/Codeformer
|
|
||||||
/GFPGAN
|
|
||||||
/ESRGAN
|
|
||||||
/BSRGAN
|
|
||||||
/RealESRGAN
|
|
||||||
/SwinIR
|
|
||||||
/MiDaS
|
|
||||||
/BLIP
|
|
||||||
/ScuNET
|
|
||||||
/LDSR
|
|
||||||
/Deepdanbooru
|
|
||||||
/Hypernetworks
|
|
||||||
/VAE
|
|
||||||
/embeddings
|
/embeddings
|
||||||
/Lora
|
/models
|
||||||
/ControlNet
|
|
||||||
/openpose
|
|
||||||
/ModelScope
|
|
||||||
/LyCORIS
|
|
||||||
/GLIGEN
|
|
||||||
/CLIPEncoder
|
|
||||||
|
@ -6,7 +6,8 @@ x-base_service: &base_service
|
|||||||
volumes:
|
volumes:
|
||||||
- &v1 ./data:/data
|
- &v1 ./data:/data
|
||||||
- &v2 ./output:/output
|
- &v2 ./output:/output
|
||||||
stop_signal: SIGINT
|
stop_signal: SIGKILL
|
||||||
|
tty: true
|
||||||
deploy:
|
deploy:
|
||||||
resources:
|
resources:
|
||||||
reservations:
|
reservations:
|
||||||
@ -28,7 +29,7 @@ services:
|
|||||||
<<: *base_service
|
<<: *base_service
|
||||||
profiles: ["auto"]
|
profiles: ["auto"]
|
||||||
build: ./services/AUTOMATIC1111
|
build: ./services/AUTOMATIC1111
|
||||||
image: sd-auto:58
|
image: sd-auto:59
|
||||||
environment:
|
environment:
|
||||||
- CLI_ARGS=--allow-code --medvram --xformers --enable-insecure-extension-access --api
|
- CLI_ARGS=--allow-code --medvram --xformers --enable-insecure-extension-access --api
|
||||||
|
|
||||||
@ -43,7 +44,7 @@ services:
|
|||||||
<<: *base_service
|
<<: *base_service
|
||||||
profiles: ["invoke"]
|
profiles: ["invoke"]
|
||||||
build: ./services/invoke/
|
build: ./services/invoke/
|
||||||
image: sd-invoke:29
|
image: sd-invoke:30
|
||||||
environment:
|
environment:
|
||||||
- PRELOAD=true
|
- PRELOAD=true
|
||||||
- CLI_ARGS=--xformers
|
- CLI_ARGS=--xformers
|
||||||
@ -59,8 +60,7 @@ services:
|
|||||||
<<: *base_service
|
<<: *base_service
|
||||||
profiles: ["comfy"]
|
profiles: ["comfy"]
|
||||||
build: ./services/comfy/
|
build: ./services/comfy/
|
||||||
image: sd-comfy:2
|
image: sd-comfy:3
|
||||||
tty: true
|
|
||||||
environment:
|
environment:
|
||||||
- CLI_ARGS=
|
- CLI_ARGS=
|
||||||
|
|
||||||
|
@ -19,30 +19,14 @@ if [ ! -f /data/config/auto/styles.csv ]; then
|
|||||||
touch /data/config/auto/styles.csv
|
touch /data/config/auto/styles.csv
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# copy models from original models folder
|
||||||
|
rsync -a --info=NAME ${ROOT}/models/VAE-approx/ /data/models/VAE-approx/
|
||||||
|
rsync -a --info=NAME ${ROOT}/models/karlo/ /data/models/karlo/
|
||||||
|
|
||||||
declare -A MOUNTS
|
declare -A MOUNTS
|
||||||
|
|
||||||
MOUNTS["/root/.cache"]="/data/.cache"
|
MOUNTS["/root/.cache"]="/data/.cache"
|
||||||
|
MOUNTS["${ROOT}/models"]="/data/models"
|
||||||
# main
|
|
||||||
MOUNTS["${ROOT}/models/Stable-diffusion"]="/data/StableDiffusion"
|
|
||||||
MOUNTS["${ROOT}/models/VAE"]="/data/VAE"
|
|
||||||
MOUNTS["${ROOT}/models/Codeformer"]="/data/Codeformer"
|
|
||||||
MOUNTS["${ROOT}/models/GFPGAN"]="/data/GFPGAN"
|
|
||||||
MOUNTS["${ROOT}/models/ESRGAN"]="/data/ESRGAN"
|
|
||||||
MOUNTS["${ROOT}/models/BSRGAN"]="/data/BSRGAN"
|
|
||||||
MOUNTS["${ROOT}/models/RealESRGAN"]="/data/RealESRGAN"
|
|
||||||
MOUNTS["${ROOT}/models/SwinIR"]="/data/SwinIR"
|
|
||||||
MOUNTS["${ROOT}/models/ScuNET"]="/data/ScuNET"
|
|
||||||
MOUNTS["${ROOT}/models/LDSR"]="/data/LDSR"
|
|
||||||
MOUNTS["${ROOT}/models/hypernetworks"]="/data/Hypernetworks"
|
|
||||||
MOUNTS["${ROOT}/models/torch_deepdanbooru"]="/data/Deepdanbooru"
|
|
||||||
MOUNTS["${ROOT}/models/BLIP"]="/data/BLIP"
|
|
||||||
MOUNTS["${ROOT}/models/midas"]="/data/MiDaS"
|
|
||||||
MOUNTS["${ROOT}/models/Lora"]="/data/Lora"
|
|
||||||
MOUNTS["${ROOT}/models/LyCORIS"]="/data/LyCORIS"
|
|
||||||
MOUNTS["${ROOT}/models/ControlNet"]="/data/ControlNet"
|
|
||||||
MOUNTS["${ROOT}/models/openpose"]="/data/openpose"
|
|
||||||
MOUNTS["${ROOT}/models/ModelScope"]="/data/ModelScope"
|
|
||||||
|
|
||||||
MOUNTS["${ROOT}/embeddings"]="/data/embeddings"
|
MOUNTS["${ROOT}/embeddings"]="/data/embeddings"
|
||||||
MOUNTS["${ROOT}/config.json"]="/data/config/auto/config.json"
|
MOUNTS["${ROOT}/config.json"]="/data/config/auto/config.json"
|
||||||
@ -66,8 +50,21 @@ for to_path in "${!MOUNTS[@]}"; do
|
|||||||
echo Mounted $(basename "${from_path}")
|
echo Mounted $(basename "${from_path}")
|
||||||
done
|
done
|
||||||
|
|
||||||
|
echo "Installing extension dependencies (if any)"
|
||||||
|
|
||||||
|
# because we build our container as root:
|
||||||
|
chown -R root ~/.cache/
|
||||||
|
chmod 766 ~/.cache/
|
||||||
|
|
||||||
|
shopt -s nullglob
|
||||||
|
list=(./extensions/*/requirements.txt)
|
||||||
|
for req in "${list[@]}"; do
|
||||||
|
pip install -r "$req"
|
||||||
|
done
|
||||||
|
|
||||||
if [ -f "/data/config/auto/startup.sh" ]; then
|
if [ -f "/data/config/auto/startup.sh" ]; then
|
||||||
pushd ${ROOT}
|
pushd ${ROOT}
|
||||||
|
echo "Running startup script"
|
||||||
. /data/config/auto/startup.sh
|
. /data/config/auto/startup.sh
|
||||||
popd
|
popd
|
||||||
fi
|
fi
|
||||||
|
@ -1,14 +1,11 @@
|
|||||||
FROM alpine:3.17 as xformers
|
FROM alpine:3.17 as xformers
|
||||||
RUN apk add --no-cache aria2
|
RUN apk add --no-cache aria2
|
||||||
RUN aria2c -x 5 --dir / --out wheel.whl 'https://github.com/AbdBarho/stable-diffusion-webui-docker/releases/download/5.0.0/xformers-0.0.17.dev449-cp310-cp310-manylinux2014_x86_64.whl'
|
RUN aria2c -x 5 --dir / --out wheel.whl 'https://github.com/AbdBarho/stable-diffusion-webui-docker/releases/download/6.0.0/xformers-0.0.21.dev544-cp310-cp310-manylinux2014_x86_64-pytorch201.whl'
|
||||||
|
|
||||||
|
FROM pytorch/pytorch:2.0.1-cuda11.7-cudnn8-runtime
|
||||||
FROM python:3.10.9-slim
|
|
||||||
|
|
||||||
ENV DEBIAN_FRONTEND=noninteractive PIP_PREFER_BINARY=1
|
ENV DEBIAN_FRONTEND=noninteractive PIP_PREFER_BINARY=1
|
||||||
|
|
||||||
RUN --mount=type=cache,target=/root/.cache/pip pip install torch==1.13.1 torchvision --extra-index-url https://download.pytorch.org/whl/cu117
|
|
||||||
|
|
||||||
RUN apt-get update && apt-get install -y git && apt-get clean
|
RUN apt-get update && apt-get install -y git && apt-get clean
|
||||||
|
|
||||||
ENV ROOT=/stable-diffusion
|
ENV ROOT=/stable-diffusion
|
||||||
@ -21,13 +18,13 @@ RUN --mount=type=cache,target=/root/.cache/pip \
|
|||||||
|
|
||||||
|
|
||||||
RUN --mount=type=cache,target=/root/.cache/pip \
|
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 \
|
--mount=type=bind,from=xformers,source=/wheel.whl,target=/xformers-0.0.21-cp310-cp310-linux_x86_64.whl \
|
||||||
pip install triton /xformers-0.0.17-cp310-cp310-linux_x86_64.whl
|
pip install /xformers-0.0.21-cp310-cp310-linux_x86_64.whl
|
||||||
|
|
||||||
|
|
||||||
WORKDIR ${ROOT}
|
WORKDIR ${ROOT}
|
||||||
|
|
||||||
ARG BRANCH=master SHA=884ea653c8d6fe19b3724f45a04a0d74cd881f2f
|
ARG BRANCH=master SHA=8607c2d42d10b0108de02528e813cc703e58813f
|
||||||
RUN --mount=type=cache,target=/root/.cache/pip \
|
RUN --mount=type=cache,target=/root/.cache/pip \
|
||||||
git fetch && \
|
git fetch && \
|
||||||
git checkout ${BRANCH} && \
|
git checkout ${BRANCH} && \
|
||||||
|
@ -1,20 +1,20 @@
|
|||||||
a111:
|
a111:
|
||||||
base_path: /data
|
base_path: /data
|
||||||
|
|
||||||
checkpoints: StableDiffusion
|
checkpoints: models/Stable-diffusion
|
||||||
configs: StableDiffusion
|
configs: models/Stable-diffusion
|
||||||
vae: VAE
|
vae: models/VAE
|
||||||
loras: Lora
|
loras: models/Lora
|
||||||
upscale_models: |
|
upscale_models: |
|
||||||
RealESRGAN
|
models/RealESRGAN
|
||||||
ESRGAN
|
models/ESRGAN
|
||||||
SwinIR
|
models/SwinIR
|
||||||
GFPGAN
|
models/GFPGAN
|
||||||
|
hypernetworks: models/hypernetworks
|
||||||
|
controlnet: models/ControlNet
|
||||||
|
gligen: models/GLIGEN
|
||||||
|
clip: models/CLIPEncoder
|
||||||
embeddings: embeddings
|
embeddings: embeddings
|
||||||
hypernetworks: Hypernetworks
|
|
||||||
controlnet: ControlNet
|
|
||||||
gligen: GLIGEN
|
|
||||||
clip: CLIPEncoder
|
|
||||||
|
|
||||||
custom_nodes: config/comfy/custom_nodes
|
custom_nodes: config/comfy/custom_nodes
|
||||||
|
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
cc6cb27103417325ff94f52b7a5d2dde45a7515b25c255d8e396c90014281516 /data/StableDiffusion/v1-5-pruned-emaonly.ckpt
|
cc6cb27103417325ff94f52b7a5d2dde45a7515b25c255d8e396c90014281516 /data/models/Stable-diffusion/v1-5-pruned-emaonly.ckpt
|
||||||
c6bbc15e3224e6973459ba78de4998b80b50112b0ae5b5c67113d56b4e366b19 /data/StableDiffusion/sd-v1-5-inpainting.ckpt
|
c6bbc15e3224e6973459ba78de4998b80b50112b0ae5b5c67113d56b4e366b19 /data/models/Stable-diffusion/sd-v1-5-inpainting.ckpt
|
||||||
c6a580b13a5bc05a5e16e4dbb80608ff2ec251a162311590c1f34c013d7f3dab /data/VAE/vae-ft-mse-840000-ema-pruned.ckpt
|
c6a580b13a5bc05a5e16e4dbb80608ff2ec251a162311590c1f34c013d7f3dab /data/models/VAE/vae-ft-mse-840000-ema-pruned.ckpt
|
||||||
e2cd4703ab14f4d01fd1383a8a8b266f9a5833dacee8e6a79d3bf21a1b6be5ad /data/GFPGAN/GFPGANv1.4.pth
|
e2cd4703ab14f4d01fd1383a8a8b266f9a5833dacee8e6a79d3bf21a1b6be5ad /data/models/GFPGAN/GFPGANv1.4.pth
|
||||||
4fa0d38905f75ac06eb49a7951b426670021be3018265fd191d2125df9d682f1 /data/RealESRGAN/RealESRGAN_x4plus.pth
|
4fa0d38905f75ac06eb49a7951b426670021be3018265fd191d2125df9d682f1 /data/models/RealESRGAN/RealESRGAN_x4plus.pth
|
||||||
f872d837d3c90ed2e05227bed711af5671a6fd1c9f7d7e91c911a61f155e99da /data/RealESRGAN/RealESRGAN_x4plus_anime_6B.pth
|
f872d837d3c90ed2e05227bed711af5671a6fd1c9f7d7e91c911a61f155e99da /data/models/RealESRGAN/RealESRGAN_x4plus_anime_6B.pth
|
||||||
c209caecac2f97b4bb8f4d726b70ac2ac9b35904b7fc99801e1f5e61f9210c13 /data/LDSR/model.ckpt
|
c209caecac2f97b4bb8f4d726b70ac2ac9b35904b7fc99801e1f5e61f9210c13 /data/models/LDSR/model.ckpt
|
||||||
9d6ad53c5dafeb07200fb712db14b813b527edd262bc80ea136777bdb41be2ba /data/LDSR/project.yaml
|
9d6ad53c5dafeb07200fb712db14b813b527edd262bc80ea136777bdb41be2ba /data/models/LDSR/project.yaml
|
||||||
|
@ -4,30 +4,18 @@ set -Eeuo pipefail
|
|||||||
|
|
||||||
# TODO: maybe just use the .gitignore file to create all of these
|
# TODO: maybe just use the .gitignore file to create all of these
|
||||||
mkdir -vp /data/.cache \
|
mkdir -vp /data/.cache \
|
||||||
/data/StableDiffusion \
|
|
||||||
/data/LyCORIS \
|
|
||||||
/data/Codeformer \
|
|
||||||
/data/ModelScope \
|
|
||||||
/data/GFPGAN \
|
|
||||||
/data/ESRGAN \
|
|
||||||
/data/BSRGAN \
|
|
||||||
/data/RealESRGAN \
|
|
||||||
/data/SwinIR \
|
|
||||||
/data/LDSR \
|
|
||||||
/data/ScuNET \
|
|
||||||
/data/embeddings \
|
/data/embeddings \
|
||||||
/data/VAE \
|
/data/config/ \
|
||||||
/data/Deepdanbooru \
|
/data/models/ \
|
||||||
/data/MiDaS \
|
/data/models/Stable-diffusion \
|
||||||
/data/Lora \
|
/data/models/GFPGAN \
|
||||||
/data/ControlNet \
|
/data/models/RealESRGAN \
|
||||||
/data/openpose \
|
/data/models/LDSR \
|
||||||
/data/GLIGEN \
|
/data/models/VAE
|
||||||
/data/CLIPEncoder # this is different from the cached pre-train ViT saved in /data/.cache/clip TODO: find out how
|
|
||||||
|
|
||||||
echo "Downloading, this might take a while..."
|
echo "Downloading, this might take a while..."
|
||||||
|
|
||||||
aria2c -x 10 --disable-ipv6 --input-file /docker/links.txt --dir /data --continue
|
aria2c -x 10 --disable-ipv6 --input-file /docker/links.txt --dir /data/models --continue
|
||||||
|
|
||||||
echo "Checking SHAs..."
|
echo "Checking SHAs..."
|
||||||
|
|
||||||
@ -39,11 +27,5 @@ https://github.com/AbdBarho/stable-diffusion-webui-docker/blob/master/LICENSE
|
|||||||
https://github.com/CompVis/stable-diffusion/blob/main/LICENSE
|
https://github.com/CompVis/stable-diffusion/blob/main/LICENSE
|
||||||
https://github.com/AUTOMATIC1111/stable-diffusion-webui/blob/master/LICENSE.txt
|
https://github.com/AUTOMATIC1111/stable-diffusion-webui/blob/master/LICENSE.txt
|
||||||
https://github.com/invoke-ai/InvokeAI/blob/main/LICENSE
|
https://github.com/invoke-ai/InvokeAI/blob/main/LICENSE
|
||||||
https://github.com/sd-webui/stable-diffusion-webui/blob/master/LICENSE
|
And licenses of all UIs, third party libraries, and extensions.
|
||||||
https://github.com/cszn/BSRGAN/blob/main/LICENSE
|
|
||||||
https://github.com/sczhou/CodeFormer/blob/master/LICENSE
|
|
||||||
https://github.com/TencentARC/GFPGAN/blob/master/LICENSE
|
|
||||||
https://github.com/xinntao/Real-ESRGAN/blob/master/LICENSE
|
|
||||||
https://github.com/xinntao/ESRGAN/blob/master/LICENSE
|
|
||||||
https://github.com/cszn/SCUNet/blob/main/LICENSE
|
|
||||||
EOF
|
EOF
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
https://huggingface.co/runwayml/stable-diffusion-v1-5/resolve/main/v1-5-pruned-emaonly.ckpt
|
https://huggingface.co/runwayml/stable-diffusion-v1-5/resolve/main/v1-5-pruned-emaonly.ckpt
|
||||||
out=StableDiffusion/v1-5-pruned-emaonly.ckpt
|
out=Stable-diffusion/v1-5-pruned-emaonly.ckpt
|
||||||
https://huggingface.co/stabilityai/sd-vae-ft-mse-original/resolve/main/vae-ft-mse-840000-ema-pruned.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
|
out=VAE/vae-ft-mse-840000-ema-pruned.ckpt
|
||||||
https://huggingface.co/runwayml/stable-diffusion-inpainting/resolve/main/sd-v1-5-inpainting.ckpt
|
https://huggingface.co/runwayml/stable-diffusion-inpainting/resolve/main/sd-v1-5-inpainting.ckpt
|
||||||
out=StableDiffusion/sd-v1-5-inpainting.ckpt
|
out=Stable-diffusion/sd-v1-5-inpainting.ckpt
|
||||||
https://github.com/TencentARC/GFPGAN/releases/download/v1.3.4/GFPGANv1.4.pth
|
https://github.com/TencentARC/GFPGAN/releases/download/v1.3.4/GFPGANv1.4.pth
|
||||||
out=GFPGAN/GFPGANv1.4.pth
|
out=GFPGAN/GFPGANv1.4.pth
|
||||||
https://github.com/xinntao/Real-ESRGAN/releases/download/v0.1.0/RealESRGAN_x4plus.pth
|
https://github.com/xinntao/Real-ESRGAN/releases/download/v0.1.0/RealESRGAN_x4plus.pth
|
||||||
|
@ -48,6 +48,6 @@ EXPOSE 7860
|
|||||||
|
|
||||||
ENTRYPOINT ["/docker/entrypoint.sh"]
|
ENTRYPOINT ["/docker/entrypoint.sh"]
|
||||||
CMD invokeai --web --host 0.0.0.0 --port 7860 --root_dir ${ROOT} --config ${CONFIG_DIR}/models.yaml \
|
CMD invokeai --web --host 0.0.0.0 --port 7860 --root_dir ${ROOT} --config ${CONFIG_DIR}/models.yaml \
|
||||||
--outdir /output/invoke --embedding_directory /data/embeddings/ --lora_directory /data/Lora \
|
--outdir /output/invoke --embedding_directory /data/embeddings/ --lora_directory /data/models/Lora \
|
||||||
--no-nsfw_checker --no-safety_checker ${CLI_ARGS}
|
--no-nsfw_checker --no-safety_checker ${CLI_ARGS}
|
||||||
|
|
||||||
|
@ -13,10 +13,10 @@ MOUNTS["/root/.cache"]=/data/.cache/
|
|||||||
rm -rf ${HF_HOME}/diffusers
|
rm -rf ${HF_HOME}/diffusers
|
||||||
|
|
||||||
# ui specific
|
# ui specific
|
||||||
MOUNTS["${ROOT}/models/codeformer"]=/data/Codeformer/
|
MOUNTS["${ROOT}/models/codeformer"]=/data/models/Codeformer/
|
||||||
MOUNTS["${ROOT}/models/gfpgan/GFPGANv1.4.pth"]=/data/GFPGAN/GFPGANv1.4.pth
|
MOUNTS["${ROOT}/models/gfpgan/GFPGANv1.4.pth"]=/data/models/GFPGAN/GFPGANv1.4.pth
|
||||||
MOUNTS["${ROOT}/models/gfpgan/weights"]=/data/GFPGAN/
|
MOUNTS["${ROOT}/models/gfpgan/weights"]=/data/models/GFPGAN/
|
||||||
MOUNTS["${ROOT}/models/realesrgan"]=/data/RealESRGAN/
|
MOUNTS["${ROOT}/models/realesrgan"]=/data/models/RealESRGAN/
|
||||||
|
|
||||||
MOUNTS["${ROOT}/models/ldm"]=/data/.cache/invoke/ldm/
|
MOUNTS["${ROOT}/models/ldm"]=/data/.cache/invoke/ldm/
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user