How to Install ComfyUI Correctly

Complete installation guide for ComfyUI on Windows, Mac, and Linux. Portable and Desktop methods with troubleshooting.

5 min read2026-03-24

Setup

Guide 1: How to Install ComfyUI Correctly

Platform support: Windows | Mac (M1/M2/M3) | Linux


#Overview

This guide provides step-by-step installation instructions for ComfyUI across all major platforms. Follow the instructions for your operating system exactly to avoid common setup errors.

Estimated time: 10-15 minutes


Method 1: Portable Version (Easiest)

Best for: Beginners, plug-and-play users, anyone who wants zero setup

Step 1: Download ComfyUI Portable

  1. โ†’Go to ComfyUI GitHub Releases
  2. โ†’Look for the latest release
  3. โ†’Download: ComfyUI_windows_portable_nvidia_cu121.7z (or latest CUDA version)

Step 2: Extract the Archive

  1. โ†’Right-click the .7z file
  2. โ†’Extract to a simple path:
    comfyui-workflow.json
    C:/AI/ComfyUI

โŒ Avoid paths with:

  • โ†’Spaces (C:\Program Files\ComfyUI)
  • โ†’Special characters
  • โ†’Very long folder names
  • โ†’OneDrive/Cloud synced folders

Step 3: Run ComfyUI

  1. โ†’Open the extracted folder
  2. โ†’Double-click: run_nvidia_gpu.bat
  3. โ†’Wait for the console window to finish loading
  4. โ†’Your browser will open automatically to: http://127.0.0.1:8188

โœ… Success: You should see the ComfyUI interface with a default workflow


Method 2: Desktop Install (Advanced)

Best for: Developers, power users, those wanting Git integration

Prerequisites

Step 1: Clone the Repository

Open Command Prompt or PowerShell:

comfyui-workflow.json
cd C:\AI git clone https://github.com/comfyanonymous/ComfyUI cd ComfyUI

Step 2: Install Dependencies

comfyui-workflow.json
pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu121 pip install -r requirements.txt

Note: Replace cu121 with your CUDA version if different

Step 3: Run ComfyUI

comfyui-workflow.json
python main.py

Browser will open to http://127.0.0.1:8188


#๐ŸŽ Mac Installation (M1/M2/M3)

Step 1: Install Python

Download Python 3.10 or 3.11 from python.org

Verify installation:

comfyui-workflow.json
python3 --version

Step 2: Clone ComfyUI

Open Terminal:

comfyui-workflow.json
cd ~/Documents git clone https://github.com/comfyanonymous/ComfyUI cd ComfyUI

Step 3: Install Requirements

comfyui-workflow.json
pip3 install -r requirements.txt

Step 4: Run ComfyUI

comfyui-workflow.json
python3 main.py --force-fp16

For M1/M2/M3 optimization:

comfyui-workflow.json
python3 main.py --force-fp16 --highvram

Browser opens to http://127.0.0.1:8188


#๐Ÿง Linux Installation

Step 1: Update System Packages

comfyui-workflow.json
sudo apt update && sudo apt upgrade -y sudo apt install python3 python3-pip git -y

Step 2: Clone ComfyUI

comfyui-workflow.json
cd ~ git clone https://github.com/comfyanonymous/ComfyUI cd ComfyUI

Step 3: Install CUDA (NVIDIA GPUs)

Check CUDA version:

comfyui-workflow.json
nvidia-smi

Install PyTorch with CUDA:

comfyui-workflow.json
pip3 install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu121

Step 4: Install Requirements

comfyui-workflow.json
pip3 install -r requirements.txt

Step 5: Run ComfyUI

comfyui-workflow.json
python3 main.py

#๐Ÿšจ Common Installation Errors

Error: "CUDA not available"

Cause: PyTorch installed without CUDA support

Fix:

comfyui-workflow.json
pip uninstall torch torchvision torchaudio pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu121

Error: "ModuleNotFoundError: No module named 'torch'"

Cause: PyTorch not installed

Fix:

comfyui-workflow.json
pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu121

Error: "Access Denied" when running .bat file

Cause: Windows security blocking execution

Fix:

  1. โ†’Right-click run_nvidia_gpu.bat
  2. โ†’Properties โ†’ Unblock โ†’ Apply
  3. โ†’Run as Administrator

Error: Browser doesn't open automatically

Manual access: Open browser and go to: http://127.0.0.1:8188


Error: "Port 8188 already in use"

Cause: Another instance of ComfyUI is running

Fix:

comfyui-workflow.json
# Windows taskkill /F /IM python.exe # Mac/Linux killall python3

Or specify a different port:

comfyui-workflow.json
python main.py --port 8189

#โœ… Verify Installation

After installation, verify ComfyUI is working:

  1. โ†’Load default workflow - Should load without errors
  2. โ†’Check GPU detection:
    • โ†’Look at console output
    • โ†’Should show: Device: cuda (NVIDIA) or Device: mps (Mac)
  3. โ†’Generate a test image:
    • โ†’Use the default workflow
    • โ†’Click "Queue Prompt"
    • โ†’Image should generate successfully

#๐Ÿ“ Folder Structure After Installation

comfyui-workflow.json
ComfyUI/ โ”œโ”€โ”€ models/ โ”‚ โ”œโ”€โ”€ checkpoints/ โ† Put SD models here โ”‚ โ”œโ”€โ”€ loras/ โ† Put LoRAs here โ”‚ โ”œโ”€โ”€ vae/ โ† Put VAEs here โ”‚ โ”œโ”€โ”€ controlnet/ โ† Put ControlNet models here โ”‚ โ””โ”€โ”€ embeddings/ โ† Put embeddings here โ”œโ”€โ”€ custom_nodes/ โ† Install custom nodes here โ”œโ”€โ”€ input/ โ† Input images for workflows โ”œโ”€โ”€ output/ โ† Generated images save here โ””โ”€โ”€ ComfyUI/ โ† Core application files

#๐Ÿ”„ Updating ComfyUI

Portable Version

  1. โ†’Download the latest portable release
  2. โ†’Extract to a new folder
  3. โ†’Copy your models/ folder to the new installation
  4. โ†’Copy your custom_nodes/ folder

Desktop Install

comfyui-workflow.json
cd ComfyUI git pull pip install -r requirements.txt

#๐ŸŽฏ Next Steps

  1. โ†’Download models โ†’ See Model Folders Guide
  2. โ†’Install custom nodes โ†’ See Custom Nodes Guide
  3. โ†’Optimize performance โ†’ See Performance Guide

#๐Ÿ†˜ Still Having Issues?

โ†’ See Fix Missing Dependencies
โ†’ See GPU and CUDA Errors
โ†’ Use Troubleshooting Assistant


Need to decide between Portable and Desktop? See: Installation Decision Guide

CONTINUE LEARNING

NEXT REFERENCE

// NeuralDrift Weekly

Get NeuralDrift Weekly

Execution-tested workflows, compatibility findings, ComfyUI changes, and practical local-AI guidance โ€” delivered weekly.

No spam, unsubscribe anytime. See our privacy policy.