From a4ee103ff0db5c7dda701b593333600e0e419a30 Mon Sep 17 00:00:00 2001 From: cmdr2 Date: Sat, 3 Sep 2022 17:55:38 +0530 Subject: [PATCH] Simplified script for linux v2 --- scripts/Start Stable Diffusion UI.sh | 2 ++ scripts/on_env_start.sh | 9 ++++----- scripts/on_sd_start.sh | 6 +++--- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/scripts/Start Stable Diffusion UI.sh b/scripts/Start Stable Diffusion UI.sh index 56d5ea4e..d5d16a6a 100755 --- a/scripts/Start Stable Diffusion UI.sh +++ b/scripts/Start Stable Diffusion UI.sh @@ -1 +1,3 @@ source installer/bin/activate + +scripts/on_env_start.sh diff --git a/scripts/on_env_start.sh b/scripts/on_env_start.sh index a19aed2c..6b422329 100755 --- a/scripts/on_env_start.sh +++ b/scripts/on_env_start.sh @@ -1,6 +1,4 @@ -echo "\nStable Diffusion UI\n" - -cd .. +printf "\n\nStable Diffusion UI\n\n" if [ `grep -c sd_ui_git_cloned scripts/install_status.txt` -gt "0" ]; then echo "Stable Diffusion UI's git repository was already installed. Updating.." @@ -12,12 +10,12 @@ if [ `grep -c sd_ui_git_cloned scripts/install_status.txt` -gt "0" ]; then cd .. else - echo "\nDownloading Stable Diffusion UI..\n" + printf "\n\nDownloading Stable Diffusion UI..\n\n" if git clone https://github.com/cmdr2/stable-diffusion-ui.git sd-ui-files ; then echo sd_ui_git_cloned >> scripts/install_status.txt else - echo "\nError downloading Stable Diffusion UI. Please try re-running this installer. If it doesn't work, please copy the messages in this window, and ask the community at https://discord.com/invite/u9yhsFmEkB or file an issue at https://github.com/cmdr2/stable-diffusion-ui/issues\n" + printf "\n\nError downloading Stable Diffusion UI. Please try re-running this installer. If it doesn't work, please copy the messages in this window, and ask the community at https://discord.com/invite/u9yhsFmEkB or file an issue at https://github.com/cmdr2/stable-diffusion-ui/issues\n\n" read -p "Press any key to continue" exit fi @@ -25,5 +23,6 @@ fi cp -Rf sd-ui-files/ui ui cp -Rf sd-ui-files/scripts/* scripts/ +cp "scripts/Start Stable Diffusion UI.sh" . ./scripts/on_sd_start.sh diff --git a/scripts/on_sd_start.sh b/scripts/on_sd_start.sh index 5a3dee00..03067739 100755 --- a/scripts/on_sd_start.sh +++ b/scripts/on_sd_start.sh @@ -27,7 +27,7 @@ else echo "Downloading packages necessary for Stable Diffusion.." echo "***** This will take some time (depending on the speed of the Internet connection) and may appear to be stuck, but please be patient ***** .." - if conda env create -f environment.yaml ; then + if conda env create --prefix env --force -f environment.yaml ; then echo conda_sd_env_created >> ../scripts/install_status.txt else echo "\nError installing the packages necessary for Stable Diffusion. Please try re-running this installer. If it doesn't work, please copy the messages in this window, and ask the community at https://discord.com/invite/u9yhsFmEkB or file an issue at https://github.com/cmdr2/stable-diffusion-ui/issues\n" @@ -36,14 +36,14 @@ else fi fi -conda activate ldm +conda activate ./env if [ `grep -c conda_sd_ui_deps_installed ../scripts/install_status.txt` -gt "0" ]; then echo "Packages necessary for Stable Diffusion UI were already installed" else echo "\nDownloading packages necessary for Stable Diffusion UI..\n" - if conda install -c conda-forge -y uvicorn fastapi ; then + if conda install -c conda-forge --prefix ./env -y uvicorn fastapi ; then echo conda_sd_ui_deps_installed >> ../scripts/install_status.txt else echo "\nError installing the packages necessary for Stable Diffusion UI. Please try re-running this installer. If it doesn't work, please copy the messages in this window, and ask the community at https://discord.com/invite/u9yhsFmEkB or file an issue at https://github.com/cmdr2/stable-diffusion-ui/issues\n"