Skip to main content
Back

CompVis Drops Stable Diffusion v1-4 Running on a Single Consumer GPU

CompVis published the Stable Diffusion v1-4 checkpoint on Hugging Face, a latent text-to-image diffusion model fine-tuned for classifier-free guidance.

Pro

  • CompVis released Stable Diffusion v1-4, a 0.9B parameter latent text-to-image diffusion model.
  • Checkpoint resumed from v1-2, fine-tuned 225k steps at 512x512 on laion-aesthetics v2 5+.
  • Trained with 10% text-conditioning dropout to improve classifier-free guidance sampling.
  • Architecture uses CLIP ViT-L/14 text encoder feeding a UNet via cross-attention over an 8x downsampled latent.
  • Trained on 256 A100 GPUs with batch size 2048; released under CreativeML OpenRAIL M license.
  • Ships with Diffusers PyTorch and JAX/Flax pipelines plus a safety checker for NSFW filtering.

CompVis has released the Stable Diffusion v1-4 checkpoint on Hugging Face, a latent text-to-image diffusion model built by Robin Rombach and Patrick Esser. The weights are packaged for the Diffusers library and ship under a permissive CreativeML OpenRAIL M license, usable from a PyTorch or JAX/Flax pipeline in a handful of lines of code.

The v1-4 weights are not a from-scratch training run. The checkpoint was initialized from Stable-Diffusion-v1-2 and fine-tuned for 225k steps at 512x512 resolution on "laion-aesthetics v2 5+", with 10% dropout on the text conditioning to improve classifier-free guidance sampling. That dropout is the trick behind classifier-free guidance: the model learns both a conditional and unconditional score, so the sampler can extrapolate between them at inference time.

Inside the checkpoint

Under the hood, this follows the same latent diffusion recipe from the High-Resolution Image Synthesis paper. The model generates and modifies images from text prompts using a fixed, pretrained CLIP ViT-L/14 text encoder, an approach borrowed from the Imagen paper.

The pipeline splits work across three components:

  • An autoencoder turns images into latent representations at a downsampling factor of 8, mapping H x W x 3 images to H/f x W/f x 4 latents.
  • A ViT-L/14 text encoder processes prompts. Its non-pooled output feeds the UNet backbone via cross-attention.
  • The training loss is a reconstruction objective between the noise added to the latent and the UNet's prediction.

The full checkpoint weighs in at 0.9B parameters, small enough to run on a single consumer GPU when loaded in float16.

Training scale and hardware

The compute footprint is disclosed in unusual detail for an open release. The run used 32 x 8 A100 GPUs, the AdamW optimizer, gradient accumulation of 2, and an effective batch size of 32 x 8 x 2 x 4 = 2048. Learning rate was warmed up to 0.0001 over 10,000 steps and then held constant.

CompVis also published an environmental impact estimate: A100 PCIe 40GB hardware, 150,000 hours used, AWS as the cloud provider in US-East, and 11,250 kg CO2 eq. emitted. That level of transparency remains rare for foundation model releases.

Where v1-4 diverges from its siblings

The v1 family shares a base but diverges in fine-tuning data and objective. v1-4 resumes from v1-2 (not v1-3) and swaps in the aesthetics-filtered LAION subset. Evaluation curves published by CompVis compare FID against CLIP score across guidance scales.

FID vs CLIP score across v1.1, v1.2, v1.3 checkpoints

Evaluations swept classifier-free guidance scales of 1.5, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, and 8.0, using 50 PLMS sampling steps on 10,000 random prompts from the COCO2017 validation set at 512x512 resolution. The checkpoints were not tuned to optimize FID.

Running it from Diffusers

The recommended path is the Hugging Face Diffusers library. A minimal inference call looks like this:

import torch
from diffusers import StableDiffusionPipeline
pipe = StableDiffusionPipeline.from_pretrained(
    "CompVis/stable-diffusion-v1-4",
    torch_dtype=torch.float16,
).to("cuda")
image = pipe("a photo of an astronaut riding a horse on mars").images[0]
image.save("astronaut.png")

For GPUs with less than 4GB of VRAM, the model card recommends float16 weights plus pipe.enable_attention_slicing(). A JAX/Flax pipeline also ships for TPU inference, with a dedicated bf16 branch of the weights for memory-constrained TPUs.

Where it breaks

CompVis is explicit about what v1-4 will and will not do. The listed limitations include:

  • The model does not achieve perfect photorealism, cannot render legible text, struggles with compositional prompts like "A red cube on top of a blue sphere," may misrender faces and people, and was trained mainly on English captions.
  • The autoencoder is lossy, so fine detail can be washed out on the way through the latent space.
  • No deduplication was applied to the dataset, and the team observed some memorization of images duplicated in training data.

Intended use is scoped to research: probing generative model behavior, artistic and design workflows, and educational tools. The release ships with a Safety Checker in Diffusers that compares generated image embeddings against hidden NSFW concept vectors before the image is returned to the caller.