Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
dathide authored Feb 3, 2025
1 parent ca138b3 commit 396cf36
Show file tree
Hide file tree
Showing 2 changed files with 165 additions and 0 deletions.
101 changes: 101 additions & 0 deletions swarmui-comfyui-install-and-update-everything.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
#!/usr/bin/env bash

# No error handling needed since some of these commands will fail during an update

# Run swarmui's updater
./update-linuxmac.sh

git clone https://github.com/comfyanonymous/ComfyUI dlbackend/comfyui
cd dlbackend/comfyui || exit
git pull
cd ../.. || exit
pip install --upgrade pip wheel
pip install --upgrade torch torchvision torchaudio xformers
pip install --upgrade -r dlbackend/comfyui/requirements.txt
pip install --upgrade -r src/BuiltinExtensions/ComfyUIBackend/ExtraNodes/SwarmComfyExtra/requirements.txt
# For some reason, these aren't in the requirements files
pip install onnxruntime-gpu imageio_ffmpeg

# Create symlinks
rm -r dlbackend/comfyui/output
ln -s "$(realpath ../output)" dlbackend/comfyui

DIR1="/home/zen/m2b/ai-img/igen-w8s"
cd Models/VAE || exit
ln -s "$DIR1/vae" '.'
cd ../.. || exit

cd Models/Stable-Diffusion || exit
ln -s "$DIR1/ill-ch-a" '.'
cd ../.. || exit

cd Models/Lora || exit
ln -s "$DIR1/ill-lo" '.'
cd ../.. || exit

cd Models/controlnet || exit
ln -s "$DIR1/ill-cnet" '.'
cd ../.. || exit

# Install and update extensions
cd dlbackend/comfyui/custom_nodes || exit

git clone https://github.com/ltdrdata/ComfyUI-Manager
cd ComfyUI-Manager || exit
git pull
pip install --upgrade -r requirements.txt
cd .. || exit

git clone https://github.com/ltdrdata/ComfyUI-Impact-Pack
cd ComfyUI-Impact-Pack || exit
git pull
pip install --upgrade -r requirements.txt
python install.py
cd .. || exit

git clone https://github.com/WASasquatch/was-node-suite-comfyui
cd was-node-suite-comfyui || exit
git pull
pip install --upgrade -r requirements.txt
cd .. || exit

git clone https://github.com/blepping/comfyui_jankdiffusehigh
cd comfyui_jankdiffusehigh || exit
git pull
pip install --upgrade -r requirements.txt
cd .. || exit

git clone https://github.com/pamparamm/ComfyUI-ppm
cd ComfyUI-ppm || exit
git pull
cd .. || exit

git clone https://github.com/exectails/comfyui-et_dynamicprompts
cd comfyui-et_dynamicprompts || exit
git pull
pip install --upgrade -r requirements.txt
cd .. || exit

git clone https://github.com/Fannovel16/comfyui_controlnet_aux
cd comfyui_controlnet_aux || exit
git pull
pip install --upgrade -r requirements.txt
cd .. || exit

git clone https://github.com/Munkyfoot/ComfyUI-TextOverlay
cd ComfyUI-TextOverlay || exit
git pull
cd .. || exit

git clone https://github.com/city96/ComfyUI-GGUF
cd ComfyUI-GGUF || exit
git pull
pip install --upgrade -r requirements.txt
cd .. || exit

git clone https://github.com/Extraltodeus/Skimmed_CFG
cd Skimmed_CFG || exit
git pull
cd .. || exit

exit 0
64 changes: 64 additions & 0 deletions swarmui-install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
#!/usr/bin/env bash

# Required packages: pyenv pyenv-virtualenv
# Modify .bashrc using pyenv init bash
# Commands that need to be run beforehand:
# pyenv install 3.11
# pyenv virtualenv 3.11 swarmui

# I add the following to my .zshrc:
# alias swarmuiu="cd /home/zen/m2b/ai-img/swarmui/ && sh /home/zen/m2a/fillets/linux/scripts/swarmui-comfyui-install-and-update-everything.sh && cd /home/zen/m2b/ai-img/swarmui/ && sh launch-linux.sh"
# alias swarmui="cd /home/zen/m2b/ai-img/swarmui/ && sh launch-linux.sh"

# Function to handle errors
handle_error() {
# Shellcheck warning can be ignored
local status=$?
local last_command="${BASH_COMMAND[@]}"
echo "Error: Command failed: $last_command (exit code: $status)" >&2
exit "$status"
}

# Set the trap to call handle_error on ERR (any command returning non-zero exit status)
trap handle_error ERR

# Check if an argument is provided
if [ -z "$1" ]; then
echo "Error: No directory provided."
echo "Usage: $0 <directory>"
exit 1
fi

# Check if the provided argument is a directory
if [ ! -d "$1" ]; then
echo "Error: '$1' is not a directory."
exit 1
fi

# Change directory
cd "$1" # trap handles failures

# Optional: Print the current working directory after changing
echo "Successfully changed directory to: $(pwd)"

# Clone the SwarmUI repository, navigate, and run the script
echo "Cloning SwarmUI..."
git clone https://github.com/mcmonkeyprojects/SwarmUI swarmui
echo "Cloning successful. Navigating to SwarmUI directory..."
cd swarmui # trap handles failures
echo "Setting up access to the pyenv virtualenv..."
pyenv local swarmui
echo "Checking for script..."
SCRIPT2="/home/zen/m2a/fillets/linux/scripts/swarmui-comfyui-install-and-update-everything.sh"
[ -f $SCRIPT2 ] # Make sure script exists.
[ -x $SCRIPT2 ] # Make sure script is executable.
$SCRIPT2
echo "SwarmUI setup complete."
echo "Make sure to customize settings during install and skip installing ComfyUI."
echo "Once in the UI, add ComfyUI in the Server/Backends tab,"
echo "set StartScript to dlbackend/comfyui/main.py and click save."

# Remove the trap before exiting to prevent it from triggering on the final exit
trap - ERR

exit 0

0 comments on commit 396cf36

Please sign in to comment.