aboutsummaryrefslogtreecommitdiff
path: root/webui.sh
diff options
context:
space:
mode:
authorAUTOMATIC1111 <16777216c@gmail.com>2022-11-19 10:49:44 +0300
committerGitHub <noreply@github.com>2022-11-19 10:49:44 +0300
commit0d098e46568a268180974953fe2783fff1333040 (patch)
tree2195d6ef8d1f29b65682e88a707fb5c19dec5734 /webui.sh
parent98947d173e3f1667eba29c904f681047dea9de90 (diff)
parentac6fd2a5d91ca1ee36d721ef483b101597d3ee25 (diff)
Merge pull request #4527 from d8ahazard/Accelerate
Optional Accelerate Launch
Diffstat (limited to 'webui.sh')
-rwxr-xr-xwebui.sh16
1 files changed, 12 insertions, 4 deletions
diff --git a/webui.sh b/webui.sh
index cc06f344..d89b344b 100755
--- a/webui.sh
+++ b/webui.sh
@@ -134,7 +134,15 @@ else
exit 1
fi
-printf "\n%s\n" "${delimiter}"
-printf "Launching launch.py..."
-printf "\n%s\n" "${delimiter}"
-"${python_cmd}" "${LAUNCH_SCRIPT}" "$@"
+if [[ ! -z "${ACCELERATE}" ]] && [ ${ACCELERATE}="True" ] && [ -x "$(command -v accelerate)" ]
+then
+ printf "\n%s\n" "${delimiter}"
+ printf "Accelerating launch.py..."
+ printf "\n%s\n" "${delimiter}"
+ 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}"
+ "${python_cmd}" "${LAUNCH_SCRIPT}" "$@"
+fi