Skip to main content

Diffusion Model Playground

GitHub Actions Workflow Status GitHub Release PyPI - Python Version GitHub Repo stars

This is a simplified framework to train and run diffusion models.

Getting Started

To get started, simply install the python package from PyPI:

pip install diffusion-model-framework

The base install only has what the models and samplers need. Extras add more:

Extra Adds For
inference click, hydra the diffusion-models infer CLI
training inference + tensorboard, transformers training
evaluation inference + torchmetrics FID / KID
pip install "diffusion-model-framework[inference]"

Then, you're ready to start setting up your own training process. For help getting started with that, have a look at some of the examples.

Installing the package

Thanks to uv, installing this package is very simple and can be done in a single command. Simply run:

uv sync

That's it, the package is installed. Move to the next section to learn how to use this package.

Conditional generation

A model trained with a conditioning config (preset latent_celeba_f4c4_cond) generates faces from a list of attributes typed as text:

diffusion-models infer checkpoint=<final.pt> attributes="glasses, blond, man, no beard" \
  guidance_scale=3 eta=1.0 steps=100 number_of_images=16 seed=0

Terms are separated by commas, semicolons or "and". Prefix a term with no, not, without or non- to ask for its absence (no glasses). Attributes you leave out stay free. A term is either one of the words below or the exact name of a CelebA attribute (case and _ vs space do not matter). A misspelt term suggests the closest ones, and a contradiction (glasses, no glasses) is an error.

Attribute (CelebA name) Everyday words that select it
5_o_Clock_Shadow stubble, shadow
Arched_Eyebrows —
Attractive attractive
Bags_Under_Eyes —
Bald bald
Bangs bangs, fringe
Big_Lips —
Big_Nose —
Black_Hair black hair, dark hair
Blond_Hair blond, blonde, blond hair
Blurry blurry
Brown_Hair brunette, brown hair
Bushy_Eyebrows —
Chubby chubby
Double_Chin —
Eyeglasses glasses, spectacles
Goatee goatee
Gray_Hair gray hair, grey hair, gray, grey
Heavy_Makeup makeup
High_Cheekbones —
Male man, men, boy, male, woman (absent), women (absent), girl (absent), female (absent), lady (absent)
Mouth_Slightly_Open open mouth
Mustache mustache, moustache
Narrow_Eyes —
No_Beard beard (absent), bearded (absent), clean shaven, shaved
Oval_Face —
Pale_Skin pale
Pointy_Nose —
Receding_Hairline —
Rosy_Cheeks —
Sideburns sideburns
Smiling smile, smiling
Straight_Hair straight, straight hair
Wavy_Hair wavy, wavy hair
Wearing_Earrings earrings
Wearing_Hat hat
Wearing_Lipstick lipstick
Wearing_Necklace necklace
Wearing_Necktie tie, necktie
Young young, old (absent), elderly (absent)

"Absent" words select the opposite: woman is "not Male". No_Beard is a CelebA attribute that is set when the face has no beard, so no beard selects it and beard asks for its absence. The full list is diffusion_models.diffusion.conditioning.CELEBA_ATTRIBUTES.

Building from source

Installing uv

This tool uses uv. If you already have uv installed, please skip to the next section. Otherwise, run:

curl -LsSf https://astral.sh/uv/install.sh | sh

You can find out more about uv installation here.

That's it, uv is set up.

Installing and building locally

Installing the package via uv is very simple. Simply run:

uv sync

You can now start using the package to train your diffusion model. For example, try running:

uv run diffusion-models train diffuser

Tab completion for commands, config groups (model=<TAB>), presets (+config=<TAB>) and config keys is available for bash, zsh and fish. For bash:

eval "$(uv run diffusion-models completion bash)"   # add to ~/.bashrc
diffusion-models configs list diffuser               # groups, options, presets

Completion reads a cached snapshot of the registered configs (in ~/.cache/diffusion-models), rebuilt automatically whenever the code changes, so it stays fast.

Building a wheel is also possible via:

uv build

Building the documentation

First you will need to install the dependency group used for documentation.

uv sync --group documentation

Now you can build the documentation using Sphinx by running:

uv run sphinx-build -M html docs/source/ docs/build

Metadata

Release files for diffusion-model-framework 1.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for diffusion-model-framework 1.2.0
File Size Uploaded Provenance Actions
diffusion_model_framework-1.2.0.tar.gz 47.1 MB With provenance Details for diffusion_model_framework-1.2.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for diffusion-model-framework 1.2.0
File Interpreter ABI Platform Actions
diffusion_model_framework-1.2.0-py3-none-any.whl Python 3 none any Details for diffusion_model_framework-1.2.0-py3-none-any.whl

Total release size: 47.3 MB

Release files / diffusion_model_framework-1.2.0.tar.gz

Download URL diffusion_model_framework-1.2.0.tar.gz
Size 47.1 MB
Tags Source
SHA-256 checksum
How to use checksums
5af1d06c761b9da1bd3952f6c3cbc6231623047a986c460009f095acbfcba79c
BLAKE2b-256 checksum
How to use checksums
2edf4ccaa54f94626c1b07e1298b67a0644862fab0e02b4b50d05d6d0b743b7a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 29, 2026.

Transparency log

Release files / diffusion_model_framework-1.2.0-py3-none-any.whl

Download URL diffusion_model_framework-1.2.0-py3-none-any.whl
Size 136.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
39503b5834d2b587757e94cea178923a778aba8201b82750505efb1f0b09f958
BLAKE2b-256 checksum
How to use checksums
fbdd2e9a425d9d68ee5f7d3b1080de8c37eb17924502ee005162f55c8d23bb65
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 29, 2026.

Transparency log

Security for diffusion-model-framework 1.2.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for diffusion_model_framework-1.2.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 29, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

1.2.0 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page