As a rule of thumb, Stable Diffusion 1.5 runs on 4 to 6 GB of VRAM, SDXL is comfortable from about 8 GB (12 GB without compromises), and the newer SD 3.5 Large and Flux models want 16 to 24 GB unless you quantize them or offload parts to system RAM. The numbers come from the model's parameter count: each billion parameters takes about 2 GB in fp16, and image generation needs working memory on top.
Stable Diffusion VRAM by model (weights only)
The memory a model's weights take is simple arithmetic: parameters × bytes per parameter. fp16 and bf16 use 2 bytes per parameter, 8-bit quantization 1 byte, and 4-bit about half a byte. The parameter counts below come from each model's official repository or model card; the GB columns are that arithmetic, rounded.
| Model | Main model parameters | fp16 / bf16 | 8-bit | 4-bit |
|---|---|---|---|---|
| SD 1.5 (UNet + text encoder) | 860M + 123M | ~2.0 GB | ~1.0 GB | ~0.5 GB |
| SDXL base 1.0 | ~3B (as listed on Hugging Face) | ~6 GB | ~3 GB | ~1.5 GB |
| SD 3.5 Medium | ~2B | ~4 GB | ~2 GB | ~1 GB |
| SD 3.5 Large | ~8B | ~16 GB | ~8 GB | ~4 GB |
| FLUX.1 [dev] | 12B | ~24 GB | ~12 GB | ~6 GB |
| T5-XXL text encoder (used by SD 3 / 3.5) | 4.7B | ~9.4 GB | ~4.7 GB | ~2.4 GB |
Two things the table doesn't include, and both matter:
- Working memory. Generating an image needs activations, attention buffers and the VAE decode on top of the weights. It grows with resolution and batch size, which is why a model that loads fine can still run out of memory at 1024x1024 or when you generate four images at once.
- Text encoders. SD 3 and 3.5 use three text encoders, one of which is T5-XXL. The Diffusers documentation says this makes SD3 "challenging to run" on GPUs with less than 24 GB of VRAM even in fp16, unless you apply the memory options below.
The original CompVis release of Stable Diffusion stated it "runs on a GPU with at least 10GB VRAM" in its default full-precision setup. AUTOMATIC1111's web UI, for example, switches the model to 16-bit floats unless you pass --no-half, which halves the weight memory and is how the same model fits on much smaller cards.
What you can run with 4, 6, 8, 12, 16 and 24 GB
| VRAM | Practical choices |
|---|---|
| 4 GB | SD 1.5 at 512x512 with low-VRAM options. SDXL only with heavy offloading, slowly. |
| 6 GB | SD 1.5 comfortably. SDXL with --medvram-sdxl or CPU offload. |
| 8 GB | SDXL at 1024x1024 with fp16 weights and memory-efficient attention. SD 3.5 Medium without the T5 encoder. |
| 12 GB | SDXL with refiners, LoRAs and ControlNet. SD 3.5 Medium with an 8-bit T5. Flux or SD 3.5 Large only quantized. |
| 16 GB | SD 3.5 Large in 8-bit, or fp16 with offloading. Flux in 8-bit. |
| 24 GB | Flux dev in bf16 with offloading of the text encoders; SD 3.5 Large with room to spare. |
These rows follow from the weight sizes above plus the need for working memory; they are guidance, not benchmarks. Treat the row as a starting point and measure on your own card (see the last section).
How to check how much VRAM you have
- Windows: Task Manager (Ctrl+Shift+Esc) > Performance > GPU. "Dedicated GPU memory" is the VRAM that counts. "Shared GPU memory" is system RAM and is far slower.
- NVIDIA on any OS:
nvidia-smi --query-gpu=name,memory.total,memory.used --format=csv - Apple Silicon Macs have no separate VRAM: the GPU uses the shared unified memory, so a 16 GB Mac has well under 16 GB available for the model once macOS and apps take their share.
Integrated graphics have no dedicated VRAM at all and borrow system RAM; see integrated vs dedicated graphics for what that means for speed.
How to reduce Stable Diffusion VRAM usage
AUTOMATIC1111 / Forge-style web UIs
Add flags to COMMANDLINE_ARGS in webui-user.bat (Windows) or webui-user.sh (Linux, macOS). The wiki describes them as:
--medvram: model optimisations that sacrifice "some performance for low VRAM usage".--lowvram: sacrifices "a lot of speed for very low VRAM usage". Use it only if--medvramstill runs out.--medvram-sdxl: applies--medvramonly when an SDXL model is loaded, so SD 1.5 keeps full speed.--xformersor--opt-sdp-attention: memory-efficient attention. The second needs PyTorch 2.
set COMMANDLINE_ARGS=--medvram-sdxl --opt-sdp-attention
Avoid --no-half and --precision full unless a specific card needs them: both keep the model in 32-bit floats, which doubles the weight memory.
Diffusers (Python)
The Diffusers memory guide lists the options in roughly increasing savings and slowdown:
import torch
from diffusers import StableDiffusionXLPipeline
pipe = StableDiffusionXLPipeline.from_pretrained(
"stabilityai/stable-diffusion-xl-base-1.0", torch_dtype=torch.float16
)
pipe.enable_model_cpu_offload() # instead of pipe.to("cuda")
pipe.vae.enable_slicing() # helps when generating several images
pipe.vae.enable_tiling() # helps at high resolutions
- Model CPU offload keeps one whole component (text encoder, UNet or VAE) on the GPU at a time. Modest slowdown, large savings.
- Sequential CPU offload (
enable_sequential_cpu_offload()) moves individual layers back and forth. The guide calls it "extremely slow"; it's the last resort for tiny cards. - VAE slicing decodes one image of a batch at a time; VAE tiling decodes a large image in tiles.
- For SD 3 / 3.5: drop the 4.7B-parameter T5 encoder with
text_encoder_3=None, tokenizer_3=None("only a slight loss in performance", per the docs), or load it in 8-bit with bitsandbytes.
Quantized models
8-bit and 4-bit versions halve or quarter the weight memory, as in the table. The SD 3.5 Large model card shows a 4-bit NF4 setup with bitsandbytes combined with CPU offload. The Diffusers docs describe an 8-bit T5 encoder as only slightly affecting results; for 4-bit, compare outputs against the full model yourself. The same trade-off applies to language models, covered in what is LLM quantization.
Measure your actual peak VRAM
Rules of thumb only get you close. To see what a model really uses at your resolution and settings, run one generation and read the peak. In Diffusers, the memory guide uses:
print(f"Max memory reserved: {torch.cuda.max_memory_allocated() / 1024**3:.2f} GB")
In a web UI, watch nvidia-smi or Task Manager while an image generates. If the peak sits within about 1 GB of your card's total, expect out-of-memory errors when you raise the resolution or add a LoRA or ControlNet. For the same calculation applied to chat models, see how much VRAM you need to run an LLM locally.
Frequently asked questions
- Can I run Stable Diffusion with 4 GB of VRAM?
- SD 1.5 is the realistic choice: its UNet and text encoder are about 2 GB in fp16, which leaves room for working memory at 512x512, especially with a low-VRAM option such as --medvram or --lowvram in AUTOMATIC1111 or CPU offloading in Diffusers. SDXL's weights alone are about 6 GB in fp16, so it needs heavy offloading or a quantized model on a 4 GB card and will be slow.
- Does Stable Diffusion use system RAM when VRAM runs out?
- Only if the software is told to offload. Options such as enable_model_cpu_offload in Diffusers or --medvram and --lowvram in AUTOMATIC1111 keep parts of the model in system RAM and move them to the GPU when needed. Without them, running out of VRAM ends the job with a CUDA out-of-memory error.
- Is VRAM or GPU speed more important for Stable Diffusion?
- VRAM decides which models and resolutions you can run at all; GPU speed decides how long each image takes once it fits. A slower card with enough VRAM to hold the model will usually beat a faster card that has to offload to system RAM on every step.
- How much VRAM does training a LoRA need?
- More than generating images, because training also stores gradients and optimizer state. The exact figure depends on the trainer, the model, the batch size and settings such as gradient checkpointing and 8-bit optimizers, so check the requirements published by the training tool you use rather than relying on a single number.
Sources
- CompVis: Stable Diffusion (original repository README)
- Hugging Face Diffusers: Stable Diffusion 3 (memory optimisations)
- Hugging Face Diffusers: Reduce memory usage
- AUTOMATIC1111 stable-diffusion-webui wiki: Command Line Arguments and Settings
- Hugging Face: stabilityai/stable-diffusion-xl-base-1.0
- Hugging Face: stabilityai/stable-diffusion-3.5-large
- Hugging Face: black-forest-labs/FLUX.1-dev