ComfyUI
A powerful node-based interface for Stable Diffusion image generation workflows
Alternative To
- • Midjourney
- • DALL-E
- • Stable Diffusion WebUI
Difficulty Level
Requires some technical experience. Moderate setup complexity.
Overview
ComfyUI is a powerful and modular node-based interface for Stable Diffusion image generation that allows you to create complex workflows without coding. Unlike other interfaces, ComfyUI gives you visual control over the entire image generation pipeline through a flowchart-style interface, enabling advanced techniques and customizations.
System Requirements
- CPU: Intel Core i3 2nd Gen / AMD Bulldozer or better
- RAM: 8GB+ (16GB+ recommended for complex workflows)
- GPU: NVIDIA GPU with 4GB+ VRAM (8GB+ recommended), AMD GPU, Apple Silicon M-series, or Intel Arc
- Storage: 10GB+ for the application plus additional space for models (20GB+ recommended)
- OS: Windows, macOS (Monterey 12.6+), or Linux
Installation Guide
Prerequisites
- Basic knowledge of command line interfaces
- Git installed on your system (for manual installation)
- Python 3.10+ (for manual installation)
- NVIDIA GPU drivers, AMD drivers, or Apple Silicon with MPS (depending on your hardware)
Option 1: Windows Portable Installation (Easiest)
- Download the latest Windows portable version from the official GitHub releases page
- Extract the ZIP file using 7-Zip (right-click file → properties → unblock if needed)
- Run
run_nvidia_gpu.batfor NVIDIA GPUs orrun_cpu.batfor CPU-only mode - Access the interface at
http://localhost:8188in your browser
Option 2: Manual Installation (All Platforms)
Clone the repository:
git clone https://github.com/comfyanonymous/ComfyUI.gitNavigate to the project directory:
cd ComfyUIInstall dependencies:
pip install -r requirements.txtInstall platform-specific dependencies:
- For NVIDIA GPUs:
pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu121 - For AMD GPUs:
pip install torch-directml - For Apple Silicon: Refer to the PyTorch installation guide
- For NVIDIA GPUs:
Run the application:
python main.pyAccess the interface at
http://localhost:8188in your browser
Note: After installation, place Stable Diffusion model files (.ckpt or .safetensors format) in the ComfyUI/models/checkpoints directory to use them.
Practical Exercise: Creating Your First Image Generation Workflow
Let’s walk through a simple text-to-image workflow to help you get familiar with ComfyUI’s node-based interface.
Step 1: Load Required Models
- Download a Stable Diffusion XL model file (
.safetensorsformat) and place it in theComfyUI/models/checkpointsdirectory - Launch ComfyUI and access the web interface at
http://localhost:8188
Step 2: Create a Basic Text-to-Image Workflow
- Right-click on an empty area of the canvas and search for “Load Checkpoint” to add the node
- Click on the
ckpt_namefield and select your downloaded model - Right-click and add a “CLIP Text Encode” node (two of them)
- Right-click and add a “KSampler” node
- Right-click and add a “VAE Decode” node
- Right-click and add a “Preview Image” node
Step 3: Connect the Nodes
Connect the “Load Checkpoint” outputs to the corresponding inputs:
- “MODEL” output to the KSampler’s “model” input
- “CLIP” output to both CLIP Text Encode nodes’ “clip” input
- “VAE” output to the VAE Decode’s “vae” input
Connect one CLIP Text Encode node to the KSampler’s “positive” input (this is for your positive prompt)
Connect the other CLIP Text Encode node to the KSampler’s “negative” input (for negative prompt)
Connect the KSampler’s “LATENT” output to the VAE Decode’s “samples” input
Connect the VAE Decode’s “IMAGE” output to the Preview Image’s “images” input
Step 4: Configure and Run
In the positive CLIP Text Encode node, enter a prompt like “a beautiful sunset over mountains, professional photography, 8k”
In the negative CLIP Text Encode node, enter a negative prompt like “blurry, bad quality, distorted”
In the KSampler node, configure:
- Set “seed” to a random number
- Set “steps” to 20-30
- Set “cfg” to 7-8
- Leave other settings as default
Click “Queue Prompt” to generate your image
Step 5: Explore Advanced Features
Once you’re comfortable with the basics, try exploring more advanced techniques:
- Add ControlNet nodes for more precise control over image generation
- Experiment with LoRA models for specific styles or subjects
- Try image-to-image workflows with the “VAE Encode” node
- Use “LatentUpscale” nodes to create higher resolution images
- Install custom nodes using the ComfyUI Manager extension
Resources
Official Documentation
- GitHub Repository README - Main documentation and installation guides
- ComfyUI Community Manual - Community-maintained comprehensive documentation
Workflow Resources
- ComfyUI Examples - Official example workflows
- ComfyUI Nodes Info - Detailed information about all available nodes
Extensions and Custom Nodes
- ComfyUI Manager - Essential extension for installing and managing other custom nodes
- Awesome ComfyUI - Curated list of the best custom nodes
Community Support
- Matrix Space: #comfyui_space:matrix.org - Official community chat
- GitHub Issues - Bug reports and feature requests
- Reddit: r/StableDiffusion - Larger Stable Diffusion community with ComfyUI discussion
Tutorials and Guides
- Stable Diffusion Art: ComfyUI Beginner’s Guide - Excellent starter guide
- Stable Diffusion Art: ComfyUI Installation - Detailed installation instructions
Suggested Projects
You might also be interested in these similar projects:
An optimized Stable Diffusion WebUI with improved performance, reduced VRAM usage, and advanced features
Generate high-quality images from text prompts using self-hosted Stable Diffusion models
A user-friendly image generation platform based on Stable Diffusion XL with Midjourney-like simplicity