Spaces:
Running

diffeval-leaderboard / index.html
Liyew's picture
Add live Image-to-Image (MagicBrush-100) leaderboard tab across 4 models
7999500 verified
Raw History Blame Contribute Delete
37.3 kB
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Open Diffusion Evaluation Leaderboard β€” diffeval</title>
<link rel="preconnect" href="https://fonts.googleapis.com" />
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500;600&display=swap" rel="stylesheet" />
<script src="https://cdn.jsdelivr.net/npm/chart.js@4.4.7/dist/chart.umd.min.js"></script>
<style>
:root {
--bg: #ffffff;
--surface: #f9fafb;
--surface-2: #f3f4f6;
--border: #e5e7eb;
--border-strong: #d1d5db;
--text: #111827;
--text-secondary: #4b5563;
--muted: #6b7280;
--link: #2563eb;
--hf-yellow: #ff9d00;
--hf-yellow-bg: #fffbeb;
--hf-yellow-border: #fde68a;
--bar-bg: #e0e7ff;
--bar-fill: #3b82f6;
--bar-green-bg: #d1fae5;
--bar-green: #10b981;
--row-hover: #f9fafb;
--code-bg: #f3f4f6;
--shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}
html.dark {
--bg: #0b0f19;
--surface: #111827;
--surface-2: #1f2937;
--border: #1f2937;
--border-strong: #374151;
--text: #f9fafb;
--text-secondary: #d1d5db;
--muted: #9ca3af;
--link: #60a5fa;
--hf-yellow: #fbbf24;
--hf-yellow-bg: rgba(251, 191, 36, 0.1);
--hf-yellow-border: rgba(251, 191, 36, 0.3);
--bar-bg: rgba(59, 130, 246, 0.18);
--bar-fill: #60a5fa;
--bar-green-bg: rgba(16, 185, 129, 0.18);
--bar-green: #34d399;
--row-hover: #161e2e;
--code-bg: #111827;
}
* { box-sizing: border-box; }
body {
margin: 0;
font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
background: var(--bg);
color: var(--text);
font-size: 14px;
line-height: 1.5;
-webkit-font-smoothing: antialiased;
}
code, pre, .mono {
font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}
.container {
max-width: 1320px;
margin: 0 auto;
padding: 24px 20px 64px;
}
/* Open LLM Leaderboard style top header */
.topbar {
display: flex;
justify-content: flex-end;
gap: 8px;
margin-bottom: 8px;
}
.icon-btn {
display: inline-flex;
align-items: center;
gap: 6px;
padding: 6px 11px;
border-radius: 6px;
border: 1px solid var(--border);
background: var(--surface);
color: var(--text-secondary);
font-size: 12.5px;
font-weight: 500;
cursor: pointer;
text-decoration: none;
}
.icon-btn:hover { border-color: var(--border-strong); color: var(--text); }
.hero {
text-align: center;
max-width: 820px;
margin: 0 auto 24px;
}
.hero h1 {
margin: 0 0 8px;
font-size: 28px;
font-weight: 700;
letter-spacing: -0.025em;
display: inline-flex;
align-items: center;
gap: 10px;
}
.hero p {
margin: 0 0 14px;
color: var(--text-secondary);
font-size: 14.5px;
}
.badge-row {
display: flex;
justify-content: center;
flex-wrap: wrap;
gap: 8px;
}
.pill {
display: inline-flex;
align-items: center;
gap: 6px;
padding: 4px 10px;
border-radius: 999px;
font-size: 12px;
font-weight: 500;
border: 1px solid var(--border);
background: var(--surface);
color: var(--text-secondary);
text-decoration: none;
}
.pill.verified {
background: var(--hf-yellow-bg);
border-color: var(--hf-yellow-border);
color: var(--text);
}
.pill a { color: var(--link); text-decoration: none; font-weight: 600; }
/* Tabs (Gradio / HF Space style) */
.tabs {
display: flex;
gap: 4px;
border-bottom: 1px solid var(--border);
margin-bottom: 18px;
overflow-x: auto;
}
.tab {
background: transparent;
border: 1px solid transparent;
border-bottom: 2px solid transparent;
color: var(--muted);
padding: 9px 15px;
font-size: 13.5px;
font-weight: 600;
cursor: pointer;
white-space: nowrap;
border-radius: 6px 6px 0 0;
margin-bottom: -1px;
}
.tab:hover { color: var(--text); background: var(--surface); }
.tab.active {
color: var(--text);
border-bottom-color: var(--hf-yellow);
background: transparent;
}
.panel { display: none; }
.panel.active { display: block; }
/* Open LLM Leaderboard filter toolbar */
.toolbar {
display: flex;
flex-direction: column;
gap: 10px;
background: var(--surface);
border: 1px solid var(--border);
border-radius: 8px;
padding: 12px 14px;
margin-bottom: 14px;
}
.toolbar-row {
display: flex;
flex-wrap: wrap;
align-items: center;
gap: 10px;
justify-content: space-between;
}
.search-box {
flex: 1 1 320px;
display: flex;
align-items: center;
background: var(--bg);
border: 1px solid var(--border-strong);
border-radius: 6px;
padding: 0 10px;
}
.search-box:focus-within { border-color: var(--link); box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.12); }
.search-box input {
width: 100%;
border: none;
outline: none;
background: transparent;
color: var(--text);
padding: 8px 6px;
font-size: 13.5px;
font-family: inherit;
}
.chips {
display: flex;
flex-wrap: wrap;
align-items: center;
gap: 6px;
}
.chip-label {
font-size: 12px;
font-weight: 600;
color: var(--muted);
margin-right: 2px;
}
.chip {
padding: 4px 10px;
border-radius: 6px;
border: 1px solid var(--border);
background: var(--bg);
color: var(--text-secondary);
font-size: 12.5px;
font-weight: 500;
cursor: pointer;
}
.chip:hover { border-color: var(--border-strong); }
.chip.active {
background: var(--text);
color: var(--bg);
border-color: var(--text);
}
.col-toggles {
display: flex;
flex-wrap: wrap;
gap: 10px;
align-items: center;
font-size: 12.5px;
color: var(--text-secondary);
padding-top: 6px;
border-top: 1px solid var(--border);
}
.col-toggles label {
display: inline-flex;
align-items: center;
gap: 5px;
cursor: pointer;
user-select: none;
}
/* Open LLM Leaderboard table */
.table-card {
border: 1px solid var(--border);
border-radius: 8px;
overflow-x: auto;
background: var(--bg);
box-shadow: var(--shadow);
}
table {
width: 100%;
border-collapse: collapse;
font-size: 13px;
}
thead th {
position: sticky;
top: 0;
background: var(--surface);
color: var(--text-secondary);
font-weight: 600;
font-size: 12px;
padding: 10px 12px;
text-align: left;
border-bottom: 1px solid var(--border-strong);
white-space: nowrap;
cursor: pointer;
user-select: none;
}
thead th:hover { color: var(--text); background: var(--surface-2); }
thead th.sorted { color: var(--text); }
tbody td {
padding: 10px 12px;
border-bottom: 1px solid var(--border);
white-space: nowrap;
vertical-align: middle;
}
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: var(--row-hover); }
.num { text-align: right; font-variant-numeric: tabular-nums; font-family: "JetBrains Mono", monospace; font-size: 12.5px; }
.rank-cell { font-weight: 600; text-align: center; width: 44px; color: var(--muted); }
.type-badge {
display: inline-flex;
align-items: center;
gap: 4px;
padding: 2px 7px;
border-radius: 4px;
font-size: 11.5px;
font-weight: 600;
border: 1px solid var(--border);
background: var(--surface);
color: var(--text-secondary);
}
.model-cell {
display: inline-flex;
align-items: center;
gap: 6px;
}
.model-link {
color: var(--link);
text-decoration: none;
font-weight: 600;
font-family: "JetBrains Mono", monospace;
font-size: 12.5px;
}
.model-link:hover { text-decoration: underline; }
.model-sub {
color: var(--muted);
font-size: 11.5px;
font-weight: 400;
}
.bar-wrap {
display: inline-flex;
align-items: center;
justify-content: flex-end;
gap: 8px;
min-width: 96px;
}
.bar-track {
width: 48px;
height: 7px;
border-radius: 999px;
background: var(--bar-bg);
overflow: hidden;
}
.bar-fill {
height: 100%;
border-radius: 999px;
background: var(--bar-fill);
}
.bar-track.green { background: var(--bar-green-bg); }
.bar-track.green .bar-fill { background: var(--bar-green); }
.score-strong { font-weight: 700; color: var(--text); }
.footer-meta {
display: flex;
justify-content: space-between;
flex-wrap: wrap;
gap: 8px;
margin-top: 10px;
font-size: 12px;
color: var(--muted);
}
/* Cards & Charts */
.grid-2 {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(460px, 1fr));
gap: 16px;
}
.card {
background: var(--bg);
border: 1px solid var(--border);
border-radius: 8px;
padding: 18px 20px;
box-shadow: var(--shadow);
}
.card h3 {
margin: 0 0 6px;
font-size: 15px;
font-weight: 600;
}
.card p.desc {
margin: 0 0 14px;
color: var(--muted);
font-size: 13px;
}
.chart-box { position: relative; height: 320px; }
pre {
background: var(--code-bg);
border: 1px solid var(--border);
border-radius: 6px;
padding: 14px;
overflow-x: auto;
font-size: 12.5px;
line-height: 1.55;
color: var(--text);
}
.prose { max-width: 820px; }
.prose h3 { margin: 18px 0 8px; font-size: 15.5px; }
.prose ul { padding-left: 20px; color: var(--text-secondary); }
.prose li { margin-bottom: 6px; }
</style>
</head>
<body>
<div class="container">
<div class="topbar">
<a class="icon-btn" href="https://github.com/woletee/diffeval" target="_blank" rel="noopener">GitHub Β· woletee/diffeval</a>
<a class="icon-btn" href="https://diffeval.vercel.app" target="_blank" rel="noopener">Docs Β· diffeval.vercel.app</a>
<button class="icon-btn" id="theme-toggle" type="button">πŸŒ™ Dark</button>
</div>
<header class="hero">
<h1>πŸ€— Open Diffusion Leaderboard</h1>
<p>
Reproducible evaluation of open-weight text-to-image (and upcoming image-to-image) models
using the <a href="https://github.com/woletee/diffeval" target="_blank" rel="noopener" style="color:var(--link);text-decoration:none;font-weight:600;">diffeval</a> harness.
</p>
<div class="badge-row">
<span class="pill verified">βœ“ GenEval 2 Parity: <strong>0.00e+00</strong> max diff vs Meta official script (367 Qs)</span>
<span class="pill verified">βœ“ CMMD Parity: <strong>7.696</strong> exact vs cmmd-pytorch</span>
<span class="pill">Judge: <strong>Qwen3-VL-8B-Instruct</strong></span>
</div>
</header>
<nav class="tabs" role="tablist">
<button class="tab active" data-tab="g2">πŸ… GenEval 2 Leaderboard (800)</button>
<button class="tab" data-tab="coco">πŸ“ COCO-30k (CMMD &amp; CLIP)</button>
<button class="tab" data-tab="charts">πŸ“ˆ Scaling &amp; Skills</button>
<button class="tab" data-tab="i2i">πŸ–ΌοΈ Image-to-Image (MagicBrush-100)</button>
<button class="tab" data-tab="submit">πŸš€ Submit here!</button>
<button class="tab" data-tab="about">ℹ️ About</button>
</nav>
<!-- TAB 1: GenEval 2 -->
<section id="tab-g2" class="panel active">
<div class="toolbar">
<div class="toolbar-row">
<div class="search-box">
<span style="color:var(--muted)">πŸ”</span>
<input id="g2-search" type="search" placeholder="Search models (separate multiple queries with ';')..." />
</div>
<div class="chips" id="g2-arch-chips">
<span class="chip-label">Type:</span>
<button class="chip active" data-arch="all">All</button>
<button class="chip" data-arch="UNet">🧱 UNet</button>
<button class="chip" data-arch="Distilled">⚑ Distilled</button>
<button class="chip" data-arch="DiT">πŸ”· DiT</button>
</div>
<button class="icon-btn" id="g2-csv" type="button">⬇ Export CSV</button>
</div>
<div class="col-toggles" id="g2-cols">
<span class="chip-label">Columns:</span>
<label><input type="checkbox" value="am" checked /> Soft-TIFA AM</label>
<label><input type="checkbox" value="object" checked /> Object</label>
<label><input type="checkbox" value="attribute" checked /> Attribute</label>
<label><input type="checkbox" value="count" checked /> Count</label>
<label><input type="checkbox" value="position" checked /> Position</label>
<label><input type="checkbox" value="verb" checked /> Verb</label>
<label><input type="checkbox" value="steps" checked /> Steps</label>
<label><input type="checkbox" value="res" checked /> Resolution</label>
<label><input type="checkbox" value="gpu" /> GPU</label>
<label><input type="checkbox" value="ver" /> diffeval</label>
</div>
</div>
<div class="table-card">
<table id="table-g2"></table>
</div>
<div class="footer-meta">
<span id="g2-count"></span>
<span>All runs: 800 GenEval 2 prompts Β· seed 0 Β· fp16 Β· Soft-TIFA GM (higher is better)</span>
</div>
</section>
<!-- TAB 2: COCO -->
<section id="tab-coco" class="panel">
<div class="toolbar">
<div class="toolbar-row">
<div class="search-box">
<span style="color:var(--muted)">πŸ”</span>
<input id="coco-search" type="search" placeholder="Search models (separate multiple queries with ';')..." />
</div>
<div class="chips" id="coco-arch-chips">
<span class="chip-label">Type:</span>
<button class="chip active" data-arch="all">All</button>
<button class="chip" data-arch="UNet">🧱 UNet</button>
<button class="chip" data-arch="Distilled">⚑ Distilled</button>
<button class="chip" data-arch="DiT">πŸ”· DiT</button>
</div>
<button class="icon-btn" id="coco-csv" type="button">⬇ Export CSV</button>
</div>
</div>
<div class="table-card">
<table id="table-coco"></table>
</div>
<div class="footer-meta">
<span id="coco-count"></span>
<span>COCO-2014 val captions Β· seed 2024 Β· fp16 Β· CMMD ↓ (lower is better) Β· CLIPScore ↑ (higher is better)</span>
</div>
</section>
<!-- TAB 3: Charts -->
<section id="tab-charts" class="panel">
<div class="grid-2">
<div class="card">
<h3>GenEval 2 Skill Breakdown</h3>
<p class="desc">Per-skill Soft-TIFA scores across Object, Attribute, Count, Position, and Verb (800 prompts).</p>
<div class="chart-box"><canvas id="skillChart"></canvas></div>
</div>
<div class="card">
<h3>Compositional Scaling by Atom Count (3 β†’ 10)</h3>
<p class="desc">How Soft-TIFA GM decays as prompt complexity increases from 3 to 10 compositional atoms.</p>
<div class="chart-box"><canvas id="atomChart"></canvas></div>
</div>
</div>
</section>
<!-- TAB 4: Image-to-Image -->
<section id="tab-i2i" class="panel">
<div class="toolbar">
<div class="toolbar-row">
<div class="search-box">
<span style="color:var(--muted)">πŸ”</span>
<input id="i2i-search" type="search" placeholder="Search I2I models (separate multiple queries with ';')..." />
</div>
<div class="chips" id="i2i-arch-chips">
<span class="chip-label">Type:</span>
<button class="chip active" data-arch="all">All</button>
<button class="chip" data-arch="Edit">✏️ Edit</button>
<button class="chip" data-arch="UNet">🧱 UNet</button>
<button class="chip" data-arch="Distilled">⚑ Distilled</button>
</div>
<button class="icon-btn" id="i2i-csv" type="button">⬇ Export CSV</button>
</div>
</div>
<div class="table-card">
<table id="table-i2i"></table>
</div>
<div class="footer-meta">
<span id="i2i-count"></span>
<span>osunlp/MagicBrush dev (100 paired triplets) Β· 512Γ—512 Β· seed 0 Β· fp16 Β· Higher is better for all 4 metrics</span>
</div>
</section>
<!-- TAB 5: Submit -->
<section id="tab-submit" class="panel">
<div class="card prose">
<h3>πŸš€ Submit a Model to the Leaderboard</h3>
<p style="color:var(--text-secondary)">
Every row on this leaderboard is backed by a traceable <code>results.json</code> generated by <code>diffeval</code>.
To reproduce our scores or submit a new open-weight model:
</p>
<pre>pip install "diffeval[diffusers,metrics,geneval2]"
# 1. GenEval 2 (all 800 prompts, ~24–48 GB GPU)
diffeval-geneval2 --out benchmarks/geneval2
diffeval run --pipeline &lt;hf_model_id&gt; --suite benchmarks/geneval2/suite.yaml --output outputs/my-model-g2
# 2. COCO-30k (CMMD + CLIPScore)
diffeval-coco30k --out benchmarks/coco30k --limit 1000
diffeval run --pipeline &lt;hf_model_id&gt; --suite benchmarks/coco30k/suite.yaml --output outputs/my-model-coco</pre>
<p style="color:var(--text-secondary)">
Then open a <strong>Community PR</strong> on this Space (or on
<a href="https://github.com/woletee/diffeval" target="_blank" rel="noopener" style="color:var(--link)">woletee/diffeval</a>)
adding your <code>results.json</code> under <code>data/geneval2/</code> or <code>data/coco/</code>.
</p>
</div>
</section>
<!-- TAB 6: About -->
<section id="tab-about" class="panel">
<div class="card prose">
<h3>ℹ️ About the Open Diffusion Leaderboard</h3>
<p style="color:var(--text-secondary)">
Inspired by the <a href="https://huggingface.co/spaces/open-llm-leaderboard/open_llm_leaderboard" target="_blank" rel="noopener" style="color:var(--link)">Open LLM Leaderboard</a>
and EleutherAI's <code>lm-evaluation-harness</code>, this leaderboard evaluates generative image models on fixed prompts, fixed seeds, and verified metric implementations via
<a href="https://github.com/woletee/diffeval" target="_blank" rel="noopener" style="color:var(--link)">diffeval</a>.
</p>
<h3>Reference Verification</h3>
<ul>
<li><strong>GenEval 2:</strong> Verified against Meta's official <code>facebookresearch/GenEval2</code> <code>evaluation.py</code> on 100 prompts (367 questions) with <code>0.00e+00</code> max difference (Soft-TIFA GM <code>20.4300</code> vs <code>20.4300</code>).</li>
<li><strong>CMMD:</strong> Verified against <code>sayakpaul/cmmd-pytorch</code> reference images (<code>7.696</code> vs expected <code>7.696</code>).</li>
<li><strong>Full Provenance:</strong> Every <code>results.json</code> records suite hash/source, seeds, resolution, dtype, steps, guidance, GPU model, and exact package versions.</li>
</ul>
</div>
</section>
</div>
<script>
const MODEL_META = {
"timbrooks/instruct-pix2pix": { name: "InstructPix2Pix", arch: "Edit", icon: "✏️", pubCmmd: null },
"stable-diffusion-v1-5/stable-diffusion-v1-5": { name: "SD 1.5", arch: "UNet", icon: "🧱", pubCmmd: 0.582 },
"stabilityai/sdxl-turbo": { name: "SDXL-Turbo", arch: "Distilled", icon: "⚑", pubCmmd: 0.548 },
"stabilityai/stable-diffusion-xl-base-1.0": { name: "SDXL-Base 1.0", arch: "UNet", icon: "🧱", pubCmmd: 0.696 },
"segmind/SSD-1B": { name: "SSD-1B", arch: "Distilled", icon: "⚑", pubCmmd: 0.669 },
"PixArt-alpha/PixArt-XL-2-1024-MS": { name: "PixArt-Ξ±", arch: "DiT", icon: "πŸ”·", pubCmmd: 1.140 }
};
// Theme toggle (defaults to crisp Open LLM Leaderboard light mode)
const themeBtn = document.getElementById("theme-toggle");
themeBtn.addEventListener("click", () => {
const dark = document.documentElement.classList.toggle("dark");
themeBtn.textContent = dark ? "β˜€οΈ Light" : "πŸŒ™ Dark";
renderCharts();
});
// Tabs
document.querySelectorAll(".tab").forEach(btn => {
btn.addEventListener("click", () => {
document.querySelectorAll(".tab").forEach(b => b.classList.remove("active"));
document.querySelectorAll(".panel").forEach(p => p.classList.remove("active"));
btn.classList.add("active");
document.getElementById("tab-" + btn.dataset.tab).classList.add("active");
});
});
function matchesMultiQuery(row, rawQuery) {
if (!rawQuery || !rawQuery.trim()) return true;
const parts = rawQuery.split(";").map(s => s.trim().toLowerCase()).filter(Boolean);
if (!parts.length) return true;
const hay = `${row.name} ${row.repo} ${row.arch}`.toLowerCase();
return parts.some(p => hay.includes(p));
}
function downloadCSV(filename, cols, rows) {
const header = cols.map(c => `"${c.label.replace(/"/g, '""')}"`).join(",");
const body = rows.map(r => cols.map(c => `"${String(r[c.key] ?? "").replace(/"/g, '""')}"`).join(",")).join("\n");
const blob = new Blob([header + "\n" + body], { type: "text/csv;charset=utf-8;" });
const a = document.createElement("a");
a.href = URL.createObjectURL(blob);
a.download = filename;
a.click();
}
function medal(i) {
if (i === 0) return "πŸ₯‡";
if (i === 1) return "πŸ₯ˆ";
if (i === 2) return "πŸ₯‰";
return String(i + 1);
}
function scoreBar(val, maxVal, isGreen = false, decimals = 2) {
const pct = Math.max(4, Math.min(100, (val / maxVal) * 100));
return `<span class="bar-wrap"><span class="score-strong">${val.toFixed(decimals)}</span><span class="bar-track ${isGreen ? "green" : ""}"><span class="bar-fill" style="width:${pct}%"></span></span></span>`;
}
let g2Rows = [];
let cocoRows = [];
let atomSeries = [];
let skillChartInst = null;
let atomChartInst = null;
function renderCharts() {
if (!g2Rows.length) return;
const dark = document.documentElement.classList.contains("dark");
const textColor = dark ? "#d1d5db" : "#374151";
const gridColor = dark ? "rgba(255,255,255,0.08)" : "rgba(0,0,0,0.06)";
const colors = ["#2563eb", "#10b981", "#f59e0b", "#8b5cf6", "#ef4444"];
if (skillChartInst) skillChartInst.destroy();
const sortedG2 = [...g2Rows].sort((a, b) => b.gm - a.gm);
skillChartInst = new Chart(document.getElementById("skillChart"), {
type: "bar",
data: {
labels: ["Object", "Attribute", "Count", "Position", "Verb"],
datasets: sortedG2.map((r, i) => ({
label: r.name,
data: [r.object, r.attribute, r.count, r.position, r.verb],
backgroundColor: colors[i % colors.length],
borderRadius: 4
}))
},
options: {
responsive: true,
maintainAspectRatio: false,
plugins: { legend: { labels: { color: textColor, font: { family: "Inter", size: 12 } } } },
scales: {
x: { ticks: { color: textColor }, grid: { display: false } },
y: { beginAtZero: true, max: 100, title: { display: true, text: "Score (%)", color: textColor }, ticks: { color: textColor }, grid: { color: gridColor } }
}
}
});
if (atomChartInst) atomChartInst.destroy();
atomChartInst = new Chart(document.getElementById("atomChart"), {
type: "line",
data: {
labels: [3, 4, 5, 6, 7, 8, 9, 10],
datasets: atomSeries.map((s, i) => ({
label: s.name,
data: [3, 4, 5, 6, 7, 8, 9, 10].map(k => s.atoms[String(k)] ?? null),
borderColor: colors[i % colors.length],
backgroundColor: colors[i % colors.length],
borderWidth: 2.2,
tension: 0.2,
pointRadius: 3.5
}))
},
options: {
responsive: true,
maintainAspectRatio: false,
plugins: { legend: { labels: { color: textColor, font: { family: "Inter", size: 12 } } } },
scales: {
x: { title: { display: true, text: "Compositional Atoms", color: textColor }, ticks: { color: textColor }, grid: { color: gridColor } },
y: { beginAtZero: true, title: { display: true, text: "Soft-TIFA GM (↑)", color: textColor }, ticks: { color: textColor }, grid: { color: gridColor } }
}
}
});
}
function createTableController({ tableEl, countEl, allCols, rows, defaultSort, defaultAsc, visibleSet }) {
let sortKey = defaultSort;
let asc = defaultAsc;
let query = "";
let arch = "all";
function getFiltered() {
return rows
.filter(r => (arch === "all" || r.arch === arch) && matchesMultiQuery(r, query))
.sort((a, b) => {
const av = a[sortKey], bv = b[sortKey];
if (av === bv) return 0;
if (av == null) return 1;
if (bv == null) return -1;
return (av > bv ? 1 : -1) * (asc ? 1 : -1);
});
}
function draw() {
const activeCols = allCols.filter(c => !visibleSet || c.always || visibleSet.has(c.key));
const data = getFiltered();
if (countEl) countEl.textContent = `Showing ${data.length} of ${rows.length} evaluated models`;
const thead = "<thead><tr><th class='rank-cell'>#</th>" + activeCols.map(c => {
const isSorted = sortKey === c.key;
const arrow = isSorted ? (asc ? " β–²" : " β–Ό") : "";
return `<th class="${c.num ? "num" : ""} ${isSorted ? "sorted" : ""}" data-key="${c.key}">${c.label}${arrow}</th>`;
}).join("") + "</tr></thead>";
const tbody = "<tbody>" + data.map((r, i) =>
`<tr><td class="rank-cell">${medal(i)}</td>` + activeCols.map(c => {
const v = r[c.key];
const out = c.render ? c.render(v, r) : (v ?? "β€”");
return `<td class="${c.num ? "num" : ""}">${out}</td>`;
}).join("") + "</tr>"
).join("") + "</tbody>";
tableEl.innerHTML = thead + tbody;
tableEl.querySelectorAll("th[data-key]").forEach(th => {
th.addEventListener("click", () => {
const k = th.dataset.key;
if (sortKey === k) asc = !asc;
else { sortKey = k; asc = allCols.find(c => c.key === k)?.ascDefault ?? false; }
draw();
});
});
}
draw();
return {
setQuery(q) { query = q; draw(); },
setArch(a) { arch = a; draw(); },
redraw: draw,
exportCSV(filename) {
const activeCols = allCols.filter(c => !visibleSet || c.always || visibleSet.has(c.key));
downloadCSV(filename, activeCols, getFiltered());
}
};
}
async function init() {
const idx = await fetch("data/index.json").then(r => r.json());
const g2Data = await Promise.all(idx.geneval2.map(u => fetch(u).then(r => r.json())));
g2Rows = g2Data.map(d => {
const b = d.backend || {};
const repo = b.pipeline || "unknown";
const meta = MODEL_META[repo] || { name: repo.split("/").pop(), arch: "Other", icon: "πŸ”Ή" };
const m = d.per_seed?.[0]?.metrics?.[0] || {};
const det = m.details || {};
const sk = det.by_skill || {};
if (det.by_atom_count) atomSeries.push({ name: meta.name, atoms: det.by_atom_count });
return {
name: meta.name,
repo,
arch: meta.arch,
icon: meta.icon,
steps: b.steps ?? "β€”",
res: `${d.suite?.width || "?"}Γ—${d.suite?.height || "?"}`,
gm: Number(d.aggregate.geneval2.mean.toFixed(2)),
am: Number((det.soft_tifa_am || 0).toFixed(2)),
object: Number((sk.object || 0).toFixed(2)),
attribute: Number((sk.attribute || 0).toFixed(2)),
count: Number((sk.count || 0).toFixed(2)),
position: Number((sk.position || 0).toFixed(2)),
verb: Number((sk.verb || 0).toFixed(2)),
gpu: d.system?.gpu?.name || "CPU",
ver: d.versions?.diffeval || "β€”"
};
});
const maxGM = Math.max(...g2Rows.map(r => r.gm), 15);
const g2Visible = new Set(["am", "object", "attribute", "count", "position", "verb", "steps", "res"]);
const g2Cols = [
{ key: "arch", label: "T", always: true, render: (v, r) => `<span class="type-badge" title="${v}">${r.icon} ${v}</span>` },
{ key: "repo", label: "Model", always: true, render: (v, r) => `<span class="model-cell"><a class="model-link" href="https://huggingface.co/${v}" target="_blank" rel="noopener">${v}</a><span class="model-sub">(${r.name})</span></span>` },
{ key: "gm", label: "Soft-TIFA GM ↑", num: true, always: true, render: v => scoreBar(v, maxGM, true, 2) },
{ key: "am", label: "AM ↑", num: true, render: v => v.toFixed(2) },
{ key: "object", label: "Object", num: true, render: v => v.toFixed(2) },
{ key: "attribute", label: "Attribute", num: true, render: v => v.toFixed(2) },
{ key: "count", label: "Count", num: true, render: v => v.toFixed(2) },
{ key: "position", label: "Position", num: true, render: v => v.toFixed(2) },
{ key: "verb", label: "Verb", num: true, render: v => v.toFixed(2) },
{ key: "steps", label: "Steps", num: true },
{ key: "res", label: "Resolution" },
{ key: "gpu", label: "GPU" },
{ key: "ver", label: "diffeval" }
];
const g2Ctrl = createTableController({
tableEl: document.getElementById("table-g2"),
countEl: document.getElementById("g2-count"),
allCols: g2Cols,
rows: g2Rows,
defaultSort: "gm",
defaultAsc: false,
visibleSet: g2Visible
});
document.getElementById("g2-search").addEventListener("input", e => g2Ctrl.setQuery(e.target.value));
document.querySelectorAll("#g2-arch-chips .chip").forEach(btn => {
btn.addEventListener("click", () => {
document.querySelectorAll("#g2-arch-chips .chip").forEach(b => b.classList.remove("active"));
btn.classList.add("active");
g2Ctrl.setArch(btn.dataset.arch);
});
});
document.querySelectorAll("#g2-cols input[type=checkbox]").forEach(cb => {
cb.addEventListener("change", () => {
if (cb.checked) g2Visible.add(cb.value);
else g2Visible.delete(cb.value);
g2Ctrl.redraw();
});
});
document.getElementById("g2-csv").addEventListener("click", () => g2Ctrl.exportCSV("diffeval_geneval2_leaderboard.csv"));
const cocoData = await Promise.all(idx.coco.map(u => fetch(u).then(r => r.json())));
cocoRows = cocoData.map(d => {
const b = d.backend || {};
const repo = b.pipeline || "unknown";
const meta = MODEL_META[repo] || { name: repo.split("/").pop(), arch: "Other", icon: "πŸ”Ή", pubCmmd: null };
return {
name: meta.name,
repo,
arch: meta.arch,
icon: meta.icon,
steps: b.steps ?? "β€”",
res: `${d.suite?.width || "?"}Γ—${d.suite?.height || "?"}`,
captions: d.suite?.num_prompts || d.num_outputs || 0,
clip: Number(d.aggregate.clip_score.mean.toFixed(3)),
cmmd: Number(d.aggregate.cmmd.mean.toFixed(3)),
pub: meta.pubCmmd ?? null,
gpu: d.system?.gpu?.name || "CPU"
};
});
const cocoCols = [
{ key: "arch", label: "T", always: true, render: (v, r) => `<span class="type-badge">${r.icon} ${v}</span>` },
{ key: "repo", label: "Model", always: true, render: (v, r) => `<span class="model-cell"><a class="model-link" href="https://huggingface.co/${v}" target="_blank" rel="noopener">${v}</a><span class="model-sub">(${r.name})</span></span>` },
{ key: "cmmd", label: "CMMD ↓", num: true, ascDefault: true, render: v => scoreBar(v, 1.2, false, 3) },
{ key: "pub", label: "Published (30k)", num: true, ascDefault: true, render: v => v != null ? v.toFixed(3) : "β€”" },
{ key: "clip", label: "CLIPScore ↑", num: true, render: v => v.toFixed(3) },
{ key: "captions", label: "Captions", num: true, render: v => Number(v).toLocaleString() },
{ key: "steps", label: "Steps", num: true },
{ key: "res", label: "Resolution" },
{ key: "gpu", label: "GPU" }
];
const cocoCtrl = createTableController({
tableEl: document.getElementById("table-coco"),
countEl: document.getElementById("coco-count"),
allCols: cocoCols,
rows: cocoRows,
defaultSort: "cmmd",
defaultAsc: true
});
document.getElementById("coco-search").addEventListener("input", e => cocoCtrl.setQuery(e.target.value));
document.querySelectorAll("#coco-arch-chips .chip").forEach(btn => {
btn.addEventListener("click", () => {
document.querySelectorAll("#coco-arch-chips .chip").forEach(b => b.classList.remove("active"));
btn.classList.add("active");
cocoCtrl.setArch(btn.dataset.arch);
});
});
document.getElementById("coco-csv").addEventListener("click", () => cocoCtrl.exportCSV("diffeval_coco_leaderboard.csv"));
if (idx.i2i && idx.i2i.length) {
const i2iData = await Promise.all(idx.i2i.map(u => fetch(u).then(r => r.json())));
const i2iRows = i2iData.map(d => {
const b = d.backend || {};
const repo = b.pipeline || "unknown";
const meta = MODEL_META[repo] || { name: repo.split("/").pop(), arch: "Other", icon: "πŸ”Ή" };
const agg = d.aggregate || {};
return {
name: meta.name,
repo,
arch: meta.arch,
icon: meta.icon,
steps: b.steps ?? "β€”",
res: `${d.suite?.width || 512}Γ—${d.suite?.height || 512}`,
clip_i: Number((agg.clip_i?.mean ?? 0).toFixed(4)),
ssim: Number((agg.ssim?.mean ?? 0).toFixed(4)),
psnr: Number((agg.psnr?.mean ?? 0).toFixed(2)),
clip_t: Number((agg.clip_score?.mean ?? 0).toFixed(4)),
gpu: d.system?.gpu?.name || "CPU"
};
});
const i2iCols = [
{ key: "arch", label: "T", always: true, render: (v, r) => `<span class="type-badge">${r.icon} ${v}</span>` },
{ key: "repo", label: "Model", always: true, render: (v, r) => `<span class="model-cell"><a class="model-link" href="https://huggingface.co/${v}" target="_blank" rel="noopener">${v}</a><span class="model-sub">(${r.name})</span></span>` },
{ key: "clip_i", label: "CLIP-I ↑", num: true, render: v => scoreBar(v, 1.0, true, 4) },
{ key: "ssim", label: "SSIM ↑", num: true, render: v => scoreBar(v, 1.0, false, 4) },
{ key: "psnr", label: "PSNR (dB) ↑", num: true, render: v => v.toFixed(2) },
{ key: "clip_t", label: "CLIP-T ↑", num: true, render: v => v.toFixed(4) },
{ key: "steps", label: "Steps", num: true },
{ key: "res", label: "Resolution" },
{ key: "gpu", label: "GPU" }
];
const i2iCtrl = createTableController({
tableEl: document.getElementById("table-i2i"),
countEl: document.getElementById("i2i-count"),
allCols: i2iCols,
rows: i2iRows,
defaultSort: "clip_i",
defaultAsc: false
});
document.getElementById("i2i-search").addEventListener("input", e => i2iCtrl.setQuery(e.target.value));
document.querySelectorAll("#i2i-arch-chips .chip").forEach(btn => {
btn.addEventListener("click", () => {
document.querySelectorAll("#i2i-arch-chips .chip").forEach(b => b.classList.remove("active"));
btn.classList.add("active");
i2iCtrl.setArch(btn.dataset.arch);
});
});
document.getElementById("i2i-csv").addEventListener("click", () => i2iCtrl.exportCSV("diffeval_i2i_magicbrush_leaderboard.csv"));
}
renderCharts();
}
init();
</script>
</body>
</html>