Automatic1111 Fix, Crash & Optimization Guide

Stable Diffusion web UI (AUTOMATIC1111) crashing, black images, or out of VRAM? Real Windows/Linux/macOS fixes, optimization and version notes.

📅 Updated 2026-08-05✍️ DevFixPro Team✅ Verified 2026-08🧮 Linked tool: Dev RAM Calculator

Automatic1111 Fix, Crash & Optimization Guide

AUTOMATIC1111 Stable Diffusion WebUI is a popular browser-based interface for running Stable Diffusion models locally. It is used by artists and hobbyists for text-to-image, inpainting, and image-to-image generation.

Install / First Setup

Clone the repository and run the launcher for your OS:

git clone https://github.com/AUTOMATIC1111/stable-diffusion-webui.git
cd stable-diffusion-webui
# Windows
webui-user.bat
# Linux / macOS
./webui.sh

The first launch installs dependencies and opens http://127.0.0.1:7860. Place model checkpoints (.ckpt/.safetensors) in the models/Stable-diffusion folder. A CUDA-capable GPU with current drivers is required for GPU acceleration on Windows/Linux.

Common Issues & Fixes

torch not compiled with CUDA enabled / running on CPU

Cause: A CPU-only PyTorch was installed, or no compatible GPU/driver. Fix: Verify with python -c "import torch; print(torch.cuda.is_available())" from the webui Python. If False, the launcher will reinstall a CUDA torch when you set the appropriate COMMANDLINE_ARGS, or reinstall the matching PyTorch wheel manually.

Out of memory (CUDA OOM)

Cause: Model plus batch/resolution exceeds VRAM. Fix: Add memory flags in webui-user.bat (Windows) or the launch script:

set COMMANDLINE_ARGS=--lowvram --opt-sdp-attention

--medvram is less aggressive; --lowvram fits very small GPUs. Lower resolution and batch size, and disable extras like face restoration if OOM occurs.

Black or green images

Cause: Missing/incompatible VAE, or a silent VAE decode OOM. Fix: Select a matching VAE in Settings → VAE, or set the VAE path. If only large outputs are black, enable tiled VAE in the UI to avoid VRAM spikes.

xformers import error

Cause: xformers version mismatches the installed PyTorch/CUDA. Fix: Either remove --xformers from COMMANDLINE_ARGS, or reinstall the xformers build matching your PyTorch version. Using --opt-sdp-attention avoids xformers entirely on supported setups.

Paths with spaces / non-ASCII cause failures

Cause: The webui folder is under a path containing spaces or special characters. Fix: Move stable-diffusion-webui to a simple path such as C:\sd\ (Windows) or ~/sd/ (Linux/macOS).

Performance & Optimization

  • Low-End (8 GB RAM, no/weak GPU): Use --lowvram, SD1.5 models (1–2 GB), resolution 512×512, batch 1. Avoid SDXL.
  • Mid-Range (16 GB RAM, 6–8 GB VRAM): --medvram, SDXL at ~1024×1024. Use --opt-sdp-attention or --xformers for speed.
  • Workstation (12–24 GB VRAM): Run without VRAM flags; fp16 weights halve model memory versus fp32; raise batch size and resolution. Use --opt-channelslast where beneficial.
  • Keep the models and outputs folders on fast storage; large checkpoint loads are I/O bound.

Version & Compatibility Notes

The webui targets Python 3.10.6 (recommended) and PyTorch 2.x with CUDA on NVIDIA GPUs; AMD on Linux uses ROCm builds. xformers is optional and version-sensitive. For exact supported Python/PyTorch/CUDA combinations, consult the official AUTOMATIC1111 wiki and release notes.

FAQ

Q: Where do I put model files? A: Place .safetensors/.ckpt checkpoints in models/Stable-diffusion and VAEs in models/VAE; restart the UI to load them.

Q: How do I enable the API? A: Add --api to COMMANDLINE_ARGS; it exposes endpoints on the same port (7860).

Q: Why is the first generation slow? A: Models and optimizers are loaded/compiled on first use; subsequent generations are faster.

Q: Can I run it without a GPU? A: Yes with CPU, but it is extremely slow; only small SD1.5 models are practical.

Q: How do I update? A: Run git pull in the webui folder, then restart the launcher.

Q: What does --medvram do versus --lowvram? A: Both reduce VRAM use by offloading; --medvram is milder and faster, --lowvram is stricter for very limited GPUs.

Related Guides

Accuracy Note

Commands and paths reflect common, real-world setups as of 2026-08. Always verify against your installed version and OS. When in doubt, consult the official AUTOMATIC1111 documentation.

Calculator Recommended Adjustment Params

Run the Dev RAM Calculator with the values referenced in this guide to validate your rig before and after the fix.