Evaluate diffusion models the way papers do.
diffeval runs a text-to-image model on a fixed suite of prompts and seeds, then scores it with CLIP score, CMMD, FID and KID using the reference protocols. One command, one traceable report.
$ diffeval run --suite bench1k/suite.yaml \ --pipeline stable-diffusion-v1-5/stable-diffusion-v1-5 \ --steps 50 --dtype float16 --device cuda generating 1000 images · seed 2024 · 512x512 100% ███████████████████████ 125/125 batches metric status mean direction clip_score ok 0.773948 higher cmmd ok 0.614564 lower wrote outputs/sd15/results.json outputs/sd15/report.html
images/seed_2024/*.png
A benchmark number is only useful if someone else can reproduce it.
diffeval does for image diffusion models what lm-evaluation-harness does for language models: it fixes the setup so scores mean the same thing everywhere.
Pluggable
Suites, metrics and backends register by name in TASKS, METRICS and BACKENDS. Add your own in a few lines.
Light by default
The base install is PyYAML, Pillow and NumPy. Torch, Diffusers and clean-fid stay in optional extras.
Honest scores
A missing library or reference returns status skipped with the reason, never a made-up number. Small samples carry a warning.
Traceable
results.json stores the suite, model settings, package versions, the GPU and every metric's protocol next to the scores.
Checked against published numbers.
Known models on the cmmd-pytorch COCO-30k captions, seed 2024, compared with the CMMD that cmmd-pytorch published on all 30,000 captions.
diffeval-check-cmmd prints CMMD 7.696 (expected 7.696), the value the reference implementation documents.| Model | Steps | Hardware | Captions | CLIP score | CMMD | Published CMMD |
|---|---|---|---|---|---|---|
| stable-diffusion-v1-5 | 50 | T4 · fp16 | 1,000 | 0.774 | 0.615+0.033 | 0.582 |
| stabilityai/sd-turbo | 1 | CPU · fp32 | 500 | 0.785 | 0.683 | not published |
| stabilityai/sdxl-turbo | 1 | running | 0.548 | |||
Lower CMMD is better. SD 1.5 used 1,000 captions instead of 30,000, and its safety checker replaces flagged images with black ones; both raise CMMD slightly. A broken metric would miss by orders of magnitude, not by 0.03.
Suite in, report out.
Every run follows the same four steps, so two people running the same suite get comparable numbers.
Pick a suite
A YAML file fixes the prompts, seeds, resolution and metrics. Use core or build COCO-30k.
Generate
The backend writes one PNG per prompt per seed, in batches, straight to disk.
Score
Each metric scores each seed with its reference protocol and records what it used.
Report
Mean and sample std across seeds, in a console table, results.json, Markdown and HTML.
Straight from a diffeval run.
sd-turbo, one step, COCO captions as prompts. These are the images CLIP score and CMMD were computed on.










Running in a minute.
Start with a CPU smoke run that downloads nothing, then point it at a real model.
# base install, no torch needed
pip install diffeval
diffeval run --backend dummy --suite core
The dummy backend draws deterministic images, so this checks the pipeline end to end in seconds.
pip install "diffeval[diffusers,metrics]" diffeval run --pipeline stabilityai/sd-turbo --suite core \ --steps 1 --guidance 0
Any Hugging Face text-to-image id works with --pipeline. Needs PyTorch 2.6 or newer.
diffeval-check-cmmd # must print 7.696
diffeval-coco30k --out bench --limit 5000
diffeval run --suite bench/suite.yaml \
--pipeline stabilityai/sdxl-turbo --variant fp16 \
--steps 1 --guidance 0 --dtype float16 --device cuda \
--output outputs/sdxl-turbo
diffeval-table outputs/*/results.json
Reproduces the published CMMD protocol. Drop --limit for the full 30,000 captions.
Reference implementations, written down.
Each metric stores its exact protocol in results.json, so a score always says how it was made.
clip_scorehigher ↑Hessel et al. 2021. CLIP ViT-B/32, mean of 2.5 × max(cosine, 0) between image and prompt.
cmmdlower ↓Jayasumana et al. 2024. CLIP ViT-L/14 at 336px, L2-normalized embeddings, RBF MMD with sigma 10, scaled by 1000. Matches cmmd-pytorch.
fidlower ↓clean-fid in clean mode, Inception-v3 features against a reference image folder or precomputed stats.
kidlower ↓clean-fid KID on the same features: degree-3 polynomial kernel, 100 subsets.
Put a number on your model.
Open source under the license in the repository. Python 3.10 or newer.