High severity beginner · Fix: 5-15 min

FutureWarning: stable-diffusion-v1-5 is deprecated

FutureWarning: Model stable-diffusion-v1-5 is deprecated. Use stable-diffusion-xl-base-1.0 or FLUX.1-dev instead.

What this error means
Stable Diffusion v1.5 is deprecated in favor of SDXL and FLUX.1-dev, which provide superior image quality, faster inference, and better instruction following.

Stack trace

traceback
FutureWarning: Model 'runwayml/stable-diffusion-1-5' is deprecated and will be removed in a future release. Please use 'stabilityai/stable-diffusion-xl-base-1.0' or 'black-forest-labs/FLUX.1-dev' instead for improved image quality and performance.
  warnings.warn(DeprecationWarning('stable-diffusion-v1.5 deprecated'))
QUICK FIX
Replace 'runwayml/stable-diffusion-1-5' with 'stabilityai/stable-diffusion-xl-base-1.0' and StableDiffusionPipeline with StableDiffusionXLPipeline, add torch_dtype=torch.float16.

Why it happens

Stable Diffusion v1.5 was released in 2022 and has been superseded by SDXL (2023) and FLUX.1 (2024), which offer significantly better image quality, faster inference, better text understanding, and improved safety. The diffusers library now warns users to migrate away from v1.5 to avoid using outdated models. Running v1.5 in production also means missing years of improvements in architecture, training data quality, and optimization.

Detection

Check your model_id parameter: if it contains 'stable-diffusion-1', 'sd-1-5', or 'runwayml/stable-diffusion-1-5', you're using a deprecated model. Monitor warning logs for 'FutureWarning' or 'DeprecationWarning' during inference. Use `pip show diffusers` to confirm your diffusers version supports modern models.

Causes & fixes

1

Code explicitly loads stable-diffusion-v1-5 using StableDiffusionPipeline with the old model ID

✓ Fix

Replace model_id with 'stabilityai/stable-diffusion-xl-base-1.0' and use StableDiffusionXLPipeline instead of StableDiffusionPipeline. SDXL requires torch.float16 or torch.bfloat16 to fit in VRAM.

2

Using v1.5 because it was the default in outdated tutorials or documentation

✓ Fix

Update your documentation references and use SDXL for most use cases. FLUX.1-dev requires more VRAM (~24GB) but produces state-of-the-art results: use only if you have the capacity.

3

Keeping v1.5 for backward compatibility with older code or fine-tuned checkpoints

✓ Fix

If you have fine-tuned v1.5 weights, use LoRA adapters with SDXL instead: they're transferable. For critical legacy pipelines, pin diffusers<0.21.0 temporarily, but plan a migration within 2-3 releases.

4

Deployment environment pins an old diffusers version that still defaults to v1.5

✓ Fix

Update your requirements.txt to diffusers>=0.27.0 (tested version) and ensure your GPU has 8GB+ VRAM for SDXL or 24GB+ for FLUX. Update any Docker base images or CI/CD dependency locks.

Code: broken vs fixed

Broken - triggers the error
python
import os
import torch
from diffusers import StableDiffusionPipeline  # ❌ WRONG: StableDiffusion (v1.5 era)

model_id = 'runwayml/stable-diffusion-1-5'  # ❌ WRONG: deprecated model
token = os.getenv('HF_TOKEN')

pipe = StableDiffusionPipeline.from_pretrained(
    model_id,
    use_auth_token=token,
    torch_dtype=torch.float32
)
pipe = pipe.to('cuda')

image = pipe('A serene landscape at sunset').images[0]
image.save('output.png')
Fixed - works correctly
python
import os
import torch
from diffusers import StableDiffusionXLPipeline  # ✅ FIXED: SDXL pipeline

model_id = 'stabilityai/stable-diffusion-xl-base-1.0'  # ✅ FIXED: current recommended model
token = os.getenv('HF_TOKEN')

pipe = StableDiffusionXLPipeline.from_pretrained(
    model_id,
    use_auth_token=token,
    torch_dtype=torch.float16  # ✅ FIXED: float16 for VRAM efficiency
)
pipe = pipe.to('cuda')

image = pipe('A serene landscape at sunset').images[0]
image.save('output.png')
print('✓ Image generated using SDXL — higher quality, no deprecation warnings')
Switched from StableDiffusionPipeline (v1.5) to StableDiffusionXLPipeline with the current recommended model 'stabilityai/stable-diffusion-xl-base-1.0' and torch.float16 precision to match diffusers>=0.27.0 standards and eliminate deprecation warnings.

Workaround

If you cannot upgrade immediately due to fine-tuned v1.5 model weights, pin diffusers to version <0.21.0 (e.g., diffusers==0.20.2) in your requirements.txt to suppress the warning. This is a temporary measure only: plan migration within 2-3 release cycles. Alternatively, convert v1.5 LoRA adapters to SDXL using the `diffusers` conversion scripts in the official repo (github.com/huggingface/diffusers/tree/main/scripts).

Prevention

Always check the HuggingFace Model Card and diffusers official documentation before choosing a model. Use 'stabilityai/stable-diffusion-xl-base-1.0' as your default for most production use cases (512x768, 512x512 aspect ratios). For even higher quality and faster inference on newer hardware, use 'black-forest-labs/FLUX.1-dev' if you have 24GB+ VRAM available. Set up a dependency update check in your CI/CD to warn when diffusers has a new major version, and include model upgrade tasks in your quarterly maintenance cycle.

Python 3.9+ · diffusers >=0.21.0 · tested on 0.27.0
Verified 2026-04 · stabilityai/stable-diffusion-xl-base-1.0, black-forest-labs/FLUX.1-dev, runwayml/stable-diffusion-1-5 (deprecated)
Verify ↗

Community Notes

No notes yetBe the first to share a version-specific fix or tip.