From 6439e72df2cd2126734ce4a69c277502c4c9982d Mon Sep 17 00:00:00 2001 From: ParityError <36368048+ParityError@users.noreply.github.com> Date: Sun, 12 Mar 2023 15:08:26 -0700 Subject: Update webui.sh Installation should not be assumed to be located within ~/home directory. User should be expected to install project anywhere and run the startup scripts while in stable-diffusion-webui directory. See issue #8534 --- webui.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'webui.sh') diff --git a/webui.sh b/webui.sh index 8cdad22d..b01e4fa9 100755 --- a/webui.sh +++ b/webui.sh @@ -23,7 +23,7 @@ fi # Install directory without trailing slash if [[ -z "${install_dir}" ]] then - install_dir="/home/$(whoami)" + install_dir="($pwd)" fi # Name of the subdirectory (defaults to stable-diffusion-webui) -- cgit v1.2.3 From 5c051c0618bec1417827910b601ba915d0ca6c4e Mon Sep 17 00:00:00 2001 From: ParityError <36368048+ParityError@users.noreply.github.com> Date: Sun, 12 Mar 2023 15:10:44 -0700 Subject: Update webui.sh Installation should not be assumed to be located within ~/home directory. User should be expected to install project anywhere and run the startup scripts while in stable-diffusion-webui directory. See issue #8534 --- webui.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'webui.sh') diff --git a/webui.sh b/webui.sh index b01e4fa9..cf649664 100755 --- a/webui.sh +++ b/webui.sh @@ -23,7 +23,7 @@ fi # Install directory without trailing slash if [[ -z "${install_dir}" ]] then - install_dir="($pwd)" + install_dir="$(pwd)" fi # Name of the subdirectory (defaults to stable-diffusion-webui) -- cgit v1.2.3 From 0d2cf9ac186fc87cc56fce2a4e1136aca2386252 Mon Sep 17 00:00:00 2001 From: yedpodtrzitko Date: Wed, 29 Mar 2023 16:35:37 +0700 Subject: feat: use existing virtualenv if already active --- webui.sh | 35 +++++++++++++++++++++-------------- 1 file changed, 21 insertions(+), 14 deletions(-) (limited to 'webui.sh') diff --git a/webui.sh b/webui.sh index 8cdad22d..0d25be2e 100755 --- a/webui.sh +++ b/webui.sh @@ -152,24 +152,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 if [[ ! -z "${ACCELERATE}" ]] && [ ${ACCELERATE}="True" ] && [ -x "$(command -v accelerate)" ] -- cgit v1.2.3 From 3a5b47e26e8cb1cd640fedfe7cb5263a588d7088 Mon Sep 17 00:00:00 2001 From: DGdev91 Date: Thu, 6 Apr 2023 01:36:27 +0200 Subject: Forcing PyTorch version for AMD GPUs automatic install The old code tries to install the newest versions of pytorch, wich is currently 2.0. Forcing it to 1.13.1 --- webui.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'webui.sh') diff --git a/webui.sh b/webui.sh index 8cdad22d..7d9a8538 100755 --- a/webui.sh +++ b/webui.sh @@ -118,7 +118,7 @@ case "$gpu_info" in esac if echo "$gpu_info" | grep -q "AMD" && [[ -z "${TORCH_COMMAND}" ]] then - export TORCH_COMMAND="pip install torch torchvision --extra-index-url https://download.pytorch.org/whl/rocm5.2" + export TORCH_COMMAND="pip install torch==1.13.1+rocm5.2 torchvision==0.14.1+rocm5.2 --extra-index-url https://download.pytorch.org/whl/rocm5.2" fi for preq in "${GIT}" "${python_cmd}" -- cgit v1.2.3 From 9edd4b6e516ec327e15cc00a3933c681fc4b2f75 Mon Sep 17 00:00:00 2001 From: DGdev91 Date: Tue, 11 Apr 2023 11:22:28 +0200 Subject: Using --index-url instead of --extra-index-url following new PyTorch install command --- webui.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'webui.sh') diff --git a/webui.sh b/webui.sh index 7d9a8538..3b92e184 100755 --- a/webui.sh +++ b/webui.sh @@ -118,7 +118,7 @@ case "$gpu_info" in esac if echo "$gpu_info" | grep -q "AMD" && [[ -z "${TORCH_COMMAND}" ]] then - export TORCH_COMMAND="pip install torch==1.13.1+rocm5.2 torchvision==0.14.1+rocm5.2 --extra-index-url https://download.pytorch.org/whl/rocm5.2" + export TORCH_COMMAND="pip install torch==1.13.1+rocm5.2 torchvision==0.14.1+rocm5.2 --index-url https://download.pytorch.org/whl/rocm5.2" fi for preq in "${GIT}" "${python_cmd}" -- cgit v1.2.3 From 8af4b3bbe46dcb7f701d3650b6e4d31d6dd268a7 Mon Sep 17 00:00:00 2001 From: gk Date: Thu, 13 Apr 2023 08:46:59 +0900 Subject: Try using TCMalloc on Linux by default --- webui.sh | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) (limited to 'webui.sh') diff --git a/webui.sh b/webui.sh index 8cdad22d..1122b965 100755 --- a/webui.sh +++ b/webui.sh @@ -113,13 +113,13 @@ case "$gpu_info" in printf "Experimental support for Renoir: make sure to have at least 4GB of VRAM and 10GB of RAM or enable cpu mode: --use-cpu all --no-half" printf "\n%s\n" "${delimiter}" ;; - *) + *) ;; esac if echo "$gpu_info" | grep -q "AMD" && [[ -z "${TORCH_COMMAND}" ]] then export TORCH_COMMAND="pip install torch torchvision --extra-index-url https://download.pytorch.org/whl/rocm5.2" -fi +fi for preq in "${GIT}" "${python_cmd}" do @@ -172,15 +172,30 @@ else exit 1 fi +# Try using TCMalloc on Linux +prepare_tcmalloc() { + if [[ "${OSTYPE}" == "linux"* ]] && [[ -z "${NO_TCMALLOC}" ]] && [[ -z "${LD_PRELOAD}" ]]; then + TCMALLOC="$(ldconfig -p | grep -Po "libtcmalloc.so.\d" | head -n 1)" + if [[ ! -z "${TCMALLOC}" ]]; then + echo "Using TCMalloc: ${TCMALLOC}" + export LD_PRELOAD="${TCMALLOC}" + else + printf "\e[1m\e[31mCannot locate TCMalloc (improves CPU memory usage)\e[0m\n" + fi + 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}" + printf "\n%s\n" "${delimiter}" + prepare_tcmalloc exec "${python_cmd}" "${LAUNCH_SCRIPT}" "$@" fi -- cgit v1.2.3 From 152ed34ccc603c77703ae3bcb3d570a32a8cc7d9 Mon Sep 17 00:00:00 2001 From: weidong Date: Mon, 17 Apr 2023 17:17:10 +0800 Subject: fix install_dir error When the user's home directory and username are inconsistent, an error message stating that the directory cannot be found will appear. Directly default the installation directory to the user's home directory --- webui.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'webui.sh') diff --git a/webui.sh b/webui.sh index 8cdad22d..07355eab 100755 --- a/webui.sh +++ b/webui.sh @@ -23,7 +23,7 @@ fi # Install directory without trailing slash if [[ -z "${install_dir}" ]] then - install_dir="/home/$(whoami)" + install_dir="${HOME}" fi # Name of the subdirectory (defaults to stable-diffusion-webui) -- cgit v1.2.3 From b2f6e0704e178f64881f507f3a48ff36e63e1a62 Mon Sep 17 00:00:00 2001 From: catalpaaa Date: Tue, 25 Apr 2023 07:27:24 -0700 Subject: add subpath support --- webui.sh | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100755 => 100644 webui.sh (limited to 'webui.sh') diff --git a/webui.sh b/webui.sh old mode 100755 new mode 100644 -- cgit v1.2.3 From 14b70aa97ba356691254055a67b9eb2ec3440b3e Mon Sep 17 00:00:00 2001 From: AUTOMATIC <16777216c@gmail.com> Date: Tue, 2 May 2023 11:03:11 +0300 Subject: revert unwanted change from #9865 --- webui.sh | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 webui.sh (limited to 'webui.sh') diff --git a/webui.sh b/webui.sh old mode 100644 new mode 100755 -- cgit v1.2.3