Marigold examples / benchmark-image-gen

benchmark-image-gen

marigold registry add https://www.bayis.co.uk/marigold-examples/
marigold application install benchmark-image-gen
Version0.1.0
Models27 declared
Archivebenchmark-image-gen-0.1.0.tar.gz
sha25669fcc5c60a0d0e87436458400259da511dc77e4669f95ece02a020ac3c45d7c9

Submits a fixed prompt set to every txt2img model in a running Marigold deployment and records timing, VRAM, and power draw per image. Safe to re-run – each request’s ID is a hash of its contents, and every field in the body is fixed by the prompt set, so resubmitting already-completed work is a cheap cache-status check rather than a re-run.

Setup

pip install requests pyyaml

Run

Populate the cache first. The full catalogue is roughly 96 GB and a cold population is measured in hours, not minutes:

marigold cache populate marigold-examples/benchmark-img-gen
marigold deployment start marigold-examples/benchmark-img-gen

Then:

python run_benchmark.py \
  --base-url http://localhost:8000 \
  --user-id benchmark \
  --out results/run1.csv

--user-id is required and can be any string – Marigold doesn’t require authentication, it just tags requests by this value.

Start with a smoke test before committing to the full set:

python run_benchmark.py --base-url http://localhost:8000 \
  --user-id benchmark --max-prompts 6 --out results/smoke.csv

Prompt groups

Image generation cost is dominated by step count and pixel count. Each group varies one axis.

Distilled models are in the step sweep deliberately. FLUX.1-schnell is trained for four steps and z-image-turbo for a short schedule, so the quality curve is flat above their intended count while the cost curve is real. Read those rows as cost measurements.

Every prompt carries a fixed seed, so a re-run reproduces the same image.

Options

Requests are grouped by model rather than interleaved, since the worker switches models on queue depth and interleaving would cost a full reload between every request.

Images

Binary output retrieval returns 501, so the CSV records the output reference – path and mimetype – rather than the bytes. The files are on the machine running the worker:

$MARIGOLD_CACHE_DIR/data/outputs/txt2img/

Regenerating the prompt set

prompts.jsonl is already built and committed. Only needed if you’re changing the prompt set itself:

python build_prompts.py

Prompts are generated combinatorially from the SUBJECTS and STYLES lists in build_prompts.py, not hand-written.