ComfyUI is a powerful and modular Stable Diffusion GUI and backend that provides a graph/node/flow diagram-based interface that allows you to design and execute advanced Stable Diffusion workflows without coding. Here are the steps to install ComfyUI on Linux system:
First, you need to clone ComfyUI's repository locally through Git. Open the terminal and run the following command:
git clone https://github.com/comfyanonymous/ComfyUI.git
Place your Stable Diffusion checkpoint (ckpt/safetensors file) in the models/checkpoints directory.
Install PyTorch according to your GPU type. For AMD GPUs, you can install a stable version of PyTorch or pytorch nightly using the following command:
pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/rocm6.0 # or pip install --pre torch torchvision torchvision torchaudio --index-url https://download.pytorch.org/whl/nightly/rocm6.1
For NVIDIA GPUs, install using the following command:
pip install torch torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/cu121# or pip install --pre torch torchvision torchvision torchaudio --index-url https://download.pytorch.org/whl/nightly/cu124
Open the terminal in the ComfyUI directory and run the following command to install all required dependencies:
pip install -r requirements.txt
After the installation is complete, start ComfyUI by running the following Python command:
python main.py
If you are using an AMD GPU and are not officially supported by ROCm, you may need to set environment variables to override the GPU version:
HSA_OVERRIDE_GFX_VERSION=10.3.0 python main.py# or for RDNA3 architecture cards, such as 7600: HSA_OVERRIDE_GFX_VERSION=11.0.0 python main.py
If you are using an Intel GPU, you need to install the corresponding driver, Basekit, and IPEX packages according to the installation page of Intel's Extension for Pytorch (IPEX), and then run ComfyUI according to the manual installation instructions for Linux.
If you are using Apple's M1 or M2 chips, you need to install the latest PyTorch nightly version and follow the manual installation instructions for Windows and Linux.