Installing ComfyUI on Windows with NVIDIA GPUs

Introduction

ComfyUI is a powerful and modular GUI and backend for working with stable diffusion models. Its node-based interface allows you to design and execute complex stable diffusion pipelines without writing code. This guide will walk you through installing ComfyUI on a Windows system equipped with an NVIDIA GPU.

Prerequisites

Before you begin, ensure you have the following:

  • A Windows operating system.
  • An NVIDIA GPU with updated drivers.
  • 7-Zip installed for extracting files. You can download it from 7-zip.org.
  • Git (optional, for manual installation).

Installation Methods

There are two primary ways to install ComfyUI on Windows:

1. Using the Standalone Build (Recommended for Beginners)

This method is the simplest and involves downloading a pre-packaged version of ComfyUI.

  1. Download the Standalone Build: Head over to the ComfyUI releases page on GitHub: ComfyUI Releases. Download the latest portable build for Windows NVIDIA (e.g., ComfyUI_windows_portable_nvidia.7z). Here's a direct link to the latest release: Direct Download Link.
  2. Extract the Archive: Use 7-Zip to extract the downloaded .7z file to your desired location. If you encounter issues, right-click the file, go to "Properties," and select "Unblock."
  3. Place Your Models: Copy your Stable Diffusion checkpoint files (the large .ckpt or .safetensors files) into the ComfyUI\models\checkpoints directory.
  4. Run ComfyUI: Navigate to the extracted ComfyUI folder and run run_nvidia_gpu.bat. This will launch the ComfyUI interface in your default web browser.

2. Manual Installation (For Advanced Users)

This method involves cloning the ComfyUI repository and manually setting up the environment.

  1. Clone the Repository: Open a terminal or command prompt and use Git to clone the ComfyUI repository:

    bash
    |
    git clone https://github.com/comfyanonymous/ComfyUI.git
  2. Navigate to the Directory: Change your directory to the cloned ComfyUI folder:

    bash
    |
    cd ComfyUI
  3. Install PyTorch: Install the stable version of PyTorch for NVIDIA GPUs:

    bash
    |
    pip install torch torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/cu124

    Alternatively, for potentially better performance, install the nightly build:

    bash
    |
    pip install --pre torch torchvision torchaudio --index-url https://download.pytorch.org/whl/nightly/cu126

    Troubleshooting: If you encounter the error "Torch not compiled with CUDA enabled," uninstall torch with pip uninstall torch and reinstall it using the appropriate command above.

  4. Install Dependencies: Install the required Python packages:

    bash
    |
    pip install -r requirements.txt
  5. Place Your Models: Move your Stable Diffusion checkpoints to models/checkpoints and your VAE files to models/vae.

  6. Run ComfyUI: Execute ComfyUI using the following command:

    bash
    |
    python main.py

Sharing Models with Other UIs

If you're already using another Stable Diffusion UI and want to share models with ComfyUI, you can modify the model search paths.

  1. Locate the Config File: In the standalone build, find the extra_model_paths.yaml.example file within the ComfyUI directory.
  2. Rename the File: Rename it to extra_model_paths.yaml.
  3. Edit the File: Open the file with a text editor and modify the paths to point to your existing model directories.

Conclusion

You have now successfully installed ComfyUI on your Windows system with an NVIDIA GPU. You can start exploring its node-based interface and create your own advanced stable diffusion workflows. For examples and inspiration, visit the ComfyUI Examples page. Enjoy!