Library / SDK
huggingface/diffusion-models-class avatar
huggingface/diffusion-models-class

huggingface/diffusion-models-class: a notebook course for training and fine-tuning diffusion models

Materials for the Hugging Face Diffusion Models Course

4,360 stars493 forksJupyter NotebookApache-2.0

At a glance

What is it?
The Hugging Face Diffusion Models Course is a set of Jupyter notebooks that walk through diffusion theory, the Diffusers library, fine-tuning and guidance. It is aimed at Python users who already know some PyTorch, and it is a course rather than a library.
Who is it for?
Adopt this course if you already write Python and have touched PyTorch, and you want to train or fine-tune a diffusion model rather than only call a hosted image API. Do not adopt it as a library or as a maintained toolkit: it is teaching material, and the syllabus table still lists unit4 as January 2023 (TBC).
Can I use it commercially?
Yes. Apache-2.0 is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
Is it still maintained?
Yes. The repository last received commits 13 days ago.
What is it written in?
Mainly Jupyter Notebook, according to GitHub's language statistics.

Answers come from the project's GitHub data, last synced on September 29, 2026, and from our analysis. They are not legal advice.

Editorial analysis

What the Hugging Face Diffusion Models Course is for, and who should take it

This repository is the material for a free course. It is not a package you import. The README lists what a student will do: study the theory behind diffusion models, generate images and audio with the Diffusers library, train models from scratch, fine-tune existing models on new datasets, explore conditional generation and guidance, and build custom pipelines. That list is the scope. If your goal is to call a hosted text-to-image endpoint, this is the wrong entry point, because most of the units are about the training and sampling loop rather than about inference as a service. The stated prerequisites are good Python skills and basics in deep learning and PyTorch, and the README points at Udacity and PyTorch tutorials for anyone who is not there yet. So the audience is narrower than the title suggests: it is for people who can read a training loop and want to modify one. The repository is organised by unit, with unit0 through unit4 at the top level alongside a hackathon directory and a _toctree.yml file, which suggests the notebooks are also meant to be rendered as a structured site. The last push to the repository was on 2026-09-17, so the files have been touched recently even though the syllabus dates come from late 2022 and early 2023.

How the units and notebooks fit together

The README carries a syllabus table with publishing dates and links to each unit folder. Unit 1, dated November 28, 2022, is An Introduction to Diffusion Models, with hands-on work described as an introduction to Diffusers and diffusion models from scratch. Unit 2, dated December 12, 2022, covers Fine-Tuning and Guidance, with hands-on fine-tuning on new data and adding guidance. Unit 3, dated December 21, 2022, is Stable Diffusion, described as exploring a text-conditioned latent diffusion model. Unit 4 is listed as January 2023 (TBC) under the title Doing More with Diffusion, with advanced techniques. The table is the honest map of the repository: three units with dates, one marked to be confirmed. The README also says the course will consist of at least four units, with more added over time on topics such as diffusion for audio. That promise is part of the design, and it is also the main structural risk, since a reader arriving now cannot tell from the README alone how much of unit4 is finished. There is a hackathon directory at the top level, and the README mentions competitions and swag for the best pipelines and demos with details TBD, so some of the repository is event material rather than a numbered unit.

Installing the course and running a first notebook

There is no package to install. The course is delivered as Jupyter notebooks, and the README badge says Made with Jupyter, so the practical route is to clone the repository and open a notebook in Jupyter or a hosted notebook environment.

bash
git clone https://github.com/huggingface/diffusion-models-class.git
cd diffusion-models-class

After cloning, the unit folders are at the top level. Unit 1 is the place to start, since the syllabus describes it as the introduction to Diffusers and to building diffusion models from scratch.

bash
ls unit1

You should see the notebook files for that unit in the listing. The README states that a Hugging Face account is required to push custom models and pipelines to the hub, and links to the signup page at https://huggingface.co/join. Creating the account is free according to the README. The repository does not give a requirements file or a pip install line in the README, so the dependencies come from whatever the notebooks themselves import: the badges name Jupyter and PyTorch, and the course description names the Diffusers library. The README also points readers to a signup form and a Discord server for discussion, and it notes that instructions for joining specific categories and channels are linked separately. If you want to follow along with other students, that is where the course says the conversation happens.

Where the course material stops and your own work begins

