Model reference · open weights

small-stable-diffusion

Image OFA-Sys Text→image 1 build Open weights 2k dl/mo

small-stable-diffusion is an open-weight image model from OFA-Sys. small-stable-diffusion-v0 (BF16) weighs 4.4 GB; the smallest configuration that runs it is RTX 3060 12 GB.

For self-hosting, compare this build's requirements below with the GPU you plan to rent.

  • small-stable-diffusion is a text-to-image model developed by OFA-Sys that generates images from English prompts.
  • It is nearly half the size of standard stable diffusion models and was trained for 1100k steps using knowledge distillation from larger teacher models.
  • The model is released under the openrail license.

Summary of the OFA-Sys/small-stable-diffusion-v0 model card, 2026-10-01

What it is

Released byOFA-Sys
Released2023-01-16
VRAM4.4 GB for the weights

What it runs on

Memory and cards for small-stable-diffusion-v0 (BF16)

4.4 GBweights, file size
2.3 GBbiggest part
5.0 GBworking memory, one 1024² image
537 MBruntime overhead
CardOne imageMemory
RTX 3060 12 GBtight11.6 GB
RTX 4060 Ti 16 GBfits15.4 GB
RTX 3090 24 GBfits23.4 GB
RTX 4090 24 GBfits23.4 GB
RTX 5090 32 GBfits31.0 GB
L40S 48 GBfits44.0 GB
A100 80 GBfits78.2 GB
H100 80 GBfits78.1 GB
RTX PRO 6000 Blackwell 96 GBfits93.8 GB
DGX Spark (GB10) 128 GB unifiedfits107 GB
H200 141 GBfits138 GB
B200 180 GBfits176 GB

From the model card

What OFA-Sys says about small-stable-diffusion

Read the model card

【Update 2023/02/07】 Recently, we have released a diffusion deployment repo to speedup the inference on both GPU (~4x speedup, based on TensorRT) and CPU (~12x speedup, based on IntelOpenVINO). Integrated with this repo, small-stable-diffusion could generate images in just 5 seconds on the CPU*.

* Test on Intel(R) Xeon(R) Platinum 8369B CPU, DPMSolverMultistepScheduler 10 steps, fix channel/height/width when converting to Onnx

Similar image generation quality, but is nearly 1/2 smaller! Here are some samples:

Gradio

We support a Gradio Web UI to run small-stable-diffusion-v0: We also provide a space demo for small-stable-diffusion-v0 + diffusion-deploy. As huggingface provides AMD CPU for the space demo, it costs about 35 seconds to generate an image with 15 steps, which is much slower than the Intel CPU environment as diffusion-deploy is based on Intel's OpenVINO.

Example

Use Diffusers >=0.8.0, do not support lower versions.

import torch
from diffusers import StableDiffusionPipeline

model_id = "OFA-Sys/small-stable-diffusion-v0/"
pipe = StableDiffusionPipeline.from_pretrained(model_id, torch_dtype=torch.float16)
pipe = pipe.to("cuda")

prompt = "an apple, 4k"
image = pipe(prompt).images[0]

image.save("apple.png")

Training

Initialization

This model is initialized from stable-diffusion v1-4. As the model structure is not the same as stable-diffusion and the number of parameters is smaller, the parameters of stable diffusion could not be utilized directly. Therefore, small stable diffusion set layers_per_block=1 and select the first layer of each block in original stable diffusion to initilize the small model.

Training Procedure

After the initialization, the model has been trained for 1100k steps in 8xA100 GPUS. The training progress consists of three stages. The first stage is a simple pre-training precedure. In the last two stages, the original stable diffusion was utilized to distill knowledge to small model as a teacher model. In all stages, only the parameters in unet were trained and other parameters were frozen.

  • Hardware: 8 x A100-80GB GPUs

  • Optimizer: AdamW

  • Stage 1 - Pretrain the unet part of the model.

    • Steps: 500,000
    • Batch: batch size=8, GPUs=8, Gradient Accumulations=2. Total batch size=128
    • Learning rate: warmup to 1e-5 for 10,000 steps and then kept constant
  • Stage 2 - Distill the model using stable-diffusion v1-4 as the teacher. Besides the ground truth, the training in this stage uses the soft-label (pred_noise) generated by teacher model as well.

    • Steps: 400,000
    • Batch: batch size=8, GPUs=8, Gradient Accumulations=2. Total batch size=128
    • Learning rate: warmup to 1e-5 for 5,000 steps and then kept constant
    • Soft label weight: 0.5
    • Hard label weight: 0.5
  • Stage 3 - Distill the model using stable-diffusion v1-5 as the teacher. Use several techniques in Knowledge Distillation of Transformer-based Language Models Revisited, including similarity-based layer match apart from soft label.

    • Steps: 200,000
    • Batch: batch size=8, GPUs=8, Gradient Accumulations=2. Total batch size=128
    • Learning rate: warmup to 1e-5 for 5,000 steps and then kept constant
    • Softlabel weight: 0.5
    • Hard label weight: 0.5

Training Data

The model developers used the following dataset for training the model:

  1. LAION-2B en aesthetic
  2. LAION-Art
  3. LAION-HD

Citation

@article{Lu2022KnowledgeDO,
  title={Knowledge Distillation of Transformer-based Language Models Revisited},
  author={Chengqiang Lu and Jianwei Zhang and Yunfei Chu and Zhengyu Chen and Jingren Zhou and Fei Wu and Haiqing Chen and Hongxia Yang},
  journal={ArXiv},
  year={2022},
  volume={abs/2206.14366}
}

Uses

The following section is adapted from the Stable Diffusion model card

Direct Use

The model is intended for research purposes only. Possible research areas and tasks include

  • Safe deployment of models which have the potential to generate harmful content.
  • Probing and understanding the limitations and biases of generative models.
  • Generation of artworks and use in design and other artistic processes.
  • Applications in educational or creative tools.
  • Research on generative models.

Excluded uses are described below.

Misuse, Malicious Use, and Out-of-Scope Use

The model should not be used to intentionally create or disseminate images that create hostile or alienating environments for people. This includes generating images that people would foreseeably find disturbing, distressing, or offensive; or content that propagates historical or current stereotypes.

Out-of-Scope Use

The model was not trained to be factual or true representations of people or events, and therefore using the model to generate such content is out-of-scope for the abilities of this model.

Misuse and Malicious Use

Using the model to generate content that is cruel to individuals is a misuse of this model. This includes, but is not limited to:

  • Generating demeaning, dehumanizing, or otherwise harmful representations of people or their environments, cultures, religions, etc.
  • Intentionally promoting or propagating discriminatory content or harmful stereotypes.
  • Impersonating individuals without their consent.
  • Sexual content without consent of the people who might see it.
  • Mis- and disinformation
  • Representations of egregious violence and gore
  • Sharing of copyrighted or licensed

Quoted from the model card on Hugging Face. The full card is behind the Hugging Face link above.

Running it yourself

Run it on a rented GPU

Rent a machine by the hour. Runs as it is with diffusers, on the machine, in Python.

# on your rented machine: pip install diffusers transformers accelerate
import torch
from diffusers import DiffusionPipeline

pipe = DiffusionPipeline.from_pretrained("OFA-Sys/small-stable-diffusion-v0", torch_dtype=torch.bfloat16).to("cuda")
image = pipe(prompt="a red bicycle on a cobbled street").images[0]
image.save("/workspace/out.png")
Renting a GPU: connect, tunnels, Python
© 2026 AxForge · EU-hosted AI infrastructure Pricing Docs Trust Privacy Terms