-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathconda-start.sh
50 lines (40 loc) · 1.47 KB
/
conda-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
49
50
#!/bin/bash
# Set up environment variables
ENV_NAME=$(basename "$PWD")
INSTALL_DIR="$HOME/Miniconda3"
export PATH="$INSTALL_DIR/condabin:$PATH"
COMFY_MANAGER_DIR="$(dirname "$0")/../ComfyUI-Manager"
COMFYUI_DIR="$(dirname "$0")/../.."
# Check if conda environment is available and create it if not
if conda info --envs | grep -i "$ENV_NAME"; then
echo "$ENV_NAME environment is already available"
else
echo "$ENV_NAME environment does not exist"
echo "Creating a new environment"
conda create -n "$ENV_NAME" python=3.10 -y
fi
# Activate environment
source activate "$ENV_NAME"
if [ $? -eq 0 ]; then
# Install custom node dependencies
pip install -r requirements.txt
# Install ComfyUI Manager
if [ -d "$COMFY_MANAGER_DIR" ]; then
cd "$COMFY_MANAGER_DIR"
git pull
else
git clone https://github.com/ltdrdata/ComfyUI-Manager "$COMFY_MANAGER_DIR"
pip install -r "$COMFY_MANAGER_DIR/requirements.txt"
fi
# Change the working directory to the root folder
cd "$COMFYUI_DIR"
# Install packages
pip install -r requirements.txt
mim install mmengine mmcv>=2.0.1 mmdet>=3.1.0 mmpose>=1.1.0
# Install CUDA torch
pip install torch==2.3.1+cu118 torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/cu118
python main.py --preview-method=taesd --force-fp16 --use-pytorch-cross-attention
else
echo "Failed to activate environment..."
fi
read -p "Press any key to continue..."