aboutsummaryrefslogtreecommitdiffstats
path: root/webui.sh
diff options
context:
space:
mode:
authorAUTOMATIC <16777216c@gmail.com>2023-05-13 05:16:37 +0000
committerAUTOMATIC <16777216c@gmail.com>2023-05-13 05:16:37 +0000
commitb08500cec8a791ef20082628b49b17df833f5dda (patch)
tree2d09f3ca93139f082b88463f3a2a43a4ac45526f /webui.sh
parent5ab7f213bec2f816f9c5644becb32eb72c8ffb89 (diff)
parent231562ea13e4f697953bdbabd6b76b22a88c587b (diff)
downloadstable-diffusion-webui-gfx803-b08500cec8a791ef20082628b49b17df833f5dda.tar.gz
stable-diffusion-webui-gfx803-b08500cec8a791ef20082628b49b17df833f5dda.tar.bz2
stable-diffusion-webui-gfx803-b08500cec8a791ef20082628b49b17df833f5dda.zip
Merge branch 'release_candidate'
Diffstat (limited to 'webui.sh')
-rwxr-xr-xwebui.sh35
1 files changed, 21 insertions, 14 deletions
diff --git a/webui.sh b/webui.sh
index 3e069371..19cf2f78 100755
--- a/webui.sh
+++ b/webui.sh
@@ -153,24 +153,31 @@ else
cd "${clone_dir}"/ || { printf "\e[1m\e[31mERROR: Can't cd to %s/%s/, aborting...\e[0m" "${install_dir}" "${clone_dir}"; exit 1; }
fi
-printf "\n%s\n" "${delimiter}"
-printf "Create and activate python venv"
-printf "\n%s\n" "${delimiter}"
-cd "${install_dir}"/"${clone_dir}"/ || { printf "\e[1m\e[31mERROR: Can't cd to %s/%s/, aborting...\e[0m" "${install_dir}" "${clone_dir}"; exit 1; }
-if [[ ! -d "${venv_dir}" ]]
-then
- "${python_cmd}" -m venv "${venv_dir}"
- first_launch=1
-fi
-# shellcheck source=/dev/null
-if [[ -f "${venv_dir}"/bin/activate ]]
+if [[ -z "${VIRTUAL_ENV}" ]];
then
- source "${venv_dir}"/bin/activate
+ printf "\n%s\n" "${delimiter}"
+ printf "Create and activate python venv"
+ printf "\n%s\n" "${delimiter}"
+ cd "${install_dir}"/"${clone_dir}"/ || { printf "\e[1m\e[31mERROR: Can't cd to %s/%s/, aborting...\e[0m" "${install_dir}" "${clone_dir}"; exit 1; }
+ if [[ ! -d "${venv_dir}" ]]
+ then
+ "${python_cmd}" -m venv "${venv_dir}"
+ first_launch=1
+ fi
+ # shellcheck source=/dev/null
+ if [[ -f "${venv_dir}"/bin/activate ]]
+ then
+ source "${venv_dir}"/bin/activate
+ else
+ printf "\n%s\n" "${delimiter}"
+ printf "\e[1m\e[31mERROR: Cannot activate python venv, aborting...\e[0m"
+ printf "\n%s\n" "${delimiter}"
+ exit 1
+ fi
else
printf "\n%s\n" "${delimiter}"
- printf "\e[1m\e[31mERROR: Cannot activate python venv, aborting...\e[0m"
+ printf "python venv already activate: ${VIRTUAL_ENV}"
printf "\n%s\n" "${delimiter}"
- exit 1
fi
# Try using TCMalloc on Linux