easydiffusion/scripts/on_sd_start.sh

54 lines
1.6 KiB
Bash
Raw Normal View History

#!/bin/bash
cp sd-ui-files/scripts/functions.sh scripts/
2022-09-09 10:36:37 +02:00
cp sd-ui-files/scripts/on_env_start.sh scripts/
cp sd-ui-files/scripts/bootstrap.sh scripts/
cp sd-ui-files/scripts/check_modules.py scripts/
cp sd-ui-files/scripts/get_config.py scripts/
cp sd-ui-files/scripts/config.yaml.sample scripts/
2023-09-18 18:55:34 +02:00
source ./scripts/functions.sh
# activate the installer env
CONDA_BASEPATH=$(conda info --base)
source "$CONDA_BASEPATH/etc/profile.d/conda.sh" # avoids the 'shell not initialized' error
conda activate || fail "Failed to activate conda"
# remove the old version of the dev console script, if it's still present
2022-10-07 16:22:31 +02:00
if [ -e "open_dev_console.sh" ]; then
rm "open_dev_console.sh"
fi
2023-09-18 18:55:34 +02:00
if [ -e "ui/plugins/ui/merge.plugin.js" ]; then
rm "ui/plugins/ui/merge.plugin.js"
fi
# set the correct installer path (current vs legacy)
if [ -e "installer_files/env" ]; then
export INSTALL_ENV_DIR="$(pwd)/installer_files/env"
fi
if [ -e "stable-diffusion/env" ]; then
export INSTALL_ENV_DIR="$(pwd)/stable-diffusion/env"
2022-09-02 18:24:32 +02:00
fi
# create the stable-diffusion folder, to work with legacy installations
if [ ! -e "stable-diffusion" ]; then mkdir stable-diffusion; fi
2022-09-02 18:24:32 +02:00
cd stable-diffusion
# activate the old stable-diffusion env, if it exists
if [ -e "env" ]; then
conda activate ./env || fail "conda activate failed"
fi
# disable the legacy src and ldm folder (otherwise this prevents installing gfpgan and realesrgan)
if [ -e "src" ]; then mv src src-old; fi
if [ -e "ldm" ]; then mv ldm ldm-old; fi
cd ..
2023-08-08 22:16:57 +02:00
# Download the required packages
python scripts/check_modules.py --launch-uvicorn
2022-09-02 18:24:32 +02:00
read -p "Press any key to continue"