2022-09-09 17:32:33 +02:00
#!/bin/bash
2022-09-03 14:25:38 +02:00
printf "\n\nStable Diffusion UI\n\n"
2022-09-02 18:24:32 +02:00
2022-09-09 14:56:00 +02:00
if [ -f "scripts/config.sh" ] ; then
source scripts/config.sh
fi
if [ " $update_branch " = = "" ] ; then
export update_branch = "main"
fi
2022-09-03 14:38:52 +02:00
if [ -f "scripts/install_status.txt" ] && [ ` grep -c sd_ui_git_cloned scripts/install_status.txt` -gt "0" ] ; then
2022-09-09 14:56:00 +02:00
echo " Stable Diffusion UI's git repository was already installed. Updating from $update_branch .. "
2022-09-02 18:24:32 +02:00
cd sd-ui-files
git reset --hard
2022-10-23 07:58:08 +02:00
git -c advice.detachedHead= false checkout " $update_branch "
2022-09-02 18:24:32 +02:00
git pull
cd ..
else
2022-09-03 14:25:38 +02:00
printf "\n\nDownloading Stable Diffusion UI..\n\n"
2022-09-09 14:56:00 +02:00
printf " Using the $update_branch channel\n\n "
2022-09-02 18:24:32 +02:00
2022-09-09 14:56:00 +02:00
if git clone -b " $update_branch " https://github.com/cmdr2/stable-diffusion-ui.git sd-ui-files ; then
2022-09-02 18:24:32 +02:00
echo sd_ui_git_cloned >> scripts/install_status.txt
else
2022-10-17 11:46:31 +02:00
printf "\n\nError downloading Stable Diffusion UI. Sorry about that, please try to:\n 1. Run this installer again.\n 2. If that doesn't fix it, please try the common troubleshooting steps at https://github.com/cmdr2/stable-diffusion-ui/wiki/Troubleshooting\n 3. If those steps don't help, please copy *all* the error messages in this window, and ask the community at https://discord.com/invite/u9yhsFmEkB\n 4. If that doesn't solve the problem, please file an issue at https://github.com/cmdr2/stable-diffusion-ui/issues\nThanks!\n\n"
2022-09-02 18:24:32 +02:00
read -p "Press any key to continue"
exit
fi
fi
2022-09-09 15:38:29 +02:00
rm -rf ui
cp -Rf sd-ui-files/ui .
2022-09-07 16:31:39 +02:00
cp sd-ui-files/scripts/on_sd_start.sh scripts/
2022-10-22 19:54:13 +02:00
cp sd-ui-files/scripts/bootstrap.sh scripts/
2022-09-07 16:31:39 +02:00
cp sd-ui-files/scripts/start.sh .
2022-10-07 16:18:24 +02:00
cp sd-ui-files/scripts/developer_console.sh .
2022-09-02 18:24:32 +02:00
2022-09-03 08:13:05 +02:00
./scripts/on_sd_start.sh
2022-09-09 14:56:00 +02:00
read -p "Press any key to continue"