FrameXlabs commited on
Commit
2c00cba
·
verified ·
1 Parent(s): f6c5ab7

Remove stale index.html from previous run

Browse files
Files changed (1) hide show
  1. index.html +0 -192
index.html DELETED
@@ -1,192 +0,0 @@
1
- <!DOCTYPE html>
2
- <html lang="en">
3
- <head>
4
- <meta charset="utf-8">
5
- <meta name="viewport" content="width=device-width, initial-scale=1">
6
- <title>Trout · 16×16 pixel-art diffusion language model</title>
7
- <style>
8
- :root {
9
- --ink: #101828; --sub: #475467; --line: #e4e7ec;
10
- --bg: #f8f9fc; --card: #ffffff; --accent: #2563eb; --accent2: #0e7490;
11
- --chip: #eef2ff;
12
- }
13
- * { box-sizing: border-box; }
14
- body { margin: 0; font: 16px/1.65 -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; color: var(--ink); background: var(--bg); }
15
- .wrap { max-width: 1000px; margin: 0 auto; padding: 0 20px 80px; }
16
- header { padding: 64px 0 8px; text-align: center; }
17
- .fish { font-size: 52px; }
18
- h1 { margin: 8px 0 6px; font-size: 40px; letter-spacing: -1px; }
19
- .tag { color: var(--sub); max-width: 720px; margin: 0 auto; }
20
- .badges { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin-top: 18px; }
21
- .badge { background: var(--chip); color: var(--accent); border-radius: 999px; padding: 4px 12px; font-size: 13px; font-weight: 600; }
22
- section { margin-top: 44px; }
23
- h2 { font-size: 22px; margin: 0 0 14px; }
24
- .card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 20px 22px; }
25
- .grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
26
- @media (max-width: 760px) { .grid2 { grid-template-columns: 1fr; } }
27
- table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
28
- td { padding: 7px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
29
- td:first-child { color: var(--sub); white-space: nowrap; width: 34%; }
30
- tr:last-child td { border-bottom: 0; }
31
- .metric { font-variant-numeric: tabular-nums; }
32
- img.showcase { width: 100%; image-rendering: pixelated; border-radius: 10px; border: 1px solid var(--line); background: #fff; }
33
- .note { background: #fffbeb; border: 1px solid #fde68a; border-radius: 10px; padding: 12px 16px; font-size: 14.5px; }
34
- code, pre { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
35
- pre { background: #0f172a; color: #dbeafe; padding: 16px 18px; border-radius: 10px; overflow: auto; font-size: 13px; line-height: 1.5; }
36
- a { color: var(--accent); text-decoration: none; font-weight: 600; }
37
- a:hover { text-decoration: underline; }
38
- #pal { display: grid; grid-template-columns: repeat(64, 1fr); gap: 1px; background: #fff; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
39
- #pal div { aspect-ratio: 1; }
40
- footer { margin-top: 60px; color: var(--sub); font-size: 13.5px; text-align: center; border-top: 1px solid var(--line); padding-top: 20px; }
41
- .pill-row { display: flex; gap: 10px; flex-wrap: wrap; }
42
- .pill { border: 1px solid var(--line); border-radius: 10px; padding: 8px 14px; font-size: 13.5px; background: #fff; }
43
- </style>
44
- </head>
45
- <body>
46
- <div class="wrap">
47
- <header>
48
- <div class="fish">🐟</div>
49
- <h1>Trout</h1>
50
- <p class="tag">A <b>47.6M-parameter diffusion language model</b> for 16×16 pixel art.
51
- Each sprite is a 256-token “sentence” over a learned 512-color palette; a
52
- bidirectional hourglass transformer unmasks every pixel <b>in parallel over ~16 steps</b>,
53
- conditioned on a frozen CLIP text tower. No VAE, no latent space, no autoregression.</p>
54
- <div class="badges">
55
- <span class="badge">from scratch</span>
56
- <span class="badge">absorbing-state masked diffusion</span>
57
- <span class="badge">47,597,568 params</span>
58
- <span class="badge">Pixel Art Atlas 1.4M · CC0</span>
59
- <span class="badge">Apache-2.0</span>
60
- </div>
61
- </header>
62
-
63
- <section>
64
- <h2>Samples — 16 prompts × 4 sprites (steps 16, CFG 3.0)</h2>
65
- <div class="card">
66
- <img class="showcase" src="showcase.png" alt="Trout sample grid">
67
- <p style="color:var(--sub); font-size:14px; margin: 10px 4px 0;">
68
- Prompts: red health potion bottle · golden crown with blue gems · green slime monster ·
69
- iron sword with a leather hilt · wooden treasure chest · pink cherry blossom tree ·
70
- blue magic spellbook · orange fox head · glowing purple crystal · cheeseburger ·
71
- skull with a candle · rocket ship · brown leather boots · yellow rubber duck ·
72
- ice cream cone · black cat.</p>
73
- </div>
74
- </section>
75
-
76
- <section>
77
- <h2>How it works</h2>
78
- <div class="grid2">
79
- <div class="card">
80
- <table>
81
- <tr><td>Architecture</td><td>joint text+pixel bidirectional transformer, hourglass 2+8+2 blocks (2×2 patch-merged core), width 512, 8 heads, QK-RMSNorm, 2D axial RoPE, Conv-SwiGLU, adaLN-single, 4 registers, self-conditioning</td></tr>
82
- <tr><td>Vocabulary</td><td>512 palette tokens (frequency-weighted OKLab k-means, mean ΔE 0.0099) + <code>&lt;MASK&gt;</code></td></tr>
83
- <tr><td>Objective</td><td>absorbing-state masked diffusion, cosine schedule, stratified t, blob masks, perceptual OKLab label smoothing, CFG dropout</td></tr>
84
- <tr><td>Sampler</td><td>parallel confidence-ordered unmasking + CFG, Gumbel-annealed choice, spatial NMS, self-conditioning</td></tr>
85
- <tr><td>Text encoder</td><td>frozen CLIP ViT-B/32 text tower (24 tokens)</td></tr>
86
- <tr><td>Optimizer</td><td>Muon (hidden matrices) + AdamW, Warmup-Stable-Decay, EMA</td></tr>
87
- </table>
88
- </div>
89
- <div class="card">
90
- <table>
91
- <tr><td>Training data</td><td class="metric">Pixel Art Atlas 1.4M (Angais, CC0), 60k-sprite subset</td></tr>
92
- <tr><td>Steps × batch</td><td class="metric">2,400 × 8 sprites (CPU fp32, 2 vCPU / 4 GB)</td></tr>
93
- <tr><td>Validation NLL</td><td class="metric">2.164 nats / pixel (perplexity 8.81 of 512)</td></tr>
94
- <tr><td>Validation accuracy</td><td class="metric">55.8% of masked pixels</td></tr>
95
- <tr><td>CLIP score (ViT-B/32)</td><td class="metric">0.2285 generated · 0.2556 real</td></tr>
96
- <tr><td>Reference run</td><td class="metric">Tessera-small: 82,342 × 512 (0.859 NLL) on one RTX PRO 6000</td></tr>
97
- </table>
98
- <p style="color:var(--sub); font-size:13.5px; margin: 12px 4px 0;">
99
- This is a genuine budget-limited from-scratch run on a CPU sandbox — roughly
100
- 4 orders of magnitude less compute than the reference architecture’s original
101
- training — not a distillation or fine-tune. All numbers come from
102
- <code>metrics.jsonl</code> in the model repo.</p>
103
- </div>
104
- </div>
105
- </section>
106
-
107
- <section>
108
- <h2>The learned 512-color palette</h2>
109
- <div class="card" style="padding:14px;">
110
- <div id="pal"></div>
111
- <p style="color:var(--sub); font-size:13.5px; margin: 10px 4px 0;">
112
- Token 0 = transparent (checker); the 511 opaque colors were chosen by
113
- frequency-weighted k-means in OKLab and snapped to real dataset colors.</p>
114
- </div>
115
- </section>
116
-
117
- <section>
118
- <h2>Try it</h2>
119
- <div class="card">
120
- <div class="pill-row" style="margin-bottom:14px;">
121
- <span class="pill">📦 <a href="https://huggingface.co/FrameXlabs/Trout">Model weights · FrameXlabs/Trout</a></span>
122
- <span class="pill">🧩 <a href="https://huggingface.co/datasets/Angais/pixel-art-atlas-1.4m">Dataset · Pixel Art Atlas 1.4M</a></span>
123
- <span class="pill">✨ <a href="https://huggingface.co/thejagstudio/tessera-small">Architecture reference · Tessera-small</a></span>
124
- </div>
125
- <pre># pip install torch transformers huggingface_hub pillow
126
- from huggingface_hub import hf_hub_download
127
- from trout import load_model_from_checkpoint, FrozenTextEncoder, sample, tokens_to_images, make_grid
128
-
129
- ckpt = hf_hub_download("FrameXlabs/Trout", "trout-fp16.pt")
130
- model, palette, meta = load_model_from_checkpoint(ckpt, device="cpu")
131
- enc = FrozenTextEncoder(meta["text_encoder"], model.cfg.text_len, "cpu")
132
-
133
- states, pooled = enc.encode(["golden crown with blue gems"] * 4)
134
- toks = sample(model, states, pooled, steps=16, cfg_scale=3.0,
135
- generator=torch.Generator().manual_seed(0))
136
- images = tokens_to_images(toks, palette)
137
- make_grid(images, ncols=4).save("crowns.png")</pre>
138
- <div class="note" style="margin-top:14px;">
139
- This Space is a <b>static</b> page (free hosting). A complete interactive
140
- <b>Gradio demo</b> (prompt → sprites, with CFG/steps/temperature controls) is included
141
- in this Space’s repo (<code>app.py</code>, <code>trout.py</code>,
142
- <code>requirements.txt</code>) and in the model repo. Hugging Face currently
143
- requires a PRO subscription to host Gradio Spaces on free cpu-basic hardware;
144
- once available, pointing the Space SDK at Gradio makes the demo live unchanged.
145
- </div>
146
- </div>
147
- </section>
148
-
149
- <section>
150
- <h2>Sources</h2>
151
- <div class="card" style="font-size:14.5px;">
152
- <ul style="margin:0; padding-left:20px;">
153
- <li>Tessera-small by Jagrat Patel (TheJagStudio) — the published architecture this from-scratch model implements.</li>
154
- <li>Pixel Art Atlas 1.4M by Angais — training data (CC0).</li>
155
- <li>Sahoo et al., <i>Simple and Effective Masked Diffusion Language Models</i>, NeurIPS 2024 (arXiv:2406.07524).</li>
156
- <li>Shi et al., <i>Simplified and Generalized Masked Diffusion for Discrete Data</i>, NeurIPS 2024 (arXiv:2406.04329).</li>
157
- <li>Chang et al., <i>MaskGIT</i>, CVPR 2022 (arXiv:2202.04200) — parallel confidence-ordered decoding.</li>
158
- <li>Blecher et al., <i>Nougat</i> (arXiv:2308.13418) — hourglass transformer.</li>
159
- <li>Peebles &amp; Xie, <i>DiT</i> (arXiv:2212.09748); PixArt-α — adaLN-single.</li>
160
- <li>Darcet et al., <i>Vision Transformers Need Registers</i>, ICLR 2024.</li>
161
- <li>Chen, <i>Analog Bits</i> (arXiv:2208.04202) — self-conditioning.</li>
162
- <li>Jordan et al., <i>Muon</i> (arXiv:2502.16982); Moonshot <i>Muon is Scalable</i> (arXiv:2508.02535).</li>
163
- <li>Ottosson, <i>OKLab</i> perceptual color space (2020).</li>
164
- </ul>
165
- </div>
166
- </section>
167
-
168
- <footer>
169
- Trout · built and trained from scratch for <b>FrameXlabs</b> · Apache-2.0 ·
170
- CLIP text tower (OpenAI, MIT) conditions inference but is not redistributed with the weights.
171
- </footer>
172
- </div>
173
- <script src="palette.js"></script>
174
- <script>
175
- (function () {
176
- const pal = document.getElementById("pal");
177
- const cells = [];
178
- for (let i = 0; i < PALETTE.length; i++) {
179
- const d = document.createElement("div");
180
- const c = PALETTE[i];
181
- if (i === 0) {
182
- d.style.background = "repeating-conic-gradient(#c8c8c8 0% 25%, #e6e6e6 0% 50%) 0 0 / 25% 25%";
183
- } else {
184
- d.style.background = "rgb(" + c[0] + "," + c[1] + "," + c[2] + ")";
185
- }
186
- d.title = i === 0 ? "0 · transparent" : i + " · rgb(" + c.join(",") + ")";
187
- pal.appendChild(d);
188
- }
189
- })();
190
- </script>
191
- </body>
192
- </html>