diff --git a/config/provisioning/default-rocm.sh b/config/provisioning/default-rocm.sh index 8a90430..0583d62 100755 --- a/config/provisioning/default-rocm.sh +++ b/config/provisioning/default-rocm.sh @@ -8,24 +8,19 @@ DISK_GB_REQUIRED=30 -MAMBA_PACKAGES=( - #"package1" - #"package2=version" - ) - PIP_PACKAGES=( - - ) + +) EXTENSIONS=( "https://github.com/Mikubill/sd-webui-controlnet" "https://github.com/deforum-art/sd-webui-deforum" + "https://github.com/d8ahazard/sd_dreambooth_extension" "https://github.com/adieyal/sd-dynamic-prompts" "https://github.com/ototadana/sd-face-editor" "https://github.com/AlUlkesh/stable-diffusion-webui-images-browser" "https://github.com/hako-mikan/sd-webui-regional-prompter" "https://github.com/Coyote-A/ultimate-upscale-for-automatic1111" - "https://github.com/fkunn1326/openpose-editor" "https://github.com/Gourieff/sd-webui-reactor" ) @@ -76,11 +71,12 @@ CONTROLNET_MODELS=( function provisioning_start() { source /opt/ai-dock/etc/environment.sh + source /opt/ai-dock/bin/venv-set.sh webui + DISK_GB_AVAILABLE=$(($(df --output=avail -m "${WORKSPACE}" | tail -n1) / 1000)) DISK_GB_USED=$(($(df --output=used -m "${WORKSPACE}" | tail -n1) / 1000)) DISK_GB_ALLOCATED=$(($DISK_GB_AVAILABLE + $DISK_GB_USED)) provisioning_print_header - provisioning_get_mamba_packages provisioning_get_pip_packages provisioning_get_extensions provisioning_get_models \ @@ -108,20 +104,16 @@ function provisioning_start() { # Start and exit because webui will probably require a restart cd /opt/stable-diffusion-webui && \ - micromamba run -n webui -e LD_PRELOAD=libtcmalloc.so python launch.py \ + source $WEBUI_VENV/bin/activate + LD_PRELOAD=libtcmalloc.so python launch.py \ ${FLAGS_COMBINED} + deactivate provisioning_print_end } -function provisioning_get_mamba_packages() { - if [[ -n $MAMBA_PACKAGES ]]; then - $MAMBA_INSTALL -n webui ${MAMBA_PACKAGES[@]} - fi -} - function provisioning_get_pip_packages() { if [[ -n $PIP_PACKAGES ]]; then - micromamba run -n webui $PIP_INSTALL ${PIP_PACKAGES[@]} + "$WEBUI_VENV_PIP" install --no-cache-dir ${PIP_PACKAGES[@]} fi } @@ -134,15 +126,15 @@ function provisioning_get_extensions() { if [[ ${AUTO_UPDATE,,} == "true" ]]; then printf "Updating extension: %s...\n" "${repo}" ( cd "$path" && git pull ) - if [[ -e $requirements ]]; then - micromamba -n webui run ${PIP_INSTALL} -r "$requirements" - fi + fi + if [[ -e $requirements ]]; then + "$WEBUI_VENV_PIP" install --no-cache-dir -r "$requirements" fi else printf "Downloading extension: %s...\n" "${repo}" git clone "${repo}" "${path}" --recursive if [[ -e $requirements ]]; then - micromamba -n webui run ${PIP_INSTALL} -r "${requirements}" + "$WEBUI_VENV_PIP" install --no-cache-dir -r "${requirements}" fi fi done diff --git a/config/provisioning/default.sh b/config/provisioning/default.sh index c4140ea..8707714 100755 --- a/config/provisioning/default.sh +++ b/config/provisioning/default.sh @@ -8,14 +8,9 @@ DISK_GB_REQUIRED=30 -MAMBA_PACKAGES=( - #"package1" - #"package2=version" - ) - PIP_PACKAGES=( - "bitsandbytes==0.41.2.post2" - ) + +) EXTENSIONS=( "https://github.com/Mikubill/sd-webui-controlnet" @@ -26,7 +21,6 @@ EXTENSIONS=( "https://github.com/AlUlkesh/stable-diffusion-webui-images-browser" "https://github.com/hako-mikan/sd-webui-regional-prompter" "https://github.com/Coyote-A/ultimate-upscale-for-automatic1111" - "https://github.com/fkunn1326/openpose-editor" "https://github.com/Gourieff/sd-webui-reactor" ) @@ -77,11 +71,12 @@ CONTROLNET_MODELS=( function provisioning_start() { source /opt/ai-dock/etc/environment.sh + source /opt/ai-dock/bin/venv-set.sh webui + DISK_GB_AVAILABLE=$(($(df --output=avail -m "${WORKSPACE}" | tail -n1) / 1000)) DISK_GB_USED=$(($(df --output=used -m "${WORKSPACE}" | tail -n1) / 1000)) DISK_GB_ALLOCATED=$(($DISK_GB_AVAILABLE + $DISK_GB_USED)) provisioning_print_header - provisioning_get_mamba_packages provisioning_get_pip_packages provisioning_get_extensions provisioning_get_models \ @@ -109,20 +104,16 @@ function provisioning_start() { # Start and exit because webui will probably require a restart cd /opt/stable-diffusion-webui && \ - micromamba run -n webui -e LD_PRELOAD=libtcmalloc.so python launch.py \ + source "$WEBUI_VENV/bin/activate" + LD_PRELOAD=libtcmalloc.so python launch.py \ ${FLAGS_COMBINED} + deactivate provisioning_print_end } -function provisioning_get_mamba_packages() { - if [[ -n $MAMBA_PACKAGES ]]; then - $MAMBA_INSTALL -n webui ${MAMBA_PACKAGES[@]} - fi -} - function provisioning_get_pip_packages() { if [[ -n $PIP_PACKAGES ]]; then - micromamba run -n webui $PIP_INSTALL ${PIP_PACKAGES[@]} + "$WEBUI_VENV_PIP" install --no-cache-dir ${PIP_PACKAGES[@]} fi } @@ -132,18 +123,20 @@ function provisioning_get_extensions() { path="/opt/stable-diffusion-webui/extensions/${dir}" requirements="${path}/requirements.txt" if [[ -d $path ]]; then + # Pull only if AUTO_UPDATE if [[ ${AUTO_UPDATE,,} == "true" ]]; then printf "Updating extension: %s...\n" "${repo}" ( cd "$path" && git pull ) - if [[ -e $requirements ]]; then - micromamba -n webui run ${PIP_INSTALL} -r "$requirements" - fi + fi + # Always pip install + if [[ -e $requirements ]]; then + "$WEBUI_VENV_PIP" install --no-cache-dir -r "$requirements" fi else printf "Downloading extension: %s...\n" "${repo}" git clone "${repo}" "${path}" --recursive if [[ -e $requirements ]]; then - micromamba -n webui run ${PIP_INSTALL} -r "${requirements}" + "$WEBUI_VENV_PIP" install --no-cache-dir -r "${requirements}" fi fi done