aboutsummaryrefslogtreecommitdiffstats
path: root/webui.sh
diff options
context:
space:
mode:
authorAUTOMATIC <16777216c@gmail.com>2023-06-03 06:59:56 +0000
committerAUTOMATIC <16777216c@gmail.com>2023-06-03 06:59:56 +0000
commit333e63c0911c148ea306d7b72580d5c6d2f2c41a (patch)
tree48c925dc4be95b8b50305b159db2e952d1e40d35 /webui.sh
parent9d953c0e039cce2c9d8318de9b79a09e243d3e45 (diff)
downloadstable-diffusion-webui-gfx803-333e63c0911c148ea306d7b72580d5c6d2f2c41a.tar.gz
stable-diffusion-webui-gfx803-333e63c0911c148ea306d7b72580d5c6d2f2c41a.tar.bz2
stable-diffusion-webui-gfx803-333e63c0911c148ea306d7b72580d5c6d2f2c41a.zip
a yet another method to restart webui
Diffstat (limited to 'webui.sh')
-rwxr-xr-xwebui.sh34
1 files changed, 20 insertions, 14 deletions
diff --git a/webui.sh b/webui.sh
index 1e728813..c407b3ef 100755
--- a/webui.sh
+++ b/webui.sh
@@ -203,17 +203,23 @@ prepare_tcmalloc() {
fi
}
-if [[ ! -z "${ACCELERATE}" ]] && [ ${ACCELERATE}="True" ] && [ -x "$(command -v accelerate)" ]
-then
- printf "\n%s\n" "${delimiter}"
- printf "Accelerating launch.py..."
- printf "\n%s\n" "${delimiter}"
- prepare_tcmalloc
- exec accelerate launch --num_cpu_threads_per_process=6 "${LAUNCH_SCRIPT}" "$@"
-else
- printf "\n%s\n" "${delimiter}"
- printf "Launching launch.py..."
- printf "\n%s\n" "${delimiter}"
- prepare_tcmalloc
- exec "${python_cmd}" "${LAUNCH_SCRIPT}" "$@"
-fi
+KEEP_GOING=1
+while [[ "$KEEP_GOING" -eq "1" ]]; do
+ if [[ ! -z "${ACCELERATE}" ]] && [ ${ACCELERATE}="True" ] && [ -x "$(command -v accelerate)" ]; then
+ printf "\n%s\n" "${delimiter}"
+ printf "Accelerating launch.py..."
+ printf "\n%s\n" "${delimiter}"
+ prepare_tcmalloc
+ accelerate launch --num_cpu_threads_per_process=6 "${LAUNCH_SCRIPT}" "$@"
+ else
+ printf "\n%s\n" "${delimiter}"
+ printf "Launching launch.py..."
+ printf "\n%s\n" "${delimiter}"
+ prepare_tcmalloc
+ "${python_cmd}" "${LAUNCH_SCRIPT}" "$@"
+ fi
+
+ if [[ ! -f tmp/restart ]]; then
+ KEEP_GOING=0
+ fi
+done