---
title: "Training Stable Diffusion with Dreambooth using Diffusers"
description: "Dreambooth fine-tuning of Stable Diffusion overfits quickly, so learning rate and step count must be tuned together."
url: "https://swe.quest/articles/training-stable-diffusion-with-dreambooth-using-diffusers-498f7d039b45823b"
canonical: "https://huggingface.co/blog/dreambooth"
source: "Hugging Face"
published: "2022-11-07"
difficulty: "medium"
kind: "Research"
reading_minutes: 8
tags: ["model-training","computer-vision"]
---

# Training Stable Diffusion with Dreambooth using Diffusers

A post on [Hugging Face](https://swe.quest/sources/hugging-face.md), published 2022-11-07, 8 min read, Research. Original: [https://huggingface.co/blog/dreambooth](https://huggingface.co/blog/dreambooth)

## Summary

Dreambooth fine-tuning of Stable Diffusion overfits quickly, so learning rate and step count must be tuned together. Experiments on 2x A100s found low learning rates (2e-6 for objects at ~400 steps, 1e-6 to 2e-6 with 800-1200 steps for faces) work best. Prior preservation matters mainly for faces, and the DDIM scheduler with ~100 inference steps cleans up noise from overfit models. Fine-tuning the text encoder alongside the UNet gave the biggest quality gain but needs ~24 GB of GPU memory; 8-bit Adam, fp16 or gradient accumulation bring training down to 16 GB.

Written by swe.quest, not by the author.

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

## Topics

- [Model training](https://swe.quest/tags/model-training.md) (AI & ML)
- [Computer vision](https://swe.quest/tags/computer-vision.md) (AI & ML)

## Prerequisites

- diffusion model basics
- fine-tuning hyperparameters ([easy posts on Model training](https://swe.quest/tags/model-training.md?difficulty=easy))
- Stable Diffusion

## Keywords

Dreambooth, Stable Diffusion, Diffusers, DDIM, Textual Inversion, prior preservation

## 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.
- [LoRA training scripts of the world, unite!](https://swe.quest/articles/lora-training-scripts-of-the-world-unite-73f0d15365f25313.md): Hugging Face · 2024-01-02 · Hard · 18 min read · Model training, Computer vision, Machine learning
  Combining Pivotal Tuning (textual inversion of newly inserted tokens, then LoRA fine-tuning) with the adaptive Prodigy optimizer produces strong SDXL Dreambooth LoRA results, and both are now available in a diffusers training script.
- [Stable Diffusion with 🧨 Diffusers](https://swe.quest/articles/stable-diffusion-with-diffusers-03ca8448e680e397.md): Hugging Face · 2022-08-22 · Medium · 15 min read · Computer vision, Inference & serving, Machine learning, Python
  Stable Diffusion is a latent diffusion model that denoises compressed 64×64 latents rather than pixels, combining a VAE, a text-conditioned U-Net with cross-attention, and a frozen CLIP text encoder.
- [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.
- [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.

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)
