Thelocallab commited on
Commit
9e3fe7d
·
verified ·
1 Parent(s): 1a30bb6

Upload flux_tranier_BJT_installer.sh

Browse files
Files changed (1) hide show
  1. flux_tranier_BJT_installer.sh +90 -0
flux_tranier_BJT_installer.sh ADDED
@@ -0,0 +1,90 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/bin/bash
2
+
3
+ # Function to check if a command exists
4
+ command_exists() {
5
+ command -v "$1" >/dev/null 2>&1
6
+ }
7
+
8
+ # Create installation directory
9
+ mkdir -p comfyui-installer
10
+ cd comfyui-installer
11
+
12
+ # Install required packages if not present
13
+ echo "Checking and installing required packages..."
14
+ if ! command_exists curl; then
15
+ sudo yum update -y && sudo yum install -y curl
16
+ fi
17
+ if ! command_exists git; then
18
+ sudo yum install -y git
19
+ fi
20
+
21
+ # Download and install Miniconda if not exists
22
+ if [ ! -d "miniconda3" ]; then
23
+ echo "Downloading Miniconda..."
24
+ curl -L -o miniconda.sh https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh
25
+
26
+ if [ $? -ne 0 ]; then
27
+ echo "Error downloading Miniconda. Please check your internet connection and try again."
28
+ exit 1
29
+ fi
30
+
31
+ echo "Installing Miniconda..."
32
+ bash miniconda.sh -b -p $PWD/miniconda3
33
+ rm miniconda.sh
34
+ fi
35
+
36
+ # Add Miniconda to PATH for this session
37
+ export PATH="$PWD/miniconda3/bin:$PATH"
38
+
39
+ # Create and activate conda environment
40
+ echo "Creating conda environment for ComfyUI..."
41
+ conda create -y -n comfyui-env python=3.10
42
+
43
+ # Activate the conda environment in the script (using 'source')
44
+ source activate comfyui-env
45
+
46
+ # Clone ComfyUI repositories
47
+ echo "Cloning ComfyUI and dependencies..."
48
+ git clone https://github.com/comfyanonymous/ComfyUI.git
49
+ cd ComfyUI
50
+ git clone https://github.com/ltdrdata/ComfyUI-Manager.git custom_nodes/ComfyUI-Manager
51
+ git clone https://github.com/rgthree/rgthree-comfy.git custom_nodes/rgthree-comfy
52
+ git clone https://github.com/kijai/ComfyUI-FluxTrainer.git custom_nodes/ComfyUI-FluxTrainer
53
+ git clone https://github.com/LarryJane491/Image-Captioning-in-ComfyUI.git custom_nodes/Image-Captioning-in-ComfyUI
54
+ git clone https://github.com/kijai/ComfyUI-KJNodes.git custom_nodes/ComfyUI-KJNodes
55
+ git clone https://github.com/WASasquatch/was-node-suite-comfyui.git custom_nodes/was-node-suite-comfyui
56
+ cd ..
57
+
58
+ # Install Python requirements for ComfyUI within the activated environment
59
+ echo "Installing ComfyUI Python requirements..."
60
+ cd ComfyUI
61
+
62
+ # Ensure pip is using the correct version for the activated environment.
63
+ pip install --upgrade pip # Upgrade pip to the latest version in case it's outdated.
64
+
65
+ pip install -r requirements.txt
66
+ pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu118
67
+ pip install -r ./custom_nodes/ComfyUI-Manager/requirements.txt
68
+ pip install -r ./custom_nodes/ComfyUI-FluxTrainer/requirements.txt
69
+ pip install -r ./custom_nodes/ComfyUI-KJNodes/requirements.txt
70
+ pip install -r ./custom_nodes/rgthree-comfy/requirements.txt
71
+ pip install -r ./custom_nodes/was-node-suite-comfyui/requirements.txt
72
+
73
+ cd ..
74
+
75
+ # Create start-comfyui.sh script to run ComfyUI easily later on.
76
+ echo "Creating start-comfyui.sh script..."
77
+ cat > start-comfyui.sh << 'EOF'
78
+ #!/bin/bash
79
+ cd "$(dirname "$0")/ComfyUI"
80
+ source ../miniconda3/bin/activate comfyui-env # Activate the environment when starting ComfyUI.
81
+ python main.py --listen # Start ComfyUI.
82
+ EOF
83
+
84
+ chmod +x start-comfyui.sh
85
+
86
+ echo "Installation completed successfully!"
87
+ echo "To start ComfyUI, run ./start-comfyui.sh from the comfyui-installer directory."
88
+ echo "ComfyUI will be accessible at http://your_server_ip:8188"
89
+
90
+ pause