For the installation of ComfyUI, it is mainly divided into several steps:

  1. Create a virtual environment(avoid polluting the system-level Python environment)
  2. Clone the ComfyUI code repository
  3. Install dependencies
  4. Start ComfyUI

You can also refer to ComfyUI CLI to install ComfyUI, it is a command line tool that can easily install ComfyUI and manage its dependencies.

Create a virtual environment

Independent virtual environments are necessary because ComfyUI’s dependencies may conflict with other dependencies on the system, and it can also avoid polluting the system-level Python environment.

Install Miniconda. This will help you install the correct versions of Python and other libraries needed by ComfyUI.

Create an environment with Conda.

conda create -n comfyenv
conda activate comfyenv

Clone the ComfyUI code repository

You need to ensure that you have installed Git on your system. First, you need to open the terminal (command line), then clone the code repository.

If you have not installed Microsoft Visual C++ Redistributable, please install it here.
git clone git@github.com:comfyanonymous/ComfyUI.git

Install GPU and ComfyUI dependencies

1

Install GPU dependencies

Install GPU Dependencies

2

Install ComfyUI dependencies

cd ComfyUI
pip install -r requirements.txt
3

Start ComfyUI

Start the application

cd ComfyUI
python main.py

How to update ComfyUI

1

pull the latest code

Use the command line to enter the installation path of ComfyUI, then pull the latest code.

cd <installation path>/ComfyUI
git pull
2

install the dependencies

Use the command line to enter the installation path of ComfyUI, then install the dependencies.

You need to ensure that the current Python environment is the ComfyUI virtual environment, otherwise the dependencies will be installed to the system-level Python environment, polluting the system-level Python environment.

pip install -r requirements.txt