Stable Diffusion

Stable Diffusion Generating Black Images — How to Fix It

Stable Diffusion producing completely black images is one of the most common frustrations for both new and experienced users. This issue typically appears after changing model weights, VAE files, or launch arguments. It affects users running AUTOMATIC1111, ComfyUI, and other frontends on both local machines and cloud GPU environments.

?

Why does this error happen?

Black image output in Stable Diffusion almost always traces back to a VAE (Variational Autoencoder) decode failure or a half-precision (float16) numerical overflow. When the --no-half flag is absent or incorrectly set, certain GPUs — especially those with limited float16 support — produce NaN (not-a-number) tensor values during the decode step, which render as solid black pixels. A mismatch between the model's expected VAE and the one currently loaded can cause the same result. Additionally, an excessively high CFG scale (above 15) can push latent values out of the decodable range, and some xformers builds introduce memory layout conflicts that corrupt the final decode pass.

How to fix it

1

Disable --no-half or Switch to --no-half-vae

If you are launching with the --no-half flag, try removing it first, then relaunch the application. If black images persist, add --no-half-vae instead, which forces the VAE decoder to run in full float32 precision without affecting overall VRAM usage as severely as --no-half alone.

2

Switch to a Known-Good VAE (vae-ft-mse-840000)

Download the vae-ft-mse-840000-ema-pruned.safetensors file and place it in your models/VAE folder. In AUTOMATIC1111, navigate to Settings → Stable Diffusion → SD VAE and select it from the dropdown, then apply and generate again. This VAE is widely tested and resolves black image issues caused by a corrupt or incompatible embedded VAE in certain checkpoint files.

3

Lower Your CFG Scale Below 15

Open your generation settings and confirm the CFG scale (classifier-free guidance) is set to a value between 5 and 12 for most models. Values above 15 can drive latent activations into extreme ranges that the VAE cannot decode correctly, resulting in black or heavily saturated outputs. Reduce the value incrementally and re-run your prompt to verify the fix.

4

Disable xformers and Retest

Remove the --xformers flag from your launch script and restart the server to rule out a memory attention conflict introduced by your installed xformers version. If images render correctly without xformers, try updating xformers via pip install -U xformers before re-enabling it. This is especially relevant after upgrading PyTorch or switching CUDA versions.

💡 Pro Tip

Always pin a specific VAE in your Settings rather than relying on the model's embedded VAE — this single habit eliminates the majority of black image regressions when you switch between checkpoints.

Frequently Asked Questions

Why do black images only appear on some prompts and not others?
Certain prompt combinations push the latent space into edge-case values that overflow the VAE decoder under half-precision, while simpler prompts stay within a safe range. Switching to --no-half-vae ensures the decode step is stable regardless of latent magnitude.
Can a corrupted model checkpoint cause black images?
Yes — a partially downloaded or corrupted .safetensors or .ckpt file can produce black output alongside other artifacts like color banding. Verify the file hash against the source and re-download if it does not match.
Does this issue affect SDXL models differently than SD 1.5?
SDXL uses a different VAE architecture that is more sensitive to half-precision errors, making black image outputs more common when --no-half-vae is not set. Always use --no-half-vae or the dedicated SDXL VAE (sdxl_vae.safetensors) when working with SDXL checkpoints.
Will running on a cloud GPU fix the black image problem?
Cloud GPUs with higher VRAM allow you to run in full float32 precision without the memory constraints that force half-precision workarounds on consumer cards. Platforms like RunPod let you spin up an A100 or H100 instance where black image issues caused by float16 overflow are significantly reduced.

Quick diagnostic checklist

Before diving into the full fix, run through these quick checks — they resolve the issue in most cases without additional steps:

1.Verify your GPU has sufficient VRAM for the selected model (SD 1.5 needs 4GB, SDXL needs 8GB)
2.Check that the model checkpoint file is not corrupted by comparing its hash
3.Update your GPU drivers to the latest version
4.Try reducing image resolution or batch size to lower memory usage
5.Check the Automatic1111 console output for specific Python error messages

Common root causes

Understanding why this error occurs helps you prevent it in the future. The most frequent causes are:

  • Insufficient GPU VRAM for the selected model
  • Corrupted model checkpoint file
  • Outdated GPU drivers
  • Python dependency conflicts in the installation
  • Incompatible CUDA version for the installed PyTorch

Still not working?

If none of the steps above resolved the issue, the next step is to contact Stable Diffusion support directly. When reaching out, include:

  • • The exact error message or code you see
  • • The steps you already tried from this guide
  • • Your account plan and the approximate time the error started
  • • Your browser/OS version if it is a web interface issue
Open Stability AI Support

About Stable Diffusion

Stable Diffusion is an open-source AI image generation model developed by Stability AI. Unlike cloud-based tools, it can be run locally on consumer GPUs. It is accessible via Automatic1111 WebUI, ComfyUI, and cloud platforms like DreamStudio. Local installations require a compatible NVIDIA or AMD GPU with at least 4GB VRAM.

Browse all Stable Diffusion error guides →