SD 1.5 needs about 4 GB of VRAM, SDXL 8–12 GB, SD 3.5 Large about 28 GB in BF16, and FLUX.1 about 34 GB in BF16. FP8 roughly halves the large models, so FLUX.1 fits a 24 GB card; 4-bit weights bring it to 12–16 GB. Add 10–20% headroom for activations.
- SD 1.5 weights (FP16)
- ≈2.1 GB
- SDXL weights (FP16)
- ≈6.9 GB
- SD 3.5 Large weights (BF16)
- ≈27.5 GB incl. three text encoders
- FLUX.1 weights (BF16)
- ≈34 GB incl. T5-XXL
- FLUX.1 weights (FP8)
- ≈17 GB
- Rule
- GB ≈ billions of parameters × bytes per parameter
- Headroom
- Add 10–20% for activations and CUDA context
VRAM is the hard limit in image generation. If a model's weights and working memory do not fit on the GPU, it either fails with CUDA out of memory or limps along with parts of itself in system RAM. The good news is that the requirement is predictable: add up the components, multiply by bytes per parameter, and allow some headroom. This guide does that sum for every mainstream image model and shows how quantisation, offload and VAE tiling change it.
For the full setup on a rented GPU, see the pillar guide, how to run Stable Diffusion on a cloud GPU. If VRAM itself is a new idea, what GPU VRAM is explains it.
How much VRAM does each model need? The short answer
The table gives practical figures for generating one 1024×1024 image (512×512 for SD 1.5). "Comfortable" means the whole pipeline stays on the GPU with headroom for a LoRA or two.
| Model | Weights at 16-bit | Comfortable | Minimum with tricks | Tricks needed at minimum |
|---|---|---|---|---|
| SD 1.5 | ≈2.1 GB | 6 GB | 4 GB | Attention slicing, VAE slicing |
| SDXL 1.0 base | ≈6.9 GB | 12 GB | 8 GB | VAE tiling, batch 1, or model offload |
| SD 3.5 Medium | ≈16 GB (≈5 GB without T5) | 20 GB | 8–10 GB | Drop or offload T5 |
| SD 3.5 Large | ≈27.5 GB | 32–40 GB | 16–24 GB | FP8, or offload T5 |
| FLUX.1 [dev] / [schnell] | ≈34 GB | 40–48 GB | 12–16 GB | 4-bit transformer + offload (24 GB with FP8) |
The rest of the article shows where those numbers come from.
How do you calculate VRAM for an image model?
VRAM needed ≈ the sum of every component's weights + activations + overhead. For weights, use the standard rule:
Weights (GB) ≈ parameters (billions) × bytes per parameter
with 2 bytes for FP16 or BF16, 1 byte for FP8, and about 0.5–0.6 bytes for 4-bit formats such as NF4 or GGUF Q4. Then add 10–20% for activations, the CUDA context and the framework.
A modern image pipeline has four kinds of component:
- The diffusion model (a UNet in SD 1.5 and SDXL, a transformer in SD 3.5 and FLUX). It runs at every step and dominates both memory and time.
- Text encoders (CLIP, OpenCLIP, T5). They run once per prompt. T5-XXL is the big one, at roughly 4.7 billion parameters in its encoder.
- The VAE, which decodes latents into pixels at the end. Small in weights, but decoding a large image can briefly need several gigabytes.
- Extras: LoRAs (tens to hundreds of MB each), ControlNets (roughly the size of a large slice of the base model), IP-Adapters, upscalers.
Because text encoders only run once, they are the cheapest thing to move off the GPU. That single fact explains most "runs on 12 GB" claims for large models.
Worked VRAM sums for each model
Parameter counts are published figures, rounded; weights use the rule above.
SD 1.5 and SDXL
| Component | SD 1.5 params | SD 1.5 at FP16 | SDXL params | SDXL at FP16 |
|---|---|---|---|---|
| UNet | 0.86B | 1.72 GB | 2.6B | 5.2 GB |
| Text encoder(s) | CLIP-L 0.12B | 0.25 GB | CLIP-L 0.12B + OpenCLIP bigG 0.69B | 1.6 GB |
| VAE | 0.08B | 0.17 GB | 0.08B | 0.17 GB |
| Total weights | ≈2.1 GB | ≈6.9 GB |
SDXL's total matches the size of its published FP16 checkpoint file, which is a useful sanity check: a .safetensors file's size is roughly its VRAM footprint at that precision.
Stable Diffusion 3.5
| Component | Params | BF16 | FP8 |
|---|---|---|---|
| SD 3.5 Large MMDiT | 8.1B | 16.2 GB | 8.1 GB |
| SD 3.5 Medium MMDiT | 2.5B | 5.0 GB | 2.5 GB |
| CLIP-L | 0.12B | 0.25 GB | 0.25 GB |
| OpenCLIP bigG | 0.69B | 1.4 GB | 1.4 GB |
| T5-XXL encoder | 4.7B | 9.5 GB | 4.9 GB |
| VAE | 0.08B | 0.17 GB | 0.17 GB |
SD 3.5 Large in BF16: 16.2 + 0.25 + 1.4 + 9.5 + 0.17 ≈ 27.5 GB. With FP8 transformer and T5: about 15 GB. SD 3.5 Medium with all three encoders in BF16: about 16 GB, or under 7 GB if you drop T5, which Stability supports at some cost to prompt adherence on long prompts.
FLUX.1
| Component | Params | BF16 | FP8 | 4-bit |
|---|---|---|---|---|
| Transformer | 12B | 24 GB | 12 GB | ≈6.6 GB |
| T5-XXL encoder | 4.7B | 9.5 GB | 4.9 GB | ≈2.6 GB |
| CLIP-L | 0.12B | 0.25 GB | 0.25 GB | 0.25 GB |
| VAE | 0.08B | 0.17 GB | 0.17 GB | 0.17 GB |
| Total | ≈34 GB | ≈17 GB | ≈9.6 GB |
FLUX.1 [dev] and [schnell] share this architecture, so the VRAM is the same; [schnell] is just faster because it needs 4 steps rather than 28 or more. How to load each precision in practice is covered in how to run FLUX on a cloud GPU.
How do resolution and batch size change VRAM?
Weights are fixed; activations grow with resolution and batch size. In practice they add a few gigabytes at 1024 pixels and much more at 2048.
The diffusion model works on a compressed latent, not pixels. SDXL's VAE shrinks each side by 8, so a 1024×1024 image is a 128×128 latent. FLUX's transformer then groups 2×2 latent patches, so 1024×1024 becomes 64 × 64 = 4,096 tokens. Doubling each side to 2048 pixels quadruples that to 16,384 tokens, and attention work grows faster than linearly. Modern attention kernels (PyTorch's scaled-dot-product attention) keep the memory growth manageable, but the time grows a lot.
Three practical rules, all estimates rather than guarantees:
- Batch size: each extra image in a batch adds activation memory roughly proportional to its latent size. On a 24 GB card, SDXL at 1024 pixels usually manages batches of 4–8; FLUX in FP8 usually 1–2.
- VAE decode spikes: decoding a 2048×2048 image in one go can need several extra gigabytes for a moment.
pipe.vae.enable_tiling()decodes in tiles and removes most of the spike. - High-res fix and upscaling: a second pass at higher resolution needs the larger activation budget, even if the first pass fitted easily.
How can you reduce VRAM use?
You trade VRAM for speed or a little quality. In diffusers, these are the levers, from least to most costly:
| Technique | VRAM saved | Speed cost | Quality cost | How |
|---|---|---|---|---|
| VAE tiling / slicing | Removes decode spike | Small | None visible | pipe.vae.enable_tiling() |
| FP8 weights | ~50% of weights | None or a gain on Ada/Hopper/Blackwell | Usually slight | FP8 checkpoints; ComfyUI fp8_e4m3fn |
| Model CPU offload | Text encoders and idle parts | Small to moderate | None | pipe.enable_model_cpu_offload() |
| Drop T5 (SD 3.5) | ~9.5 GB | Faster | Weaker on long prompts | text_encoder_3=None, tokenizer_3=None |
| 4-bit (NF4, GGUF Q4) | ~70% of weights | Moderate | Noticeable on fine detail | bitsandbytes in diffusers; ComfyUI-GGUF |
| Sequential CPU offload | Almost everything | Very large | None | pipe.enable_sequential_cpu_offload() |
Example: SD 3.5 Large on a 24 GB card with model offload and VAE tiling.
import torch
from diffusers import StableDiffusion3Pipeline
pipe = StableDiffusion3Pipeline.from_pretrained(
"stabilityai/stable-diffusion-3.5-large", torch_dtype=torch.bfloat16)
pipe.enable_model_cpu_offload() # text encoders visit the GPU only to encode
pipe.vae.enable_tiling()
torch.cuda.reset_peak_memory_stats()
image = pipe("a botanical illustration of a fern, ink and watercolour",
num_inference_steps=28, guidance_scale=3.5).images[0]
print(f"peak VRAM: {torch.cuda.max_memory_allocated() / 1e9:.1f} GB")
image.save("sd35.png")That last print is the most useful line in this article: it reports the real peak for your settings. The model is gated, so accept its licence on the Stable Diffusion 3.5 Large model card and log in with huggingface-cli login first. The diffusers memory optimisation guide lists every option for your installed version. For the theory behind FP8 and 4-bit, read quantisation explained.
How much VRAM does training a LoRA need?
Training needs more than generating: gradients and optimiser state for the LoRA, plus activations kept for the backward pass. These rules of thumb assume a LoRA on a frozen base, gradient checkpointing on, batch size 1–2 at native resolution.
| Base model | Practical minimum | Comfortable | Notes |
|---|---|---|---|
| SD 1.5 | 8 GB | 12 GB | Quick to train |
| SDXL | 12–16 GB | 24 GB | 24 GB allows bigger batches and text-encoder training |
| SD 3.5 Large | 24 GB (FP8 base) | 48 GB | Heavy text encoders; cache embeddings to save memory |
| FLUX.1 [dev] | 24 GB (FP8 or quantised base) | 40–48 GB | Caching text embeddings helps a lot |
Training tools such as kohya-ss sd-scripts, ostris ai-toolkit and the diffusers training examples each document their own minimums; check those for your exact settings. Remember FLUX.1 [dev] is under a non-commercial licence, and a LoRA trained on it inherits the same restriction for the combined model.
Which GPU should you pick for each VRAM band?
Choose by the comfortable figure for your heaviest workflow, then check price per image. These are the GPUs we rent, grouped by memory.
| You need | GPU | VRAM | Price | Typical image use |
|---|---|---|---|---|
| Up to 24 GB | RTX 4090 | 24 GB | $1.59/hr | SDXL with extras, SD 3.5 Medium, FLUX.1 in FP8 |
| Up to 48 GB | L40S | 48 GB | $1.89/hr | FLUX.1 and SD 3.5 Large in BF16 with LoRAs and ControlNets |
| Up to 80 GB | A100 80GB | 80 GB | $3.79/hr | LoRA training, large batches, video models |
| Up to 80 GB, faster | H100 PCIe | 80 GB | $4.99/hr | Production APIs, FP8 at speed |
| Up to 96 GB | RTX PRO 6000 Blackwell | 96 GB | $4.89/hr | Several large models resident, video |
Speed and cost per image for each card are compared in what GPU you need for AI image generation.
Why do real numbers differ from the tables?
Frameworks and settings change the overhead. Expect your measured peak to differ from these sums by a few gigabytes either way.
- CUDA context and kernels take a few hundred MB to over 1 GB before any model loads.
- PyTorch's caching allocator holds freed memory for reuse, so
nvidia-smishows more thantorch.cuda.memory_allocated(). - ComfyUI manages memory itself, loading and unloading models between nodes; with
--highvramit keeps more resident. - Compilation (
torch.compile) and some attention kernels allocate workspace. - Mixed checkpoints may already be FP8 or pruned, so file size is the better guide than the published parameter count.
When does renting from Wandering Giants Compute fit?
Renting fits when the model you want needs more VRAM than the card you have, or when you want to test whether 24 GB is enough before buying anything. On Wandering Giants Compute you can launch a 24 GB RTX 4090, a 48 GB L40S or a 96 GB RTX PRO 6000 Blackwell with root access and CUDA ready, run the measurement script above, and stop after ten minutes having paid for ten minutes. If credit runs out the machine stops itself, so the bill is never more than you loaded.
If 24 GB is all you will ever need and you generate daily, owning a card may be cheaper; if you want the lowest price per hour, marketplaces undercut us. When you are ready to try the full-precision model, pick the GPU by VRAM.
Frequently asked questions
Can I run SDXL on 8 GB of VRAM?
Yes, with care. SDXL's weights are about 6.9 GB in FP16, so 8 GB works at batch size 1 with VAE tiling or slicing, or with model offload. 12 GB is comfortable, and 16 GB or more leaves room for ControlNets and LoRAs.
How much VRAM does FLUX.1 dev need?
About 34 GB for all weights in BF16: 24 GB for the 12B transformer, 9.5 GB for the T5-XXL encoder and under 0.5 GB for CLIP-L and the VAE. In FP8 it is about 17 GB, which fits a 24 GB card; in 4-bit it is about 10 GB.
Does image resolution change how much VRAM I need?
Yes, but less than the model choice. Higher resolution means more latent tokens and bigger activations, and the VAE decode of a large image can spike memory. VAE tiling avoids most of that spike. Going from 1024 to 2048 pixels quadruples the latent size.
What is the difference between model offload and sequential offload?
Model offload (enable_model_cpu_offload) moves whole components, such as the text encoder or transformer, to the GPU only while they run; it costs a little speed. Sequential offload (enable_sequential_cpu_offload) streams individual layers and uses very little VRAM but is many times slower.
How much VRAM do I need to train a LoRA?
As a rule of thumb, SD 1.5 LoRAs train on 8–12 GB, SDXL on 16–24 GB, and FLUX.1 on 24 GB with FP8 or quantised base weights and gradient checkpointing, with 40–48 GB being comfortable. Batch size and resolution move these numbers a lot.
How do I measure how much VRAM my workflow uses?
Watch nvidia-smi while it runs, or in Python call torch.cuda.reset_peak_memory_stats() before generating and torch.cuda.max_memory_allocated() afterwards. Measure your real workflow at your real resolution; it is more reliable than any table.
Rent the GPU for this, by the minute.
Need more VRAM than your card has? Rent 24 GB, 48 GB or 96 GB by the minute with CUDA and PyTorch ready, and run the model at full precision.
Prepaid credit, billed by the minute, stops itself when credit runs out. Prices in £, $, €, ¥, CA$, A$, CHF and S$; UK prices include VAT.
Keep reading
- Complete guideHow to Run Stable Diffusion on a Cloud GPU
- GuideWhat GPU Do You Need for AI Image Generation?
- GuideWhat Is GPU VRAM and Why Does It Matter for AI?
- GuideQuantization Explained: Running Large AI Models on Smaller GPUs
- TutorialHow to Run FLUX Locally or on Cloud GPU Infrastructure
- TutorialHow to Run ComfyUI on a Cloud GPU
About this article. Written by the Wandering Giants Compute team, the people who run Wandering Giants Compute. Hardware figures are the manufacturers’ published specifications. Speeds and costs marked as estimates are worked out from those specifications and our current prices, with the method shown; they are not measured benchmarks. Wandering Giants prices are taken live from our price list each time this page is built.
Last reviewed 25 November 2026.