Files
2024-03-16 13:58:21 +02:00

5.0 KiB

Install ComfyUI, ComfyUI-Manager, and ComfyUI-ControlnetAux Node.

Note: It's important to mention that accessing certain features of these libraries might not be available on the free tier of their respective services. Advanced functionalities or extended usage may require a paid subscription or upgraded plan.

In [1]:
import os
# define directories paths for the colab notebook
comfyui_directory = '/content/ComfyUI/'
custom_nodes_directory = '/content/ComfyUI/custom_nodes/'
manager_directory = '/content/ComfyUI/custom_nodes/ComfyUI-Manager'
controlaux_directory = '/content/ComfyUI/custom_nodes/ComfyUI-ControlnetAux'

Download ComfyUI, ComfyUI-Manager and ComfyUI-ControlnetAux

In [ ]:
# Clone ComfyUI repo 
!git clone https://github.com/comfyanonymous/ComfyUI
In [ ]:
# Clone ComfyUI-Manager and ComfyUI-ControlnetAux repos in custom_nodes folder.
os.chdir(custom_nodes_directory)
!git clone https://github.com/ltdrdata/ComfyUI-Manager
!git clone https://github.com/madtunebk/ComfyUI-ControlnetAux

Install Requirements for ComfyUI, ComfyUI-Manager and ComfyUI-ControlnetAux

In [ ]:
# Install Requirements for ComfyUI
os.chdir(comfyui_directory)
!pip install -r requirements.txt
In [ ]:
# Install Requirements for ComfyUI-Manager
os.chdir(manager_directory)
!pip install -r requirements.txt
In [ ]:
# Install Requirements for ComfyUI-ControlnetAux
os.chdir(controlaux_directory)
!pip install -r requirements.txt
In [ ]:
# Install pyngrok. (To access the web UI, you need to install pyngrok.)
!pip install pyngrok

### From here: https://dashboard.ngrok.com/get-started/setup/linux, you can get the authentication token. ###
### You may need to create an account if you don't have one. ###
!ngrok config add-authtoken < authentication token >
In [ ]:
# Start ComfyUI Server in background and get the ngrok public url
from pyngrok import ngrok

os.chdir(comfyui_directory)
!python main.py --preview-method auto > /dev/null 2>&1 &
In [ ]:
port = 8188
print(ngrok.connect(port).public_url)