diff options
author | AUTOMATIC <16777216c@gmail.com> | 2023-06-03 06:59:56 +0000 |
---|---|---|
committer | AUTOMATIC <16777216c@gmail.com> | 2023-06-03 06:59:56 +0000 |
commit | 333e63c0911c148ea306d7b72580d5c6d2f2c41a (patch) | |
tree | 48c925dc4be95b8b50305b159db2e952d1e40d35 /webui.sh | |
parent | 9d953c0e039cce2c9d8318de9b79a09e243d3e45 (diff) | |
download | stable-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-x | webui.sh | 34 |
1 files changed, 20 insertions, 14 deletions
@@ -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 |