Two ways to run Stable Diffusion XL 1.0 locally: AUTOMATIC1111 WebUI or ComfyUI. Every 2023 tutorial defaults to AUTOMATIC1111. That’s the wrong call now.
On 8GB cards, AUTOMATIC1111 users routinely hit memory errors that ComfyUI avoids. ComfyUI is also community-preferred for SDXL specifically because it handles the two-stage base+refiner pipeline without fighting the VRAM. This guide uses ComfyUI end-to-end. Commands only.
System requirements (real numbers, not marketing)
The “8GB VRAM is fine” claim you see on every blog is technically true and practically wrong. Here’s what the community actually reports for a 1024×1024 SDXL generation with the refiner (as of early 2025, based on community-tested tiers – generation times may shift with driver updates):
| VRAM | Reality | Time per image |
|---|---|---|
| 4 GB | Runs, but you’re fighting it | Very slow |
| 6 GB | Works – up to an hour per image | ~60 min |
| 8 GB | Workable for base only, no ControlNet | ~30 sec |
| 12 GB | Recommended sweet spot | ~20 sec |
| 24 GB | LoRA training in ~90 min | Seconds |
Think of 12 GB as the point where SDXL stops being a negotiation. Below that, you’re always trading something – resolution, refiner, ControlNet – against what fits in memory. The 8GB tier works; it just works with an asterisk attached to almost every feature.
Other minimums: Python 3.8 or above, Git, and roughly 20 GB of disk space (base model plus refiner plus dependencies). CPU barely matters – GPU VRAM and compute dominate performance.
Download the model weights
Two files from Hugging Face, both under the CreativeML Open RAIL++-M license:
- Base: stabilityai/stable-diffusion-xl-base-1.0 → download
sd_xl_base_1.0.safetensors - Refiner: stabilityai/stable-diffusion-xl-refiner-1.0 → download
sd_xl_refiner_1.0.safetensors
Why two files? The Hugging Face model card describes SDXL as an ensemble-of-experts pipeline: the base generates noisy latents, then the refiner handles the final denoising steps – a second pass optimized for detail. You can skip the refiner if VRAM is tight. The base works standalone. Most quality-critical workflows use both.
Install ComfyUI and run SDXL
Linux/macOS:
git clone https://github.com/comfyanonymous/ComfyUI
cd ComfyUI
python -m venv venv
source venv/bin/activate
pip install -r requirements.txt
# NVIDIA (CUDA 12.1):
pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu121
Windows: grab the standalone ComfyUI_windows_portable release from the GitHub releases page and unzip. No Python setup needed.
Move the model files:
mv sd_xl_base_1.0.safetensors ComfyUI/models/checkpoints/
mv sd_xl_refiner_1.0.safetensors ComfyUI/models/checkpoints/
Launch:
python main.py
ComfyUI serves on http://127.0.0.1:8188. Open it, click Load Default, swap the checkpoint node to sd_xl_base_1.0.safetensors, set the empty latent to 1024×1024, hit Queue Prompt.
The 8GB memory problem no tutorial mentions
Running python main.py raw on an 8GB card will likely OOM. A GitHub issue filed against ComfyUI documents the cause: roughly 1-1.5 GB of VRAM is not properly freed between runs, which is exactly the margin that makes 8GB setups fail. The workaround from that thread:
python main.py --dont-upcast-attention --fp16-vae --force-fp16 --disable-smart-memory
Tiled VAE decode is worth enabling too. Benchmarks from 42.uk show the split on a 4090: baseline hits 16.5 GB peak VRAM at 11 seconds per render; with tiled VAE (512×512 tiles, 64px overlap) that drops to 8.2 GB peak at 13 seconds. Two extra seconds, nearly half the VRAM. On 8GB cards, that’s the gap between running and crashing.
The catch with ControlNet: One ControlNet adapter adds 1.5-3 GB to your VRAM budget. Stack two plus an IP-Adapter and you’re looking at 5-8 GB on top of the base model (per gigagpu.com benchmarks, as of early 2025). An 8GB card that runs bare SDXL cannot realistically run even one ControlNet. Tutorials that cover SDXL system requirements and ControlNet separately never connect those dots.
Verify the install works
Queue: “a photograph of an astronaut riding a horse” – 1024×1024, 20 steps, CFG 7, sampler euler. First run takes longer; ComfyUI compiles CUDA kernels and loads the checkpoint cold. Expect ~30 seconds on 8GB, ~15 seconds on 12GB+.
One thing the official demo pipeline does that ComfyUI’s default nodes typically skip: the Stability AI generative-models codebase embeds an invisible watermark into outputs via the invisible-watermark library. Building for commercial use? Check what your specific node graph actually produces.
Common errors and fixes
CUDA out of memory: Ninety percent of the time – base + refiner + text encoders all in VRAM at once. Fix: --lowvram flag, drop to 768×768 first to confirm the install works, then scale back up.
Model refuses to load, no error: Partial download. HuggingFace sometimes returns what looks like a 6.9 GB file but is actually 200 MB of HTML. Check with ls -la – anything under 6.5 GB is broken. Re-download with git-lfs or huggingface-cli.
Blurry, deep-fried, or malformed outputs: Resolution below 1024×1024. SDXL was trained on 1024×1024 latents. Supported bucket sizes: 1024×1024, 1152×896, 1216×832, 832×1216, 1344×768. Anything outside those buckets degrades quality noticeably.
PyTorch version mismatch: Common on top of an older venv. Wipe the venv folder and reinstall from scratch – faster than debugging pip’s resolver.
Upgrade and uninstall
Update ComfyUI:
cd ComfyUI
git pull
pip install -r requirements.txt --upgrade
Windows portable: the update folder has update_comfyui.bat. Run it.
Full uninstall – delete the ComfyUI directory. On Linux/macOS also clear the pip cache: rm -rf ~/.cache/pip. Conda install? Drop the environment: conda env remove -n comfyui. Also check ~/.cache/huggingface – if you used diffusers at any point, a duplicate copy of the weights may be sitting there (~13 GB combined for both models).
What comes next
Base SDXL is running. The obvious additions are a LoRA (community fine-tunes for specific styles) or ControlNet for pose/edge conditioning. Both live on CivitAI – filter by “SDXL 1.0” as the base model. An SDXL LoRA silently fails to load against an SD 1.5 checkpoint; the filter saves the debugging session.
Worth asking before going further: is SDXL actually the right starting point for a new install in 2026? The answer depends on what you want to build – which the FAQ below addresses directly.
For the architecture side: the Podell et al. paper (arXiv:2307.01952) explains why the two-stage pipeline exists. Turns out the larger UNet – three times the size of previous SD versions, mainly from additional attention blocks and a second text encoder – is what makes the two-stage approach worthwhile rather than just expensive.
FAQ
Do I actually need the refiner?
No. Base model alone produces solid output. The refiner costs ~6 GB more VRAM and roughly doubles generation time – skip it if you’re constrained.
Can I run SDXL on an M2 Mac?
Yes, with caveats. ComfyUI supports Apple Silicon via MPS (Metal Performance Shaders) – install PyTorch with MPS support and launch normally. Generation times run 3-5x slower than an equivalent NVIDIA card, and some samplers behave differently under MPS. If you’re doing this for anything beyond experimentation, a cloud GPU rental (RunPod, Vast.ai) closes the productivity gap fast. Local Mac inference for SDXL is a patience exercise.
Is SDXL still worth installing in 2026, or should I start with FLUX?
FLUX.1 has stronger prompt-following and photorealism out of the box – that’s the community consensus as of early 2025, though model rankings shift. The real argument for SDXL is depth: thousands of trained checkpoints and LoRAs on CivitAI, years of community workflow development, and ControlNet adapters tuned specifically for it. FLUX’s library of trained checkpoints and LoRAs is thinner, its ControlNet support is still catching up. If you have no existing SDXL workflows, FLUX is worth evaluating first. If you’re here because you want access to a specific fine-tuned style or checkpoint, SDXL is still the answer.