From 4f73bc2616902747e64724e4f3ca685ad7f50532 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=A5=9E=E6=A5=BD=E5=9D=82=C2=B7=E5=96=B5?= Date: Sun, 25 Jun 2023 18:42:04 +0800 Subject: [PATCH] Modify installation extension dependencies (#518) Perform a full extension installation process instead of just installing dependencies Some extensions do not include `requirements.txt` but install dependencies in `install.py`, and all extensions include `install.py`, so it is safe to use it for extended dependency installation This is because the extension development of AUTOMATIC1111's webui does not require the existence of `requirements.txt` but uses `install.py` to initialize the extension https://github.com/AUTOMATIC1111/stable-diffusion-webui/wiki/Developing-extensions#installpy --- docker-compose.yml | 2 +- services/AUTOMATIC1111/entrypoint.sh | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index bff738de3..8caad1d93 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -29,7 +29,7 @@ services: <<: *base_service profiles: ["auto"] build: ./services/AUTOMATIC1111 - image: sd-auto:59 + image: sd-auto:60 environment: - CLI_ARGS=--allow-code --medvram --xformers --enable-insecure-extension-access --api diff --git a/services/AUTOMATIC1111/entrypoint.sh b/services/AUTOMATIC1111/entrypoint.sh index 095c2d1d8..985f6f1a3 100755 --- a/services/AUTOMATIC1111/entrypoint.sh +++ b/services/AUTOMATIC1111/entrypoint.sh @@ -57,9 +57,10 @@ chown -R root ~/.cache/ chmod 766 ~/.cache/ shopt -s nullglob -list=(./extensions/*/requirements.txt) -for req in "${list[@]}"; do - pip install -r "$req" +# For install.py, please refer to https://github.com/AUTOMATIC1111/stable-diffusion-webui/wiki/Developing-extensions#installpy +list=(./extensions/*/install.py) +for installscript in "${list[@]}"; do + PYTHONPATH=${ROOT} python "$installscript" done if [ -f "/data/config/auto/startup.sh" ]; then