Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 4 additions & 10 deletions 01.sh
Original file line number Diff line number Diff line change
@@ -1,19 +1,12 @@
#!/bin/bash
source /sl_folder.sh
source /functions.sh

export PATH="/home/abc/miniconda3/bin:$PATH"
export SD01_DIR=${BASE_DIR}/01-easy-diffusion

#clean conda env
if [ "$active_clean" = "1" ]; then
echo "-------------------------------------"
echo "Cleaning venv"
rm -rf ${SD01_DIR}/conda-env
rm -rf ${SD01_DIR}/installer_files
export active_clean=0
echo "Done!"
echo -e "-------------------------------------\n"
fi
clean_env ${SD01_DIR}/conda-env
clean_env ${SD01_DIR}/installer_files

#Create Conda Env
if [ ! -d ${SD01_DIR}/conda-env ]; then
Expand Down Expand Up @@ -64,3 +57,4 @@ fi
#run easy-diffusion
cd $SD01_DIR
bash start.sh
wait 99999
38 changes: 9 additions & 29 deletions 02.forge.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/bin/bash
source /sl_folder.sh
source /functions.sh


export PATH="/home/abc/miniconda3/bin:$PATH"
export SD02_DIR=${BASE_DIR}/02-sd-webui
Expand All @@ -10,42 +11,20 @@ export venv_dir="-"
# Install or update Stable-Diffusion-WebUI
mkdir -p ${SD02_DIR}

# Create Conda virtual env
if [ ! -d ${SD02_DIR}/conda-env ]; then
conda create -p ${SD02_DIR}/conda-env -y
fi

if [ ! -d ${SD02_DIR}/forge ]; then
git clone https://github.com/lllyasviel/stable-diffusion-webui-forge.git ${SD02_DIR}/forge
fi

cd ${SD02_DIR}/forge

# check if remote is ahead of local
# https://stackoverflow.com/a/25109122/1469797
if [ "$CLEAN_ENV" != "true" ] && [ $(git rev-parse HEAD) = $(git ls-remote $(git rev-parse --abbrev-ref @{u} | \
sed 's/\// /g') | cut -f1) ]; then
echo "Local branch up-to-date, keeping existing venv"
else
if [ "$CLEAN_ENV" = "true" ]; then
echo "Forced wiping venv for clean packages install"
else
echo "Remote branch is ahead. Wiping venv for clean packages install"
fi
export active_clean=1
git pull -X ours
fi
cd ${SD02_DIR}/forge
check_remote

#clean conda env
if [ "$active_clean" = "1" ]; then
echo "-------------------------------------"
echo "Cleaning venv"
conda deactivate
rm -rf ${SD02_DIR}/conda-env
clean_env ${SD02_DIR}/conda-env

# Create Conda virtual env
if [ ! -d ${SD02_DIR}/conda-env ]; then
conda create -p ${SD02_DIR}/conda-env -y
export active_clean=0
echo "Done!"
echo -e "-------------------------------------\n"
fi

#activate conda env + install base tools
Expand Down Expand Up @@ -92,3 +71,4 @@ while IFS= read -r param; do
fi
done < "${SD02_DIR}/parameters.forge.txt"
eval $CMD
wait 99999
38 changes: 9 additions & 29 deletions 02.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/bash
source /sl_folder.sh
source /functions.sh

export PATH="/home/abc/miniconda3/bin:$PATH"
export SD02_DIR=${BASE_DIR}/02-sd-webui
Expand All @@ -10,43 +10,22 @@ export venv_dir="-"
# Install or update Stable-Diffusion-WebUI
mkdir -p ${SD02_DIR}

# create conda env if needed
if [ ! -d ${SD02_DIR}/conda-env ]; then
conda create -p ${SD02_DIR}/conda-env -y
fi

# clone repository
if [ ! -d ${SD02_DIR}/webui ]; then
git clone https://github.com/AUTOMATIC1111/stable-diffusion-webui.git ${SD02_DIR}/webui
fi

cd ${SD02_DIR}/webui

# check if remote is ahead of local
# https://stackoverflow.com/a/25109122/1469797
if [ "$CLEAN_ENV" != "true" ] && [ $(git rev-parse HEAD) = $(git ls-remote $(git rev-parse --abbrev-ref @{u} | \
sed 's/\// /g') | cut -f1) ]; then
echo "Local branch up-to-date, keeping existing venv"
else
if [ "$CLEAN_ENV" = "true" ]; then
echo "Forced wiping venv for clean packages install"
else
echo "Remote branch is ahead. Wiping venv for clean packages install"
fi
export active_clean=1
git pull -X ours
fi
cd ${SD02_DIR}/webui
check_remote

#clean conda env
if [ "$active_clean" = "1" ]; then
echo "-------------------------------------"
echo "Cleaning venv"
conda deactivate
rm -rf ${SD02_DIR}/conda-env
clean_env ${SD02_DIR}/conda-env

