Stable Diffusion Setup Guide: Install Automatic1111 & ComfyUI for Local Image Generation
Overview
Stable Diffusion lets you generate images from text descriptions, entirely on your own hardware — no cloud costs, no monthly subscriptions, no content filters, and complete privacy. This guide covers setting up the two most popular interfaces: Automatic1111 (feature-rich, beginner-friendly) and ComfyUI (node-based, powerful for advanced workflows).
Prerequisites
Hardware Requirements
| Component | Minimum | Recommended | |---|---|---| | GPU VRAM | 6 GB (SD 1.5) | 12 GB (SDXL / SD 3.5) | | RAM | 16 GB | 32 GB | | Storage | 20 GB free | 100 GB+ SSD | | OS | Windows 10+ / macOS / Linux | Same |
Software Requirements
- Python 3.10.6 (critical — newer versions may break dependencies)
- Git (for cloning repositories)
- CUDA toolkit (if using NVIDIA GPU)
Option 1: Automatic1111 (WebUI)
Automatic1111's Stable Diffusion WebUI is the most popular interface — it's feature-rich, has a large community, and supports hundreds of extensions.
Installation
# Clone the repository
git clone https://github.com/AUTOMATIC1111/stable-diffusion-webui.git
cd stable-diffusion-webui
# Windows: Run the batch file
webui-user.bat
# Linux/macOS: Run the shell script
./webui.sh
The first launch will take 5–15 minutes as it downloads dependencies. After completion, it opens http://localhost:7860 in your browser.
Downloading Checkpoints
Stable Diffusion needs a model file (checkpoint) to generate images. Place checkpoints in the models/Stable-diffusion/ folder.
# Download SDXL 1.0 (base model) via command line
# You need a Hugging Face token
pip install huggingface-hub
huggingface-cli login
huggingface-cli download stabilityai/stable-diffusion-xl-base-1.0 sd_xl_base_1.0.safetensors --local-dir models/Stable-diffusion/
Alternative: Download manually from Hugging Face or CivitAI and place the .safetensors file in the models folder.
Your First Image
- Open
http://localhost:7860 - Enter a prompt:
photograph of a cat wearing a spacesuit, cinematic lighting, 8k - Leave the negative prompt empty or add:
blurry, low quality, distorted - Set sampling steps to 20
- Click Generate
Key Features
| Feature | Location | Purpose | |---|---|---| | txt2img | Main tab | Text-to-image generation | | img2img | Second tab | Image-to-image (edit existing images) | | Extras | Third tab | Upscaling, face restoration | | PNG Info | Fourth tab | View generation metadata | | Checkpoints | Top-left dropdown | Switch between models |
Essential Extensions
Install via the Extensions tab → Available → search and install:
- ControlNet — Pose control, depth maps, edge detection
- After Detailer — Automatic face enhancement
- Ultimate SD Upscale — Tile-based upscaling
- Image Browser — Browse and manage generated images
Option 2: ComfyUI
ComfyUI uses a node-based interface for more control over the generation pipeline.
Installation
# Clone the repository
git clone https://github.com/comfyanonymous/ComfyUI.git
cd ComfyUI
# Install dependencies
pip install -r requirements.txt
# Download a checkpoint to models/checkpoints/
# Then run:
python main.py
Open http://localhost:8188 in your browser.
Understanding the Node Interface
ComfyUI uses a node graph where each node performs one operation:
graph LR
A[Load Checkpoint] --> B[CLIP Text Encode]
A --> C[VAE Decode]
B --> D[KSampler]
A --> D
D --> C
C --> E[Save Image]
First Workflow
- Right-click → Add Node → Load Checkpoint
- Select your model file
- Add CLIP Text Encoder (positive prompt)
- Add CLIP Text Encoder (negative prompt) — optional
- Add KSampler — connect checkpoint, CLIP outputs
- Add VAE Decode — connect from KSampler
- Add Save Image — connect from VAE Decode
- Click Queue Prompt
Workflow Templates
Load pre-built workflows from ComfyUI\workflows\ or download from OpenArt and CivitAI.
Upscaling
Built-in Upscaling (Automatic1111)
- Go to Extras tab
- Select the image you want to upscale
- Choose upscaler (4x-UltraSharp recommended)
- Set scale factor (2x or 4x)
- Click Generate
Tile Upscaling (ComfyUI)
Use the Ultimate SD Upscale node:
- Load your image
- Connect to Ultimate SD Upscale
- Set target size (e.g., 4096x4096)
- Set tile size to 512 or 768
- Run — the image is upscaled in tiles to avoid VRAM limits
img2img
Img2img lets you transform existing images using a text prompt.
In Automatic1111
- Switch to img2img tab
- Upload an image
- Set denoising strength (0.3 = subtle changes, 0.8 = major changes)
- Enter a prompt describing the desired output
- Click Generate
In ComfyUI
Use the Load Image node instead of Empty Latent Image:
- Add Load Image node
- Connect to VAE Encode (to convert image to latent space)
- Connect latent to KSampler
- Set denoise in KSampler (1.0 = complete change, 0.3 = slight)
- Queue prompt
Troubleshooting
| Problem | Solution |
|---|---|
| Out of memory | Reduce batch size to 1, lower resolution to 512x512, use --medvram flag |
| Slow generation | Enable xformers (--xformers flag), use smaller model (SD 1.5 instead of SDXL) |
| Black images | VAE mismatch — download correct VAE for your model |
| NaN errors | Disable cross-attention optimization, update PyTorch |
| Extension errors | Launch with --no-extensions to disable all extensions |
FAQ
Which UI should I start with?
Start with Automatic1111 for its simplicity and community support. Switch to ComfyUI when you need advanced workflows that the linear UI can't handle.
Can I run this on a Mac?
Yes — both Automatic1111 and ComfyUI support MPS (Apple Silicon GPU). Performance is 30–50% slower than equivalent NVIDIA hardware but works well for SD 1.5 and SDXL.
Where do I find good checkpoints?
CivitAI is the largest repository of community-trained models. Use filters to find models compatible with your UI version. Always download .safetensors format for security.
Why This Guide Is Useful in Practice
A useful guide for Stable Diffusion Setup Guide: Install Automatic1111 & ComfyUI for Local Image Generation should reduce confusion, not just list steps. This page is designed to help readers understand what trade-offs matter, which assumptions are safe, and what to do next if the first option is too expensive, too complex, or too limited for a real workflow.
What to Check Before You Follow This Advice
Stable Diffusion Setup Guide: Install Automatic1111 & ComfyUI for Local Image Generation with practical setup steps, tool-selection context, and workflow guidance for human readers using local AI tools.
- - Match the recommendation to the exact workload you run most often, not the most ambitious future scenario.
- - Budget for the surrounding system and operational complexity, not just the headline tool or GPU.
- - Prefer options that keep your workflow repeatable, debuggable, and easy to maintain over time.