Current location: Home> Ai Course> AI Basics

How to install ComfyUI on Linux? ComfyUI Installation Guide on Linux

Author: LoRA Time: 10 Mar 2025 1020

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:

1741584688169750.png

1. Cloning the repository

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

2. Place the model file

Place your Stable Diffusion checkpoint (ckpt/safetensors file) in the models/checkpoints directory.

3. Install PyTorch

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

4. Installation dependencies

Open the terminal in the ComfyUI directory and run the following command to install all required dependencies:

 pip install -r requirements.txt

5. Run ComfyUI

After the installation is complete, start ComfyUI by running the following Python command:

 python main.py

6. Things to note for AMD GPU users

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

7. Intel GPU users

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.

8. Mac silicon chip users

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.