Why ComfyUI?
When Midjourney charges $10-60/month and DALL-E charges per image, running your own image generator sounds expensive. It’s not. A used $150 GPU generates unlimited images, forever, for free.
ComfyUI is the most powerful local image generation interface. It’s node-based — you wire together models, prompts, and post-processing into a visual workflow. It looks intimidating, but once you understand the basics, it’s more flexible than any commercial tool.
ComfyUI vs Alternatives
| Tool | Interface | Flexibility | Learning Curve |
|---|---|---|---|
| ComfyUI | Node-based | Maximum | Medium |
| Automatic1111 | Form-based | Good | Low |
| Fooocus | Form-based | Limited | Very low |
| Midjourney | Discord prompts | Limited | Very low (but cloud) |
We use ComfyUI because it’s the most powerful. Once you build a workflow, you can reproduce it endlessly, share it as a JSON file, and automate it via API.
What You Need
Minimum
- GPU with 6GB+ VRAM (8GB recommended)
- 10GB free disk space (for models)
- Python 3.10+
- Git
Recommended
- GPU with 8GB+ VRAM (RTX 3060 Ti or better)
- 20GB+ free disk space (multiple models add up)
- SSD for model storage (loading 4GB models from HDD is slow)
Installation
Linux (Ubuntu/Debian)
| |
Open http://localhost:8188 in your browser.
Windows
| |
Portable Windows Package (Easier)
- Go to github.com/comfyanonymous/ComfyUI/releases
- Download the Windows portable package (.7z)
- Extract and run
run_nvidia_gpu.bat - Open
http://localhost:8188
Downloading Your First Model
ComfyUI needs a model (checkpoint) to generate images. The most popular starting point:
SDXL Base Model
| |
This is a 6.9GB file. It’s the base SDXL model — good for general image generation.
Better Models for Photorealism
SDXL is good, but the community has fine-tuned it for better results:
| Model | Best For | Size | Source |
|---|---|---|---|
| SDXL Base | General purpose | 6.9 GB | HuggingFace |
| RealVisXL | Photorealism | 6.9 GB | CivitAI |
| Juggernaut XL | Cinematic/realistic | 6.9 GB | CivitAI |
| DreamShaper XL | Art/illustration | 6.9 GB | CivitAI |
Download models to ComfyUI/models/checkpoints/. ComfyUI detects them automatically.
Model Safety Note
Only download models from HuggingFace or CivitAI. Random downloads from unverified sources can contain corrupted weights or malware. Stick to verified, community-rated models.
Your First Image
- Open
http://localhost:8188 - You’ll see the default workflow (a basic txt2img pipeline)
- If the workflow is empty, click Load Default in the menu
- Select your model in the Load Checkpoint node
- Enter your prompt in the CLIP Text Encode (Prompt) node:
1a majestic mountain landscape at sunset, golden hour lighting, ultra detailed, 8k - Enter a negative prompt in the negative node:
1blurry, low quality, distorted, watermark, text - Click Queue Prompt
Your first image generates in 10-30 seconds depending on your GPU. It saves to ComfyUI/output/.
Understanding the Workflow
ComfyUI uses nodes connected by wires. The default workflow has these nodes:
| |
Flow: Model loads → prompts encode → noise sampled → image decoded → saved
You don’t need to understand all of this to use it. The default workflow works. As you learn, you’ll add nodes for upsampling, LoRA loading, and post-processing.
Adding LoRAs (Fine-Tuned Models)
LoRAs are small model additions (50-500MB) that modify the base model’s output — specific art styles, characters, or concepts.
| |
In ComfyUI:
- Right-click → Add Node → loaders → Load LoRA
- Wire it between your Load Checkpoint and CLIP Text Encode nodes
- Select your LoRA file
- Set strength (0.7-1.0 is typical)
Optimizing for Low VRAM (6-8GB)
If you’re running on a budget GPU:
Enable VRAM Management
| |
Use SD 1.5 Instead of SDXL
SD 1.5 models are 2GB instead of 6.9GB. They generate at 512x512 instead of 1024x1024, but they’re much lighter:
| |
Generate Smaller, Upscale Later
- Generate at 512x512 or 768x768
- Add an Upscale node (Latent Upscale or Image Upscale)
- Run a second pass with higher resolution
This uses less VRAM than generating at 1024x1024 directly.
Using the API
ComfyUI has a REST API — you can trigger image generation from scripts, n8n, or any application:
| |
This is how we automate image generation in our n8n workflows — the AI writes a prompt, sends it to ComfyUI’s API, and the image lands in a folder ready for use.
Troubleshooting
“CUDA out of memory”
- Use
--lowvramflag - Use a smaller model (SD 1.5 instead of SDXL)
- Reduce resolution (512x512 instead of 1024x1024)
- Close other GPU applications (browser, games)
Model not showing up
- Ensure model is in
ComfyUI/models/checkpoints/ - Check file extension (.safetensors or .ckpt)
- Refresh the model list in ComfyUI (right-click node → Refresh)
Slow generation
- Verify GPU is being used (check
nvidia-smiduring generation) - SDXL on 8GB VRAM: 15-30 seconds per image is normal
- SD 1.5 on 8GB VRAM: 3-8 seconds per image
Black or garbage images
- Your positive and negative prompts might be swapped
- LoRA strength might be too high (try 0.5)
- Model might be corrupted — re-download
Next Steps
- Self-Hosted Voice AI: Kokoro TTS Setup — Add voice to your stack
- Automate Everything: n8n + Ollama — Wire it all together
- Best GPUs for Local LLMs — Upgrade your hardware
ComfyUI is free and open source. Support the developer on GitHub.