# crowsonkb/k-diffusion

Karras et al. (2022) diffusion models for PyTorch

Repository: https://github.com/crowsonkb/k-diffusion
Canonical: https://ross.abutalabs.com/products/k-diffusion
Language: Python
License: MIT
License Family: permissive
Last push: 2026-02-12T18:38:38+00:00

## Health v2 (maintenance only)
Score: 53/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 67, release rhythm 8, longevity 100
- inputs: {"age_days": 1534, "days_push": 202, "days_rel": null, "gap_med": null, "n_releases_24m": 0}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 2600, forks 401 (observed 2026-08-28T04:07:03.298325+00:00)

## What it is
A PyTorch library implementing Karras et al. (2022) diffusion models with enhancements like improved sampling algorithms and transformer-based diffusion architectures. It includes an hourglass diffusion transformer model type for image generation and training utilities.

## Use cases
- train diffusion models for image generation in pytorch
- implement Karras et al 2022 diffusion sampling
- generate images with a diffusion transformer
- experiment with improved diffusion samplers
- train a text-to-image or class-conditional diffusion model
- research diffusion model design space

## When to choose
- you need a faithful, enhanced implementation of Karras 2022 diffusion models in PyTorch
- you want state-of-the-art diffusion samplers like DPM++ or Heun
- you want to train or use hourglass diffusion transformer architectures
- you are doing research on diffusion model training and sampling

## When to avoid
- you need a production image generation API with pretrained checkpoints out of the box
- you want a high-level framework like Hugging Face Diffusers with broad model support
- you work outside PyTorch or lack GPU resources
- you need simple plug-and-play inference without understanding diffusion internals

## Facets
- artifact type: library
- maturity: active
- function: machine-learning, deep-learning, image-processing
- domain: machine-learning, deep-learning, image-processing
- platform: python
- tags: diffusion-models, pytorch, generative-models, karras-diffusion, image-generation, sampling-algorithms, transformer, research, gpu

## Member repositories
- crowsonkb/k-diffusion (main) score 53

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:07:03.298325+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T02:21:16.915623+00:00, confidence not recorded.
  - readme: https://github.com/crowsonkb/k-diffusion (fetched 2026-08-28T04:07:03.298325+00:00, sha fcf1e455484d)
  - registry_pypi: https://pypi.org/pypi/k-diffusion/json (fetched 2026-08-29T10:04:08.265290+00:00, sha 13bc1ddae92c)
- Data as of 2026-08-30T08:39:29.467469+00:00.
