v0.1.1 First GPU results are in

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.

$ pip install diffeval See the results
diffeval run
$ 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
Zebras grazing in grass Yellow commuter train Polar bear Vintage red truck Green train in snow Dog wearing a tie images/seed_2024/*.png
7.696
CMMD reference check, matched exactly
0.615
SD 1.5 CMMD vs 0.582 published
4
reference metrics: CLIP, CMMD, FID, KID
30k
image runs, streamed to disk
Why diffeval

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.

Results

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.
ModelStepsHardwareCaptionsCLIP scoreCMMDPublished CMMD
stable-diffusion-v1-550T4 · fp161,0000.7740.615+0.0330.582
stabilityai/sd-turbo1CPU · fp325000.7850.683not published
stabilityai/sdxl-turbo1running0.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.

How it works

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.

Quickstart

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.

Metrics

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.

$ pip install diffeval View on PyPI