# create conda env if needed
if [ ! -d ${SD02_DIR}/conda-env ]; then
conda create -p ${SD02_DIR}/conda-env -y
export active_clean=0
echo "Done!"
echo -e "-------------------------------------\n"
fi

# activate conda env and install base tools
Expand Down Expand Up @@ -83,7 +62,7 @@ sl_folder ${SD02_DIR}/webui/models GFPGAN ${BASE_DIR}/models gfpgan
sl_folder ${SD02_DIR}/webui/models LDSR ${BASE_DIR}/models ldsr
sl_folder ${SD02_DIR}/webui/models ControlNet ${BASE_DIR}/models controlnet

sl_folder ${SD02_DIR}/webui outputs ${BASE_DIR}/outputs 02-sd-webui
sl_folder ${SD02_DIR}/webui output ${BASE_DIR}/outputs 02-sd-webui

# run webUI
echo "Run Stable-Diffusion-WebUI"
Expand All @@ -95,3 +74,4 @@ while IFS= read -r param; do
fi
done < "${SD02_DIR}/parameters.txt"
eval $CMD
wait 99999
12 changes: 3 additions & 9 deletions 03.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/bash
source /sl_folder.sh
source /functions.sh

export PATH="/home/abc/miniconda3/bin:$PATH"
export use_venv=0
Expand All @@ -14,14 +14,7 @@ if [ ! -f "$SD03_DIR/parameters.txt" ]; then
fi

#clean conda env
if [ "$active_clean" = "1" ]; then
echo "-------------------------------------"
echo "Cleaning venv"
rm -rf ${SD03_DIR}/env
export active_clean=0
echo "Done!"
echo -e "-------------------------------------\n"
fi
clean_env ${SD03_DIR}/env

# create conda env if absent
if [ ! -d ${SD03_DIR}/env ]; then
Expand Down Expand Up @@ -53,3 +46,4 @@ while IFS= read -r param; do
fi
done < "${SD03_DIR}/parameters.txt"
eval $CMD
wait 99999
30 changes: 6 additions & 24 deletions 04.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/bash
source /sl_folder.sh
source /functions.sh

export PATH="/home/abc/miniconda3/bin:$PATH"
export SD04_DIR=${BASE_DIR}/04-SD-Next
Expand All @@ -14,33 +14,14 @@ if [ ! -d ${SD04_DIR}/webui ]; then
git clone https://github.com/vladmandic/automatic ${SD04_DIR}/webui
fi

cd ${SD04_DIR}/webui

# check if remote is ahead of local
# https://stackoverflow.com/a/25109122/1469797
if [ "$CLEAN_ENV" != "true" ] && [ $(git rev-parse HEAD) = $(git ls-remote $(git rev-parse --abbrev-ref @{u} | \
sed 's/\// /g') | cut -f1) ]; then
echo "Local branch up-to-date, keeping existing venv"
else
if [ "$CLEAN_ENV" = "true" ]; then
echo "Forced wiping venv for clean packages install"
else
echo "Remote branch is ahead. Wiping venv for clean packages install"
fi
export active_clean=1
git pull -X ours
fi
cd ${SD04_DIR}/webui
check_remote

#clean virtual env
if [ "$active_clean" = "1" ]; then
echo "-------------------------------------"
echo "Cleaning venv"
rm -rf ${SD04_DIR}/env
rm -rf ${SD04_DIR}/webui/venv
export active_clean=0
echo "Done!"
echo -e "-------------------------------------\n"
fi
clean_env ${SD04_DIR}/env
clean_env ${SD04_DIR}/webui/venv

#create conda env if needed
if [ ! -d ${SD04_DIR}/env ]; then
Expand Down Expand Up @@ -99,3 +80,4 @@ while IFS= read -r param; do
fi
done < "${SD04_DIR}/parameters.txt"
eval $CMD
wait 99999
54 changes: 19 additions & 35 deletions 05.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/bash
source /sl_folder.sh
source /functions.sh

export PATH="/home/abc/miniconda3/bin:$PATH"
export SD05_DIR=${BASE_DIR}/05-comfy-ui
Expand Down Expand Up @@ -27,42 +27,11 @@ cd ${SD05_DIR}/ComfyUI/custom_nodes/ComfyUI-Manager
git pull -X ours

# check if remote is ahead of local
# https://stackoverflow.com/a/25109122/1469797
if [ "$CLEAN_ENV" != "true" ] && [ $(git rev-parse HEAD) = $(git ls-remote $(git rev-parse --abbrev-ref @{u} | \
sed 's/\// /g') | cut -f1) ]; then
echo "Local branch up-to-date, keeping existing venv"
else
if [ "$CLEAN_ENV" = "true" ]; then
echo "Forced wiping venv for clean packages install"
else
echo "Remote branch is ahead. Wiping venv for clean packages install"
fi
export active_clean=1
# git reset --hard HEAD
git pull -X ours
fi