A course repository has a different failure mode from a library. Nothing here versions your environment for you. The README gives no pinned dependency list, no Python version, and no container image, so a notebook that ran when a unit was published may import APIs that have since changed in Diffusers or PyTorch. That is a real cost for anyone returning to unit2 or unit3 after a gap. The second limitation is coverage. The syllabus table lists four units, and the fourth is marked TBC with a January 2023 date, while the README says more units will be added over time. A reader who wants the advanced material described under Doing More with Diffusion cannot confirm from the README how complete that folder is. The third is the prerequisite bar. The README asks for good Python skills and basics in deep learning and PyTorch, and it links to introductory resources rather than teaching those subjects itself. If you have never written a training loop, the notebooks will be hard to follow, and the course will not fix that. Finally, translations are community-run. The README lists Chinese, Japanese and Korean versions hosted in separate repositories by named contributors, and it recommends waiting before contributing a translation until the English content is in its final form. Those translations are forks, not part of this repository, so they can drift.

Compared with reading the Diffusers documentation directly

The obvious alternative is the Diffusers library documentation and its own examples. The difference in approach is sequence and intent. Diffusers documentation is reference material organised around components: pipelines, schedulers, models, training scripts. You go there with a task and look up the class that does it. This course is organised around a learning order, unit by unit, from theory to from-scratch training to fine-tuning to a specific latent diffusion model. That order is the product. The trade-off is that a course ages as a whole, while reference documentation is revised in place. If you already know how to train a model and only need the current API for a scheduler, the course adds a detour. If you can write PyTorch but have never implemented a noise schedule or a guidance scale, the unit sequence saves you from assembling that path yourself. A second alternative is a university course on diffusion models, which the related searches show people also look for. Those tend to be lecture-based and heavier on theory, while this repository is notebook-first and tied to one library, Diffusers, and to the Hugging Face hub for pushing models.

Licence, maintenance and what an upgrade costs you

The repository carries the Apache-2.0 licence, and the README shows a licence badge matching it. That is a permissive licence, and for a course repository the practical effect is that the notebook text and code can be reused and adapted, including in commercial training material, subject to the terms of the licence itself. This is not legal advice, and anyone planning to redistribute the notebooks or build a paid course on them should read the LICENSE file at the top level and, if the stakes are high, take advice. On maintenance, the last push was on 2026-09-17, which is recent, but the syllabus dates are from 2022 and 2023 and the README still marks unit4 as TBC. So the repository is being touched, while the course outline as published has not been rewritten to reflect that. There are no releases in the repository, which fits a course: there is no version number to upgrade to. The upgrade cost is therefore not a dependency bump but a re-read. If you worked through unit2 when it was published and come back later, you should expect to re-run the notebook and fix imports rather than follow a changelog, because the README does not document one.

Editorial conclusion

Adopt this course if you already write Python and have touched PyTorch, and you want to train or fine-tune a diffusion model rather than only call a hosted image API. Do not adopt it as a library or as a maintained toolkit: it is teaching material, and the syllabus table still lists unit4 as January 2023 (TBC). Before you start, check whether the unit you want is fully published in the repository, and confirm you have a Hugging Face account, because the README states that pushing custom models and pipelines to the hub requires one.

Frequently asked questions

Is the Hugging Face Diffusion Models Course free?

The README answers this directly: the class is free. The repository is public under Apache-2.0, and the notebooks are the course material.

Do I need a Hugging Face account for the Diffusion Models Course?

The README states that you need an account to push your custom models and pipelines to the hub, and that creating one is free. It links to the signup page at https://huggingface.co/join.

What are the prerequisites for the huggingface/diffusion-models-class?

The README asks for good skills in Python and basics in deep learning and PyTorch. It links to introductory Python, PyTorch and deep learning resources for readers who are not there yet.

How many units does the Diffusion Models Course have?

The README says the course will consist of at least four units, and its syllabus table lists unit1 through unit4. Unit4 is marked January 2023 (TBC) under the title Doing More with Diffusion.

Is the Diffusion Models Course available in languages other than English?

The README lists community translations in Chinese, Japanese and Korean, each hosted in a separate repository by named contributors. The README recommends waiting until the English content is in final form before contributing a new translation.

Official sources

  1. huggingface/diffusion-models-class on GitHub
  2. Issues
  3. License: Apache-2.0
  4. README
Add this badge to your README

If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.

Add this badge to your README

markdown
[![Hysen Labs](https://hysenlabs.com/badge/huggingface-diffusion-models-class.svg)](https://hysenlabs.com/projects/huggingface-diffusion-models-class)