-
Notifications
You must be signed in to change notification settings - Fork 0
/
start.sh
executable file
·48 lines (41 loc) · 1.3 KB
/
start.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#!/bin/bash
# Enhanced script to activate virtual environment, check required models, and start ComfyUI with MPS support
# Navigate to the script's directory (ComfyUI root directory)
cd "$(dirname "$0")"
# Activate the virtual environment
if [ -d "venv" ]; then
source venv/bin/activate
else
echo "Virtual environment not found. Please run setup_comfyui_models.sh first."
exit 1
fi
# Check for required models
declare -A required_models
required_models=(
["models/checkpoints"]="Base Model (.ckpt or .safetensors)"
["models/vae"]="VAE Model (.ckpt or .safetensors)"
["models/configs"]="Model Config Files (.yaml)"
)
missing_models=false
echo "Checking for required models..."
for dir in "${!required_models[@]}"; do
if [ -d "$dir" ]; then
files_count=$(ls -1q "$dir"/* 2>/dev/null | wc -l)
if [ "$files_count" -eq 0 ]; then
echo "Missing ${required_models[$dir]} in $dir"
missing_models=true
fi
else
echo "Directory $dir does not exist. Please run setup_comfyui_models.sh."
exit 1
fi
done
if [ "$missing_models" = true ]; then
echo "Some required models are missing. Please run setup_comfyui_models.sh."
exit 1
else
echo "All required models are present."
fi
# Start ComfyUI
echo "Starting ComfyUI..."
python main.py