# Merge Models, vae, lora, hypernetworks, and outputs
sl_folder ${SD05_DIR}/ComfyUI/models checkpoints ${BASE_DIR}/models stable-diffusion
sl_folder ${SD05_DIR}/ComfyUI/models hypernetworks ${BASE_DIR}/models hypernetwork
sl_folder ${SD05_DIR}/ComfyUI/models loras ${BASE_DIR}/models lora
sl_folder ${SD05_DIR}/ComfyUI/models vae ${BASE_DIR}/models vae
sl_folder ${SD05_DIR}/ComfyUI/models vae_approx ${BASE_DIR}/models vae_approx
sl_folder ${SD05_DIR}/ComfyUI/models embeddings ${BASE_DIR}/models embeddings
sl_folder ${SD05_DIR}/ComfyUI/models upscale_models ${BASE_DIR}/models upscale
sl_folder ${SD05_DIR}/ComfyUI/models clip_vision ${BASE_DIR}/models clip_vision
sl_folder ${SD05_DIR}/ComfyUI/models clip ${BASE_DIR}/models clip
sl_folder ${SD05_DIR}/ComfyUI/models controlnet ${BASE_DIR}/models controlnet
cd ${SD05_DIR}/ComfyUI
check_remote

#clean conda env
if [ "$active_clean" = "1" ]; then
echo "-------------------------------------"
echo "Cleaning venv"
rm -rf ${SD01_DIR}/env
export active_clean=0
echo "Done!"
echo -e "-------------------------------------\n"
fi
clean_env ${SD05_DIR}/env

#create conda env if needed
if [ ! -d ${SD05_DIR}/env ]; then
Expand All @@ -82,6 +51,20 @@ if [ -d ${SD05_DIR}/venv ]; then
rm -rf ${SD05_DIR}/venv
fi

# Merge Models, vae, lora, hypernetworks, and outputs
sl_folder ${SD05_DIR}/ComfyUI/models checkpoints ${BASE_DIR}/models stable-diffusion
sl_folder ${SD05_DIR}/ComfyUI/models hypernetworks ${BASE_DIR}/models hypernetwork
sl_folder ${SD05_DIR}/ComfyUI/models loras ${BASE_DIR}/models lora
sl_folder ${SD05_DIR}/ComfyUI/models vae ${BASE_DIR}/models vae
sl_folder ${SD05_DIR}/ComfyUI/models vae_approx ${BASE_DIR}/models vae_approx
sl_folder ${SD05_DIR}/ComfyUI/models embeddings ${BASE_DIR}/models embeddings
sl_folder ${SD05_DIR}/ComfyUI/models upscale_models ${BASE_DIR}/models upscale
sl_folder ${SD05_DIR}/ComfyUI/models clip_vision ${BASE_DIR}/models clip_vision
sl_folder ${SD05_DIR}/ComfyUI/models clip ${BASE_DIR}/models clip
sl_folder ${SD05_DIR}/ComfyUI/models controlnet ${BASE_DIR}/models controlnet



#install requirements
cd ${SD05_DIR}/ComfyUI
pip install -r requirements.txt
Expand All @@ -94,3 +77,4 @@ while IFS= read -r param; do
fi
done < "${SD05_DIR}/parameters.txt"
eval $CMD
wait 99999
27 changes: 4 additions & 23 deletions 06.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/bash
source /sl_folder.sh
source /functions.sh

export PATH="/home/abc/miniconda3/bin:$PATH"
export SD06_DIR=${BASE_DIR}/06-Fooocus
Expand All @@ -23,31 +23,11 @@ if [ ! -d ${SD06_DIR}/Fooocus ]; then
fi

# check if remote is ahead of local
# https://stackoverflow.com/a/25109122/1469797
cd ${SD06_DIR}/Fooocus
if [ "$CLEAN_ENV" != "true" ] && [ $(git rev-parse HEAD) = $(git ls-remote $(git rev-parse --abbrev-ref @{u} | \
sed 's/\// /g') | cut -f1) ]; then
echo "Local branch up-to-date, keeping existing venv"
else
if [ "$CLEAN_ENV" = "true" ]; then
echo "Forced wiping venv for clean packages install"
else
echo "Remote branch is ahead. Wiping venv for clean packages install"
fi
export active_clean=1
# git reset --hard HEAD
git pull -X ours
fi
check_remote

#clean conda env if needed
if [ "$active_clean" = "1" ]; then
echo "-------------------------------------"
echo "Cleaning venv"
rm -rf ${SD06_DIR}/env
export active_clean=0
echo "Done!"
echo -e "-------------------------------------\n"
fi
clean_env ${SD06_DIR}/env

#create env if missing
if [ ! -d ${SD06_DIR}/env ]; then
Expand Down Expand Up @@ -83,3 +63,4 @@ while IFS= read -r param; do
fi
done < "${SD06_DIR}/parameters.txt"
eval $CMD
wait 99999
Loading