Stable Diffusion WebUI: Run AI Image Generation Locally for Free

Complete guide to running Stable Diffusion locally with AUTOMATIC1111 WebUI. Generate unlimited AI images for free with full control over models and settings.

AI Generated Art Photo by Fakurian Design on Unsplash

Why Run Stable Diffusion Locally?

While services like Midjourney and DALL-E are convenient, running Stable Diffusion locally offers unique advantages:

  • Completely free - No subscription fees or credit limits
  • Full privacy - Your prompts never leave your computer
  • Unlimited generations - Generate as many images as you want
  • Custom models - Use specialized models for any style
  • Complete control - Fine-tune every parameter
  • NSFW capability - No content restrictions

System Requirements

Minimum Requirements

Component Minimum Recommended
GPU 4GB VRAM 8GB+ VRAM
RAM 8GB 16GB+
Storage 20GB 100GB+ (for models)
OS Windows 10/11, Linux, macOS Windows/Linux with NVIDIA

Supported GPUs

NVIDIA (Best):

  • RTX 4090/4080/4070 - Excellent
  • RTX 3090/3080/3070 - Great
  • RTX 2080/2070 - Good
  • GTX 1660/1650 - Usable

AMD:

  • Works with ROCm on Linux
  • Limited Windows support

Apple Silicon:

  • M1/M2/M3 supported via MPS
  • Slower than NVIDIA but functional

Computer Setup Photo by Christian Wiediger on Unsplash

Installation Guide

Windows Installation

Step 1: Install Python

# Download Python 3.10.x from python.org
# Check "Add Python to PATH" during installation

Step 2: Install Git

# Download from git-scm.com
# Use default settings

Step 3: Clone AUTOMATIC1111 WebUI

cd C:\
git clone https://github.com/AUTOMATIC1111/stable-diffusion-webui.git
cd stable-diffusion-webui

Step 4: Download a Model

Download Stable Diffusion models from:

Place .safetensors files in:

stable-diffusion-webui/models/Stable-diffusion/

Step 5: Launch

webui-user.bat

First launch downloads dependencies (~5-10 minutes). Access at: http://127.0.0.1:7860

macOS Installation (Apple Silicon)

# Install Homebrew if needed
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

# Install dependencies
brew install cmake protobuf rust python@3.10 git wget

# Clone repository
git clone https://github.com/AUTOMATIC1111/stable-diffusion-webui.git
cd stable-diffusion-webui

# Launch
./webui.sh

Linux Installation

# Ubuntu/Debian
sudo apt update
sudo apt install python3.10 python3.10-venv git wget

# Clone and run
git clone https://github.com/AUTOMATIC1111/stable-diffusion-webui.git
cd stable-diffusion-webui
./webui.sh

Essential Models to Download

Base Models

Model Style Size Best For
SDXL 1.0 General 6.9GB High-quality realism
SD 1.5 General 4.2GB Faster, more compatible
Juggernaut XL Photorealistic 6.9GB Portraits, photos
DreamShaper Artistic 2.1GB Illustrations

Specialty Models

  • Realistic Vision - Photorealistic humans
  • Anime Models - Japanese animation style
  • Architecture - Building and interior design
  • Product Photography - Commercial images

Using the WebUI

Text-to-Image (txt2img)

Basic workflow:

  1. Select your model (top-left dropdown)
  2. Enter your prompt
  3. Enter negative prompt
  4. Adjust settings
  5. Click “Generate”

Example Prompt:

masterpiece, best quality, highly detailed portrait of a woman,
soft lighting, golden hour, bokeh background, 8k resolution

Example Negative Prompt:

low quality, blurry, deformed, ugly, bad anatomy,
extra limbs, watermark, text, signature

Key Settings Explained

Setting Description Recommended
Sampling Steps More = better quality, slower 20-30
CFG Scale Prompt adherence (higher = stricter) 7-11
Sampler Generation algorithm DPM++ 2M Karras
Size Output resolution 512x512 to 1024x1024
Batch Count Number of generations 4

Image-to-Image (img2img)

Transform existing images:

  1. Upload source image
  2. Enter prompt describing desired output
  3. Adjust Denoising Strength (0.3-0.7)
  4. Generate

Use Cases:

  • Style transfer
  • Adding details
  • Fixing compositions
  • Colorization

Inpainting

Edit specific areas:

  1. Upload image
  2. Draw mask over area to change
  3. Describe what should fill the area
  4. Generate

Perfect for:

  • Removing objects
  • Changing backgrounds
  • Fixing faces
  • Adding elements

Must-Have Extensions

ControlNet

Control image composition precisely:

  • Canny - Edge detection
  • Depth - 3D depth maps
  • OpenPose - Human poses
  • Reference - Style matching

Installation:

Extensions → Install from URL →
https://github.com/Mikubill/sd-webui-controlnet

ADetailer

Automatically fix faces and hands:

Extensions → Available → Search "ADetailer" → Install

Ultimate SD Upscale

Upscale images beyond native resolution:

  • Maintains coherence
  • Uses tiled rendering
  • Works with any model

Optimization Tips

For Low VRAM GPUs

Add to webui-user.bat (Windows) or webui-user.sh:

set COMMANDLINE_ARGS=--medvram --xformers

For very low VRAM (4GB):

set COMMANDLINE_ARGS=--lowvram --xformers

Speed Optimizations

# Enable xformers (significant speedup)
set COMMANDLINE_ARGS=--xformers

# Use fp16 for faster generation
set COMMANDLINE_ARGS=--precision full --no-half-vae

Quality vs Speed

Priority Steps Sampler CFG
Speed 15-20 Euler a 7
Balanced 25-30 DPM++ 2M Karras 8
Quality 40-50 DPM++ SDE Karras 9

Troubleshooting

“Out of Memory” Error

Solutions:

  • Enable --medvram or --lowvram
  • Reduce image size
  • Close other GPU applications
  • Enable xformers

Black or Corrupted Images

Solutions:

  • Add --no-half-vae to args
  • Update GPU drivers
  • Try different sampler
  • Check model file integrity

Slow Generation

Solutions:

  • Enable xformers
  • Use SDXL Turbo for speed
  • Reduce steps
  • Use smaller resolution, then upscale

Conclusion

Stable Diffusion WebUI gives you enterprise-level AI image generation capabilities completely free. The learning curve is steeper than cloud services, but the control and flexibility are unmatched.

Start with SD 1.5 to learn, then move to SDXL for quality. Join communities like r/StableDiffusion and Civitai to discover new models and techniques.

Your imagination is the only limit.


What’s your favorite SD model or workflow? Share your tips in the comments!