---
title: "Open-sourcing Knowledge Distillation Code and Weights of SD-Small and SD-Tiny"
description: "Segmind releases training code and weights for SD-Small and SD-Tiny, Stable Diffusion variants compressed by block-removal knowledge distillation that cut UNet parameters by 35% and 55% while keeping image fidelity close to the base model."
url: "https://swe.quest/articles/open-sourcing-knowledge-distillation-code-and-weights-of-sd-small-and-sd-tiny-053ea66ae7ff27cc"
canonical: "https://huggingface.co/blog/sd_distillation"
source: "Hugging Face"
published: "2023-08-01"
difficulty: "medium"
kind: "Announcement"
reading_minutes: 5
tags: ["computer-vision","model-training","inference","open-source"]
---

# Open-sourcing Knowledge Distillation Code and Weights of SD-Small and SD-Tiny

A post on [Hugging Face](https://swe.quest/sources/hugging-face.md), published 2023-08-01, 5 min read, Announcement. Original: [https://huggingface.co/blog/sd\_distillation](https://huggingface.co/blog/sd_distillation)

## Summary

Segmind releases training code and weights for SD-Small and SD-Tiny, Stable Diffusion variants compressed by block-removal knowledge distillation that cut UNet parameters by 35% and 55% while keeping image fidelity close to the base model. The student is trained with three losses: the standard latent diffusion loss, an output-matching loss against the teacher (Realistic-Vision 4.0), and a per-block feature-level loss. Training used 1M LAION Art Aesthetic images scoring above 7.5. The distilled models run up to 2x faster at inference but are early-stage and weak at composition, so they work best fine-tuned or LoRA-trained on specific styles. A portrait fine-tune of SD-Tiny is included with its hyperparameters.

Written by swe.quest, not by the author.

**Difficulty:** Medium: assumes a working developer; shows how it is built or done

## Topics

- [Computer vision](https://swe.quest/tags/computer-vision.md) (AI & ML)
- [Model training](https://swe.quest/tags/model-training.md) (AI & ML)
- [Inference & serving](https://swe.quest/tags/inference.md) (AI & ML)
- [Open source](https://swe.quest/tags/open-source.md) (Engineering practices)

## Prerequisites

- Stable Diffusion basics
- UNet architecture ([easy posts on System design](https://swe.quest/tags/system-design.md?difficulty=easy))
- knowledge distillation

## Keywords

Stable Diffusion, SD-Small, SD-Tiny, diffusers, Realistic-Vision, LAION, LoRA, Segmind

## Related posts

- [Using LoRA for Efficient Stable Diffusion Fine-Tuning](https://swe.quest/articles/using-lora-for-efficient-stable-diffusion-fine-tuning-7bd5416d145ae531.md): Hugging Face · 2023-01-26 · Medium · 7 min read · Model training, Computer vision, Python
  LoRA freezes pretrained weights and trains small rank-decomposition matrices, and diffusers now supports applying it to Stable Diffusion's cross-attention layers for both full fine-tuning and Dreambooth.
- [Diffusers welcomes Stable Diffusion 3.5 Large](https://swe.quest/articles/diffusers-welcomes-stable-diffusion-3-5-large-23c0b39797ac94ee.md): Hugging Face · 2024-10-22 · Medium · 6 min read · Computer vision, Inference & serving, Model training, Python
  Stable Diffusion 3.5 Large (8B) and a timestep-distilled Turbo variant are now usable in Diffusers.
- [Open Preference Dataset for Text-to-Image Generation by the 🤗 Community](https://swe.quest/articles/open-preference-dataset-for-text-to-image-generation-by-the-community-51063f2eca79d4de.md): Hugging Face · 2024-12-09 · Easy · 7 min read · Model training, Computer vision, Evaluation, Open source
  Data is Better Together released an Apache 2.0 text-to-image preference dataset of 10K pairs, with over 30K annotations from more than 250 community members collected in under two weeks.
- [Diffusers welcomes Stable Diffusion 3](https://swe.quest/articles/diffusers-welcomes-stable-diffusion-3-f6ced777e2fcbd47.md): Hugging Face · 2024-06-12 · Medium · 7 min read · Computer vision, Inference & serving, Model training, Python
  Stable Diffusion 3 Medium (2B parameters) is now usable through Diffusers.
- [SDXL in 4 steps with Latent Consistency LoRAs](https://swe.quest/articles/sdxl-in-4-steps-with-latent-consistency-loras-2dbb6e57c86cbe97.md): Hugging Face · 2023-11-09 · Medium · 10 min read · Inference & serving, Computer vision, Model training, Performance engineering
  LCM LoRAs apply latent consistency distillation as small LoRA adapters instead of distilling each full model, so any fine-tuned SDXL or Stable Diffusion 1.5 model can generate images in 4–8 steps instead of 25–50.

Browse: [Latest posts](https://swe.quest/index.md) · [Topics](https://swe.quest/tags.md) · [Sources](https://swe.quest/sources.md) · [Topic map](https://swe.quest/map.md) · [Site guide (llms.txt)](https://swe.quest/llms.txt)
