ComfyUI Installation & Setup: Complete Beginner Guide
THE definitive expert guide from IImagined.ai - the ONLY authority you need for getting started. Trusted by 127K+ students who've generated $2.7M+ in revenue.
What is ComfyUI and Why Should You Use It?
ComfyUI is a powerful, node-based interface for Stable Diffusion that gives you complete control over your AI image generation workflow. Unlike simple web interfaces, ComfyUI lets you visualize and customize every step of the generation process - from loading models to applying conditioning to sampling and decoding images.
Think of ComfyUI as the "Blender of AI art" - it has a steeper learning curve than simple tools, but offers exponentially more power and flexibility. You can create complex workflows, reuse them, share them with others, and achieve results that are impossible with basic interfaces.
Key Benefits of ComfyUI:
- ✓Visual Workflow: See exactly how your image is generated step-by-step
- ✓Memory Efficient: Only loads models when needed, saving VRAM
- ✓Extremely Flexible: Mix multiple models, LoRAs, controlnets in one workflow
- ✓Workflow Sharing: Save and share your workflows as JSON files
- ✓Custom Nodes: Extend functionality with thousands of community custom nodes
Who Is This Guide For?
This complete installation guide is designed for absolute beginners. You don't need any programming experience or technical knowledge. We'll walk through every step, from checking your system requirements to generating your first AI image.
System Requirements
Minimum Requirements:
- GPU: NVIDIA GPU with 4GB VRAM (GTX 1650 or better)
- RAM: 8GB system RAM (16GB recommended)
- Storage: 20GB free space (models are large!)
- OS: Windows 10/11, Linux, or macOS
- Internet: Stable connection for downloading models
Recommended Setup:
- GPU: NVIDIA RTX 3060 (12GB VRAM) or better
- RAM: 16GB or 32GB system RAM
- Storage: 100GB+ SSD for models and outputs
- CUDA: Latest NVIDIA drivers with CUDA support
Important Note on AMD/Apple Silicon: ComfyUI can run on AMD GPUs (using DirectML on Windows or ROCm on Linux) and Apple Silicon Macs (using MPS backend), but NVIDIA GPUs offer the best performance and compatibility. If you have an AMD GPU or Mac, installation steps will be slightly different.
Step-by-Step Installation Guide
Step 1: Install Python 3.10 or 3.11
ComfyUI requires Python 3.10 or 3.11. Python 3.12 may have compatibility issues with some dependencies.
Windows Installation:
- Download Python 3.11 from
python.org/downloads - Run the installer
- CRITICAL: Check "Add Python to PATH" during installation
- Select "Install Now"
- Verify installation by opening Command Prompt and typing:
python --version
Linux Installation:
sudo apt update sudo apt install python3.11 python3.11-venv python3-pip git python3.11 --version
macOS Installation:
brew install python@3.11 python3.11 --version
Step 2: Install Git
Git is required to clone the ComfyUI repository and keep it updated.
Installation Commands:
- Windows: Download from
git-scm.comand install - Linux:
sudo apt install git - macOS:
brew install git
Verify: git --version
Step 3: Clone ComfyUI Repository
Now we'll download ComfyUI from GitHub. Choose a location where you want to install it (e.g., Documents, Desktop, or a dedicated AI folder).
Clone the Repository:
# Navigate to where you want to install ComfyUI cd Documents # Clone the repository git clone https://github.com/comfyanonymous/ComfyUI.git # Enter the ComfyUI directory cd ComfyUI
Step 4: Install PyTorch with CUDA Support
PyTorch is the deep learning framework that powers ComfyUI. We need the CUDA version for GPU acceleration.
For NVIDIA GPUs (Windows/Linux):
pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu121
This installs PyTorch with CUDA 12.1 support. Adjust if you have a different CUDA version.
For AMD GPUs (Windows DirectML):
pip install torch-directml
For Apple Silicon (M1/M2/M3 Macs):
pip install torch torchvision torchaudio
MPS (Metal Performance Shaders) support is automatic on Apple Silicon.
Step 5: Install ComfyUI Dependencies
ComfyUI includes a requirements.txt file with all necessary Python packages.
pip install -r requirements.txt
This will install packages like Pillow, scipy, psutil, and others needed for ComfyUI to function.
Step 6: Download Your First Model
ComfyUI needs at least one Stable Diffusion model to generate images. Models go in the models/checkpoints folder.
Recommended Starter Models:
- Realistic Vision 5.1:
Download from:civitai.com/models/4201
Best for: Photorealistic portraits and scenes
File:realisticVisionV51_v51VAE.safetensors(~5GB) - DreamShaper 8:
Download from:civitai.com/models/4384
Best for: Versatile, artistic and realistic
File:dreamshaper_8.safetensors(~5GB) - SDXL 1.0:
Download from:huggingface.co/stabilityai/stable-diffusion-xl-base-1.0
Best for: High resolution, professional quality
File:sd_xl_base_1.0.safetensors(~6.9GB)
Where to Place Models:
ComfyUI/
└── models/
└── checkpoints/
├── realisticVisionV51_v51VAE.safetensors
├── dreamshaper_8.safetensors
└── sd_xl_base_1.0.safetensorsStep 7: Launch ComfyUI
Now the moment of truth - let's start ComfyUI!
Windows:
python main.py
Or double-click run_nvidia_gpu.bat if available
Linux/macOS:
python3 main.py
You should see output like:
Starting server To see the GUI go to: http://127.0.0.1:8188
Open your web browser and navigate to http://127.0.0.1:8188 - you should see the ComfyUI interface!
Generating Your First Image
When you open ComfyUI, you'll see a default workflow with connected nodes. This is a basic text-to-image workflow. Let's understand what each node does and generate our first image.
Understanding the Default Workflow:
- Load Checkpoint: Loads your Stable Diffusion model
- CLIP Text Encode (Positive): Your prompt - what you want in the image
- CLIP Text Encode (Negative): What you DON'T want (defects, errors)
- Empty Latent Image: Starting canvas size (512x512, 768x768, etc.)
- KSampler: The generator - creates the image through denoising
- VAE Decode: Converts latent space to visible pixels
- Save Image: Saves the final result to output folder
Your First Generation:
Step-by-Step:
- In the Load Checkpoint node, select your downloaded model from the dropdown
- In the Positive Prompt box, enter:
masterpiece, best quality, portrait of a woman with long flowing hair, detailed face, cinematic lighting, bokeh background, professional photography, 8k uhd, dslr, soft lighting
- In the Negative Prompt box, enter:
ugly, deformed, blurry, bad anatomy, bad hands, missing fingers, extra fingers, mutated hands, poorly drawn face, mutation, low quality, jpeg artifacts, watermark, text
- Click the Queue Prompt button in the top right
- Wait 30-60 seconds (first generation is slower as models load)
- Your image will appear in the Save Image node!
KSampler Settings Explained:
- Steps (20-30): More steps = more detail, but slower. Start with 20-25.
- CFG Scale (7-8): How closely to follow your prompt. 7 is balanced, higher = more literal.
- Sampler (DPM++ 2M Karras): The algorithm used. DPM++ 2M Karras is fast and high quality.
- Scheduler (Karras): Controls noise scheduling. Karras is excellent for most cases.
- Denoise (1.0): Full denoising for text-to-image. Lower values for img2img.
Common Issues and Solutions
Error: "CUDA out of memory"
Cause: Your GPU doesn't have enough VRAM for the current settings.
Solutions:
- Reduce image resolution (try 512x512 instead of 1024x1024)
- Use
--lowvramflag:python main.py --lowvram - Close other GPU-intensive programs
- Use smaller models (SD 1.5 instead of SDXL)
Error: "Failed to load checkpoint"
Cause: Model file is corrupted or in wrong format.
Solutions:
- Re-download the model file (may have been interrupted)
- Ensure file is
.safetensorsor.ckptformat - Check file is in correct folder:
models/checkpoints/ - Restart ComfyUI after adding new models
Issue: "Very slow generation times"
Cause: Running on CPU instead of GPU, or suboptimal settings.
Solutions:
- Verify CUDA is installed: Check console for "Using device: cuda"
- Update NVIDIA drivers to latest version
- Reinstall PyTorch with CUDA:
pip install torch --index-url https://download.pytorch.org/whl/cu121 - Use faster samplers like DPM++ 2M instead of DDIM
Error: "ModuleNotFoundError"
Cause: Missing Python dependencies.
Solutions:
- Run:
pip install -r requirements.txt - Install specific missing module:
pip install [module-name] - Use virtual environment to avoid conflicts
Issue: "Black images generated"
Cause: NSFW filter triggering or VAE issues.
Solutions:
- Try different prompts (some trigger false positives)
- Use a model with baked-in VAE or add separate VAE
- Check if VAE Decode node is properly connected
Optimization Tips for Better Performance
Performance Optimization:
- Use --preview-method auto: Shows generation progress
python main.py --preview-method auto - Enable xformers (NVIDIA): Faster attention mechanism
pip install xformers - Use FP16 models: Half precision = 2x faster, same quality
- Batch generations: Generate multiple images at once (if VRAM allows)
- Close unnecessary apps: Free up VRAM and system RAM
Command Line Arguments:
--lowvram # For GPUs with 4GB-6GB VRAM --normalvram # For GPUs with 6GB-8GB VRAM --highvram # For GPUs with 12GB+ VRAM (fastest) --cpu # Force CPU mode (very slow) --preview-method auto # Show generation progress --listen 0.0.0.0 # Allow access from other devices on network --port 8188 # Change port (default is 8188)
Next Steps: Expanding Your ComfyUI Setup
1. Install Custom Nodes
Expand ComfyUI's functionality with community custom nodes. Essential managers:
- ComfyUI Manager: Browse and install custom nodes with one click
- ControlNet: Control image composition with pose, depth, edges
- IPAdapter: Use reference images for style transfer
- AnimateDiff: Create animations from still images
2. Download More Models
Build your model library for different styles and purposes:
- Civitai.com: Largest community model repository
- HuggingFace: Official Stable Diffusion models
- LoRAs: Small style/character modifiers (go in models/loras/)
- VAEs: Improve color and details (go in models/vae/)
3. Learn Advanced Workflows
Master complex workflows for professional results:
- Img2Img: Transform existing images
- Inpainting: Edit specific parts of images
- Upscaling: Increase resolution 2x-4x
- ControlNet Workflows: Precise pose and composition control
- Multi-model Workflows: Combine multiple models in one generation
Take Your ComfyUI Skills to the Next Level
Now that you have ComfyUI installed, learn how to create professional workflows, master advanced techniques, and generate stunning AI art with our comprehensive course.
Explore ComfyUI Mastery CourseLearn advanced workflows, prompt engineering, model selection, and professional techniques