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.
- 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. - 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." - Place Your Models: Copy your Stable Diffusion checkpoint files (the large
.ckpt
or.safetensors
files) into theComfyUI\models\checkpoints
directory. - 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.
Clone the Repository: Open a terminal or command prompt and use Git to clone the ComfyUI repository:
bashgit clone https://github.com/comfyanonymous/ComfyUI.git
Navigate to the Directory: Change your directory to the cloned ComfyUI folder:
bashcd ComfyUI
Install PyTorch: Install the stable version of PyTorch for NVIDIA GPUs:
bashpip install torch torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/cu124
Alternatively, for potentially better performance, install the nightly build:
bashpip 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.Install Dependencies: Install the required Python packages:
bashpip install -r requirements.txt
Place Your Models: Move your Stable Diffusion checkpoints to
models/checkpoints
and your VAE files tomodels/vae
.Run ComfyUI: Execute ComfyUI using the following command:
bashpython 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.
- Locate the Config File: In the standalone build, find the
extra_model_paths.yaml.example
file within the ComfyUI directory. - Rename the File: Rename it to
extra_model_paths.yaml
. - 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!