2022-09-09 17:32:33 +02:00
|
|
|
#!/bin/bash
|
|
|
|
|
2022-11-05 18:59:59 +01:00
|
|
|
source ./scripts/functions.sh
|
|
|
|
|
2023-08-29 11:24:31 +02:00
|
|
|
printf "\n\nEasy Diffusion - v3\n\n"
|
2022-09-02 18:24:32 +02:00
|
|
|
|
2023-04-25 21:02:36 +02:00
|
|
|
export PYTHONNOUSERSITE=y
|
|
|
|
|
2022-09-09 14:56:00 +02:00
|
|
|
if [ -f "scripts/config.sh" ]; then
|
|
|
|
source scripts/config.sh
|
|
|
|
fi
|
|
|
|
|
2023-04-02 18:15:15 +02:00
|
|
|
if [ -f "scripts/user_config.sh" ]; then
|
|
|
|
source scripts/user_config.sh
|
|
|
|
fi
|
|
|
|
|
2023-04-21 00:09:27 +02:00
|
|
|
export PYTHONPATH=$(pwd)/installer_files/env/lib/python3.8/site-packages:$(pwd)/stable-diffusion/env/lib/python3.8/site-packages
|
|
|
|
|
|
|
|
if [ -f "scripts/get_config.py" ]; then
|
|
|
|
export update_branch="$( python scripts/get_config.py --default=main update_branch )"
|
|
|
|
fi
|
2023-04-02 18:15:15 +02:00
|
|
|
|
2022-09-09 14:56:00 +02:00
|
|
|
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
|
2023-02-14 09:00:02 +01:00
|
|
|
echo "Easy Diffusion's git repository was already installed. Updating from $update_branch.."
|
2022-09-02 18:24:32 +02:00
|
|
|
|
|
|
|
cd sd-ui-files
|
|
|
|
|
2023-08-15 10:01:08 +02:00
|
|
|
git add -A .
|
|
|
|
git stash
|
2022-09-02 18:24:32 +02:00
|
|
|
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
|
2023-02-14 09:00:02 +01:00
|
|
|
printf "\n\nDownloading Easy Diffusion..\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
|
|
|
|
2023-06-14 11:57:06 +02:00
|
|
|
if git clone -b "$update_branch" https://github.com/easydiffusion/easydiffusion.git sd-ui-files ; then
|
2022-09-02 18:24:32 +02:00
|
|
|
echo sd_ui_git_cloned >> scripts/install_status.txt
|
|
|
|
else
|
2022-11-05 18:59:59 +01:00
|
|
|
fail "git clone failed"
|
2022-09-02 18:24:32 +02:00
|
|
|
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-12-24 09:07:50 +01:00
|
|
|
cp sd-ui-files/scripts/check_modules.py scripts/
|
2023-04-21 00:09:27 +02:00
|
|
|
cp sd-ui-files/scripts/get_config.py scripts/
|
2023-06-30 08:23:38 +02:00
|
|
|
cp sd-ui-files/scripts/config.yaml.sample 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 .
|
2023-02-13 14:33:34 +01:00
|
|
|
cp sd-ui-files/scripts/functions.sh scripts/
|
2022-09-02 18:24:32 +02:00
|
|
|
|
2023-02-13 04:32:31 +01:00
|
|
|
exec ./scripts/on_sd_start.sh
|