File size: 24,499 Bytes
2a7ac59
712932c
2a7ac59
 
 
 
755f1e7
 
 
2a7ac59
755f1e7
2a7ac59
 
40c5ebe
 
2af9ada
78ec5eb
2af9ada
712932c
 
 
40c5ebe
755f1e7
40c5ebe
 
02d5c4b
40c5ebe
7027272
40c5ebe
7d67310
 
 
 
89758a9
 
a5a82a4
89758a9
7d67310
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
02d5c4b
755f1e7
02d5c4b
755f1e7
02d5c4b
755f1e7
02d5c4b
 
 
40c5ebe
02d5c4b
 
 
 
 
 
 
 
 
40c5ebe
02d5c4b
40c5ebe
02d5c4b
40c5ebe
02d5c4b
40c5ebe
02d5c4b
 
fd6181b
 
 
 
 
 
 
 
 
02d5c4b
 
 
 
 
 
 
 
 
40c5ebe
 
9f53861
40c5ebe
 
 
 
02d5c4b
40c5ebe
02d5c4b
40c5ebe
 
 
 
02d5c4b
40c5ebe
 
02d5c4b
40c5ebe
02d5c4b
 
 
40c5ebe
 
 
 
02d5c4b
 
 
 
 
 
 
 
7027272
 
40c5ebe
02d5c4b
 
7027272
02d5c4b
fd6181b
 
02d5c4b
 
3065098
 
 
 
 
 
a4bec64
3065098
a4bec64
3065098
 
 
 
 
 
 
fb4c573
3065098
fb4c573
3065098
a4bec64
 
fb4c573
a4bec64
 
3065098
02d5c4b
8cdd6e8
 
60531b0
 
8cdd6e8
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
86f928f
8cdd6e8
 
 
86f928f
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
a5a82a4
8cdd6e8
 
 
 
 
 
 
 
 
 
 
 
02d5c4b
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
40c5ebe
ee5e535
40c5ebe
02d5c4b
40c5ebe
02d5c4b
40c5ebe
02d5c4b
40c5ebe
ee5e535
 
 
 
 
40c5ebe
02d5c4b
40c5ebe
02d5c4b
40c5ebe
02d5c4b
40c5ebe
 
 
ee5e535
 
 
 
40c5ebe
 
 
02d5c4b
40c5ebe
ee5e535
40c5ebe
ee5e535
40c5ebe
02d5c4b
40c5ebe
 
 
02d5c4b
 
40c5ebe
02d5c4b
40c5ebe
 
 
02d5c4b
40c5ebe
 
 
 
 
 
02d5c4b
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
---
license: apache-2.0
pipeline_tag: text-to-image
tags:
  - pixel-art
  - sprite-generation
  - rectified-flow
  - diffusion
  - transformer
  - onnx
  - safetensors
---

# Solstice 80M

[![Open in Spaces](https://huggingface.co/datasets/huggingface/badges/resolve/main/open-in-hf-spaces-md.svg)](https://huggingface.co/spaces/ThalisAI/solstice-80m-webgpu)
[![ComfyUI Pixel Art Nodes on GitHub](https://img.shields.io/badge/ComfyUI-Pixel%20Art%20Nodes-24292f?logo=github)](https://github.com/thalismind/comfyui-pixel-art-nodes)

Released under the [Apache License 2.0](LICENSE).

> **Training is incomplete.** These checkpoints are an interim release. The training data is being recaptioned by eye under new caption rules, and the model will be retrained on the new captions once they are done. Expect the weights, prompts and examples here to change.

- **Architecture starting point:** [Bhoidy/nyx-image-36m](https://huggingface.co/Bhoidy/nyx-image-36m)
- **Text encoder:** [google/t5gemma-2b-2b-ul2](https://huggingface.co/google/t5gemma-2b-2b-ul2)

Solstice 80M generates 32×32 RGBA pixel-art sprites from text. It is a rectified-flow hourglass diffusion transformer with a frozen T5Gemma-2b text encoder.

Models are named by architecture and snapshot date (MMDD). The current model is **r80-1202**. Its teacher and the distilled 20-, 10- and 5-step students are included as Safetensors. The teacher and the 20-, 10- and 5-step students are exported to ONNX. The previous model, **s80-1201**, is retired; its checkpoints, students, and ONNX exports are still in the repository and are described under [s80-1201 (retired)](#s80-1201-retired).

![Solstice 80M r80-1202 showcase: 36 sprites from the 20-step student](images/showcase-r80-1202-student-20-step.png)

*36 sprites from the r80-1202 20-step student (fp32 ONNX): 20 Euler steps, guidance 4, seed 42 for every prompt, binary alpha, shown at 4× nearest-neighbour. Each subject is the first sample for its prompt; nothing is cherry-picked. The layout and subjects follow the Nyx-36M showcase.*

![Ghost texture LoRA: base teacher, strength 0.5 and strength 1.0](loras/r80-1202/ghost/sheet.png)

*The ghost texture [LoRA](#loras) (trigger `spectral style`) on the r80-1202 teacher: rows show the base, strength 0.5 and strength 1.0, two seeds per prompt. The prompts right of the divider leave out the trigger and stay unchanged.*

<details>
<summary>Showcase prompts</summary>

Solstice responds best to short descriptions rather than bare names, so each subject uses a descriptive prompt. The five marked * are Nyx-36M's own benchmark prompts; the rest describe the subject's usual look. Each prompt is wrapped in the template `pixel art, 32px, <prompt>`.

| Subject | Prompt |
|---|---|
| Christmas Tree | green christmas tree with a gold star and red ornaments |
| Golden Crown | golden crown with rubies * |
| Dragon Sword | flaming dragon sword with a brown hilt |
| Lavender Shield | striped lavender shield * |
| Haunted Armor | haunted scale mail * |
| Mana Potion | blue mana potion in a round glass flask with a cork |
| Health Potion | red health potion in a round glass flask with a cork |
| Battleaxe | steel battleaxe with a wooden handle |
| Poison Dagger | green poison dagger |
| Elven Bow | wooden elven bow |
| Steel Helmet | steel knight helmet with white wings |
| Golden Chalice | golden chalice |
| Slime Monster | green slime monster |
| Baby Dragon | small red baby dragon |
| Shadow Wizard | old wizard with a white beard in a purple robe and pointed hat with a staff |
| Skeleton Warrior | skeleton warrior with a sword and a dark cape |
| Cool Cat | orange cat wearing black sunglasses |
| Treasure Chest | golden treasure chest |
| Crystal Ball | crystal ball on a bronze stand |
| Spooky Ghost | white spooky ghost |
| Snowy Owl | white snowy owl |
| Arctic Fox | orange fox sitting with a white chest |
| Retro Robot | small grey retro robot with an antenna |
| Jack-o'-Lantern | carved orange jack-o'-lantern pumpkin |
| Ramen Bowl | steaming bowl of ramen * |
| Grandfather Clock | wooden grandfather clock |
| Red Armchair | red armchair * |
| Starfighter | white starfighter spaceship with a blue cockpit |
| Golden Key | golden key |
| Pink Donut | pink frosted donut with sprinkles |
| Tavern Mug | wooden tavern mug of foaming beer |
| Spellbook | brown leather spellbook with a gold emblem |
| Campfire | campfire with burning logs |
| Arcade Cabinet | red arcade cabinet |
| Blue Diamond | blue diamond |
| Christmas Gift | gold wrapped christmas gift box with a bow |

</details>

## Architecture: r80-1202

![Solstice 80M r80-1202 architecture](images/architecture-r80-1202.png)

r80-1202 keeps the Nyx-style hourglass: a convolutional stem and head at 32×32, DiT blocks on 16×16 and 8×8 token grids, and skip connections at 32×32 and 16×16. Compared with s80-1201, it makes three changes:

1. **Rebalanced depth (`r80`).** Depth moves from the 8×8 core to the 16×16 stages and the stem: the layout changes from **2 + 20 + 2** to **4 + 12 + 4** DiT blocks. The 16×16 stages widen from 256 to 384, and the stem and head widen from 64 to 128 channels. The 8×8 core stays at width 384.
2. **Clean-sprite prediction.** The head predicts the clean sprite x̂₀. `forward()` still returns a velocity, `v = (x_t − x̂₀) / max(t, 0.05)`, so samplers written for velocity models work unchanged.
3. **Self-conditioning.** The stem takes 8 channels: the noisy sprite plus the model's previous clean-sprite estimate. During sampling, each model evaluation passes in `(x − t·v).clamp(−1, 1)` from the evaluation before, computed from the guided velocity; the first evaluation passes zeros.

| | r80-1202 (current) | s80-1201 (retired) |
|---|---|---|
| DiT blocks (16×16 + 8×8 + 16×16) | 4 + 12 + 4 | 2 + 20 + 2 |
| Width: stem / 16×16 / 8×8 | 128 / 384 / 384 | 64 / 256 / 384 |
| Prediction | clean sprite x̂₀ (returned as velocity) | velocity |
| Input channels | 8 (sprite + previous x̂₀) | 4 |
| Parameters (excluding text encoder) | 73.1M | 76.6M |
| GFLOP per forward | 17.6 | 10.2 |
| Default teacher sampler | 30 Heun steps | 40 Euler steps |

The text encoder (frozen T5Gemma-2b, 64 tokens × 2304, mean-pooled for the AdaLN conditioning), the prompt template `pixel art, 32px, <caption>`, and the RGBA output format are unchanged. The full constructor and sampling settings are in [`config.json`](config.json); the model code is [`model.py`](model.py).

### Training and checkpoint choice

r80-1202 trained for 176.5k steps at batch 256 on about 227k captioned sprites, using Muon (lr 0.015) and AdamW (lr 3e-4) and an EMA of 0.9995. The learning rate cooled down from step 150k.

The released weights are the **EMA at step 168k**, not the 176.5k final. The final checkpoint had started to memorise the training set. It was worse on held-out designs (loss 0.1276 against 0.1238 at 168k) and on the prompt-binding score (0.49 against 0.58; higher is better). The 168k checkpoint also looked better on fixed comparison sheets.

![Solstice 80M r80-1202 training loss](images/training-loss-r80-1202.png)

![Solstice 80M r80-1202 held-out loss](images/heldout-loss-r80-1202.png)

| Checkpoint | Train | Held-out designs | Held-out sprites |
|---|---:|---:|---:|
| r80-1202 (168k, released) | 0.0740 | 0.1238 | 0.0731 |
| 176.5k final (not released) | 0.0708 | 0.1276 | 0.0723 |

### Sampling

The teacher's default sampler is **30 Heun steps** from t = 1 to 0, with classifier-free guidance 4 on t ≤ 0.75 and self-conditioning. Each Heun step evaluates the model at the start of the step and again at the Euler predictor's endpoint, then averages the two velocities; the last step is a plain Euler step to t = 0. That is 59 evaluations, or 103 forwards per sprite with guidance. The sheets the 168k checkpoint was chosen from were sampled this way.

40 Euler steps with the same guidance and self-conditioning (70 forwards per sprite) is the teacher sampler that distillation targets. Select it with `--sampler euler --steps 40`.

## Usage

[`generate.py`](generate.py) supports Safetensors and ONNX and returns a 32×32 RGBA Pillow image. It loads [`google/t5gemma-2b-2b-ul2`](https://huggingface.co/google/t5gemma-2b-2b-ul2) from Hugging Face on first use. Steps and sampler default to the checkpoint's own: 30 Heun steps for the r80-1202 teacher, Euler at the distilled step count for students.

```python
# pip install torch transformers safetensors numpy pillow
from generate import generate

image = generate(
    "a red potion bottle",
    "pytorch/r80-1202/teacher.safetensors",
    text_encoder="google/t5gemma-2b-2b-ul2",
    device="cuda",  # use "cpu" for CPU inference
)
image.save("potion.png")
```

The same example from the command line:

```sh
python generate.py pytorch/r80-1202/teacher.safetensors \
  --prompt "a red potion bottle" --output potion.png --device cuda
# the distillation target sampler instead:
python generate.py pytorch/r80-1202/teacher.safetensors \
  --prompt "a red potion bottle" --output potion.png --sampler euler --steps 40
```

Input is a short sprite description. Output is a 32×32 RGBA image with binary transparency; palette quantization is recommended before use.

Each Safetensors file names its config in its metadata (`config`). Files without that entry are s80-1201 files and use [`configs/s80-1201.json`](configs/s80-1201.json).

## Safetensors checkpoints

| Model | Default sampler | Forwards per sprite | r80-1202 |
|---|---|---:|---|
| Teacher | 30 Heun steps, CFG 4 | 103 | [Safetensors](pytorch/r80-1202/teacher.safetensors) |
| Student | 20 Euler steps, guidance `w` | 20 | [Safetensors](pytorch/r80-1202/student-20-step.safetensors) |
| Student | 10 Euler steps, guidance `w` | 10 | [Safetensors](pytorch/r80-1202/student-10-step.safetensors) |
| Student | 5 Euler steps, guidance `w` | 5 | [Safetensors](pytorch/r80-1202/student-5-step.safetensors) |

All files are fp32 and EMA-only; optimizer and training state are omitted. The teacher has 73.1M parameters and needs external classifier-free guidance and the self-conditioning input described above.

The 20-step student (73.4M parameters) was distilled from the teacher in two stages. Guidance distillation trained for 12k steps, and the end checkpoint was kept. A 20-step round then trained for 8k steps, and the checkpoint at 4k was picked by eye. The student takes guidance scale `w` as an input (usual range 1–7; `generate.py` passes `--guidance`, default 4). It runs one forward per Euler step. It is run without self-conditioning feedback: its `sc` input stays zero, which `generate.py` handles. The 10-step student was distilled from the 20-step student for 4k steps, with the checkpoint at 2k picked by eye; the 5-step student was distilled from the 10-step student for 4k steps, with the end checkpoint picked. Both work the same way as the 20-step student.

![Solstice 80M r80-1202 distillation ladder](images/distillation-r80-1202.png)

## ONNX exports

| Variant | Teacher (30 Heun steps) | 20-step student | 10-step student | 5-step student | Size | Execution provider |
|---|---|---|---|---|---:|---|
| fp32 | [ONNX](onnx/r80-1202/teacher/fp32.onnx) | [ONNX](onnx/r80-1202/student-20-step/fp32.onnx) | [ONNX](onnx/r80-1202/student-10-step/fp32.onnx) | [ONNX](onnx/r80-1202/student-5-step/fp32.onnx) | 285 MB | CPU, CUDA |
| bf16 | [ONNX](onnx/r80-1202/teacher/bf16.onnx) | [ONNX](onnx/r80-1202/student-20-step/bf16.onnx) | [ONNX](onnx/r80-1202/student-10-step/bf16.onnx) | [ONNX](onnx/r80-1202/student-5-step/bf16.onnx) | 145 MB | CUDA only |
| bf16 weights, fp32 compute | [ONNX](onnx/r80-1202/teacher/bf16w.onnx) | [ONNX](onnx/r80-1202/student-20-step/bf16w.onnx) | [ONNX](onnx/r80-1202/student-10-step/bf16w.onnx) | [ONNX](onnx/r80-1202/student-5-step/bf16w.onnx) | 145 MB | CPU, CUDA |
| dynamic int8 | [ONNX](onnx/r80-1202/teacher/int8_dynamic.onnx) | [ONNX](onnx/r80-1202/student-20-step/int8_dynamic.onnx) | [ONNX](onnx/r80-1202/student-10-step/int8_dynamic.onnx) | [ONNX](onnx/r80-1202/student-5-step/int8_dynamic.onnx) | 81 MB | CPU |

Accuracy against PyTorch fp32 over 592 full samples per model (guidance 4): mean RGB difference on a 0-255 scale, share of pixels off by more than 8, and share of alpha flips.

| Variant | Teacher | 20-step student | 10-step student | 5-step student |
|---|---|---|---|---|
| fp32 | 0.16 / 0.4% / 0.01% | 0.03 / 0.01% / 0.001% | 0.05 / 0.07% / 0.003% | 0.03 / 0.01% / 0.003% |
| bf16 | 3.08 / 8.6% / 0.28% | 1.36 / 3.5% / 0.31% | 1.38 / 3.4% / 0.21% | 1.18 / 2.9% / 0.20% |
| bf16w | 1.64 / 4.5% / 0.16% | 0.82 / 1.9% / 0.12% | 0.58 / 1.1% / 0.07% | 0.51 / 0.8% / 0.07% |
| dynamic int8 | 10.73 / 34.9% / 1.5% | 6.16 / 22.5% / 1.2% | 6.02 / 23.6% / 1.1% | 5.34 / 22.8% / 1.1% |
| PyTorch bf16, for reference | 2.62 / 7.2% / 0.25% | 1.02 / 2.2% / 0.20% | 0.99 / 2.4% / 0.15% | 0.84 / 1.7% / 0.13% |

fp32 matches PyTorch almost exactly. Dynamic int8 drifts visibly in colour; prefer fp32 or bf16w unless size matters most. The teacher drifts more than the students because small differences compound over its 59 evaluations: with int8, many teacher sprites keep their subject and style but change details (markings, poses).

Inputs are `x` `[B,4,32,32]`, `t` `[B]`, `pool` `[B,2304]`, `tokens` `[B,64,2304]`, `mask` `[B,64]`, and `w` `[B]` (guidance scale). Output is velocity `v` `[B,4,32,32]`. Students run without self-conditioning, so they have no `sc` input. The teacher takes one more input, `sc` `[B,4,32,32]`: the previous evaluation's x0 estimate (zeros at the first), which `generate.py` feeds. At batch 16, a 20-step sprite takes about 0.66 s on a 16-thread CPU (fp32) and 38 ms with CUDA; a 10-step sprite about 0.34 s and 19 ms; a 5-step sprite about 0.17 s and 10 ms; a teacher sprite (30 Heun steps with CFG, 103 evaluations) about 3.5 s and 0.1 s.

```sh
python generate.py onnx/r80-1202/student-10-step/fp32.onnx --prompt "a red potion bottle" --output potion.png
```

The 10-step student was distilled from the 20-step student for 4k steps; the checkpoint at 2k was picked by eye. The 5-step student was distilled from the 10-step student for 4k steps; the final checkpoint was picked by eye. The [s80-1201 exports](#s80-1201-onnx-exports) are unchanged.

## LoRAs

Like any good image model, Solstice supports LoRAs. Unlike most image models, the diffusion model has only 80M parameters and a LoRA trains in about nine minutes on one GPU, so you can afford to make one for every passing whim: ghosts, knights, slimes, a monochrome phase.

Six example LoRAs for the r80-1202 teacher, each trained on 250 sprites for 2,000 steps (rank 16, alpha 16, attention and MLP layers in all 20 blocks). Put the trigger at the start of the prompt.

| LoRA | Trigger | What it learned | File |
|---|---|---|---|
| Ghost texture | `spectral style` | turns any subject into a translucent purple ghost | [lora](loras/r80-1202/ghost/lora.safetensors) |
| Monochrome | `monochrome` | draws any subject in greys, keeping its shading | [lora](loras/r80-1202/monochrome/lora.safetensors) |
| Cyberpunk | `neon city style` | dark armour, magenta and cyan neon trim and glow | [lora](loras/r80-1202/cyberpunk/lora.safetensors) |
| Knight identity | `sir aldric` | one plumed knight in a blue tabard, carried into new poses and actions | [lora](loras/r80-1202/knight/lora.safetensors) |
| Slime | `slime style` | wider, glossier, flatter slimes (the base already draws slimes, so the change is subtle) | [lora](loras/r80-1202/slime/lora.safetensors) |
| Princess | `princess style` | taller, slimmer figures with long gowns and hair (subtle, for the same reason) | [lora](loras/r80-1202/princess/lora.safetensors) |

```sh
python generate.py pytorch/r80-1202/teacher.safetensors --lora loras/r80-1202/ghost/lora.safetensors \
    --prompt "spectral style, red apple" --output ghost-apple.png
```

`--lora-strength` scales the effect (0.5 often applies it halfway). To make your own, see [Train your own](#train-your-own). `generate.py` merges the LoRA into the teacher's weights before sampling, as `W += strength * alpha / rank * B @ A`; each file's metadata holds its rank, alpha and trigger. The LoRAs were trained on the teacher, so use the teacher checkpoint; they are not tested on the distilled students or the ONNX exports.

**Prompts without the trigger are left alone.** Half of every training batch was ordinary training sprites with their own captions and no trigger (prior preservation). Without it, the LoRAs also changed untriggered prompts: flow loss on 256 held-out designs, with no trigger, rose 7-46% over the base. With it, the rise is under 1% for every LoRA here.

### Train your own

[`train_lora.py`](train_lora.py) trains a LoRA on a folder of your own captioned sprites, with the same recipe as the LoRAs above. It needs the same packages as `generate.py` and a CUDA GPU.

1. **Collect 100-250 sprites** in one folder: 32×32 RGBA PNGs, drawn at 32 px (downscaled art teaches blurry pixels; the script rejects other sizes).
2. **Caption each one** by what is drawn, either in a `captions.jsonl` (`{"file": "apple.png", "caption": "red apple with a green leaf, front view"}` per line) or in a `.txt` file beside each image. Don't put the trigger in the captions; the script adds it. Say the view and which way things face (`side view, facing left`): sprites are also trained mirrored, with left and right swapped in the caption.
3. **Train**, then check it with a sheet. Put some prompts without the trigger in the sheet's prompt file, to see that ordinary prompts stay unchanged.

```sh
python train_lora.py train --data my-sprites --trigger "my style" --out runs/my-style
python train_lora.py sheet --lora runs/my-style/lora.safetensors --prompts sheet-prompts.txt --out sheet.png
python generate.py pytorch/r80-1202/teacher.safetensors --lora runs/my-style/lora.safetensors \
    --prompt "my style, red apple" --output apple.png
```

Training takes about 11 minutes on an RTX A6000: about 2 minutes for the teacher to draw 400 sprites from [`prior_prompts.txt`](prior_prompts.txt), once per output folder, and 9 for 2,000 steps. Those sprites are the prior: half of every batch, trained with their own prompts and no trigger, which keeps untriggered prompts close to the base. Use `--prior-dir` to supply your own captioned sprites as the prior instead, or `--prior-frac 0` to turn it off. `--steps`, `--rank`, `--lr` and `--save` (extra checkpoints at given steps) cover the usual knobs; `python train_lora.py train --help` lists them all.

As a test, the ghost LoRA retrained from scratch with this script on the same 250 sprites (prior drawn by the teacher instead of taken from the training data) comes out matching the released one:

![Ghost LoRA retrained with train_lora.py](images/lora-trainer-ghost.png)

Each sheet below has three rows: the base teacher, then the LoRA at strength 0.5 and 1.0. Each prompt gets two seeds. The prompts right of the divider leave out the trigger, so they show what the LoRA does to ordinary prompts.

<details><summary>Example sheets</summary>

![Ghost texture LoRA](loras/r80-1202/ghost/sheet.png)
![Monochrome LoRA](loras/r80-1202/monochrome/sheet.png)
![Cyberpunk LoRA](loras/r80-1202/cyberpunk/sheet.png)
![Knight identity LoRA](loras/r80-1202/knight/sheet.png)
![Slime LoRA](loras/r80-1202/slime/sheet.png)
![Princess LoRA](loras/r80-1202/princess/sheet.png)

</details>

## s80-1201 (retired)

<details>
<summary>The previous model: s80 teacher at 72k (s80-1201) and 100k (s80-1201-100k), distilled students, and ONNX exports. Retired; kept for reference.</summary>

The s80-1201 files are unchanged in this repository, apart from their folder names. Their config is [`configs/s80-1201.json`](configs/s80-1201.json).

### From Nyx to Solstice

Solstice started from Nyx Image 36M’s rectified-flow hourglass design. s80-1201 still predicts velocity directly in 32×32 RGBA pixel space and keeps Nyx’s convolutional stem and head, 32×32 and 16×16 skip connections, and two transformer blocks on each side of the 16×16 stage.

Most of the expansion is in the 8×8 bottleneck: it grew from 8 to 20 transformer blocks at the same width of 384, changing the block layout from **2 + 8 + 2** to **2 + 20 + 2**. We also replaced Nyx’s frozen SigLIP text encoder (32 tokens, width 768) with frozen T5Gemma-2b (64 tokens, width 2304). The s80-1201 teacher has 76.6M parameters, excluding the text encoder, compared with 36M for Nyx.

### Usage

[`generate.py`](generate.py) still loads these files: Safetensors files without a `config` metadata entry use [`configs/s80-1201.json`](configs/s80-1201.json), and sample with Euler steps (40 for the teacher, the distilled step count for students).

```sh
python generate.py pytorch/s80-1201/student-20-step.safetensors \
  --prompt "a red potion bottle" --output potion.png --device cuda
```

### Model diagrams

![Solstice 80M s80-1201 architecture](images/architecture-s80-1201.png)

![Solstice 80M distilled model ladder](images/distillation-s80-1201.png)

### Safetensors checkpoints

`s80-1201` is the 72k checkpoint, the primary chain. Its 20-, 10-, and 5-step students use the selected best checkpoints. `s80-1201-100k`, the same run at 100k, is retained for reference and uses its end-of-round students.

| Model | Euler steps | Forwards per sprite | s80-1201 (72k) | s80-1201-100k (reference) |
|---|---:|---:|---|---|
| Teacher | 40 | 70 with CFG 4 | [Safetensors](pytorch/s80-1201/teacher.safetensors) | [Safetensors](pytorch/s80-1201-100k/teacher.safetensors) |
| Guidance-distilled | 40 | 40 | [Safetensors](pytorch/s80-1201/guidance-40-step.safetensors) | [Safetensors](pytorch/s80-1201-100k/guidance-40-step.safetensors) |
| Student | 20 | 20 | [Safetensors](pytorch/s80-1201/student-20-step.safetensors) | [Safetensors](pytorch/s80-1201-100k/student-20-step.safetensors) |
| Student | 10 | 10 | [Safetensors](pytorch/s80-1201/student-10-step.safetensors) | [Safetensors](pytorch/s80-1201-100k/student-10-step.safetensors) |
| Student | 5 | 5 | [Safetensors](pytorch/s80-1201/student-5-step.safetensors) | [Safetensors](pytorch/s80-1201-100k/student-5-step.safetensors) |

Teacher checkpoints have 76.6M parameters and require external classifier-free guidance. Distilled checkpoints add a guidance embedding and accept guidance scale `w` directly; the usual range is 1–7. When constructing a student, apply `student_constructor` from [`configs/s80-1201.json`](configs/s80-1201.json) to set `guidance=true`.

### s80-1201 ONNX exports

ONNX exports are available for the **s80-1201 teacher**, **10-step student**, and **5-step student**. Each file contains one model forward, opset 18, with dynamic batch size. Sampling and prompt encoding are external.

| Variant | Teacher | 10-step student | 5-step student | Execution provider |
|---|---|---|---|---|
| fp32 | [ONNX](onnx/s80-1201/teacher/fp32.onnx) | [ONNX](onnx/s80-1201/student-10-step/fp32.onnx) | [ONNX](onnx/s80-1201/student-5-step/fp32.onnx) | CPU, CUDA |
| bf16 | [ONNX](onnx/s80-1201/teacher/bf16.onnx) | [ONNX](onnx/s80-1201/student-10-step/bf16.onnx) | [ONNX](onnx/s80-1201/student-5-step/bf16.onnx) | CUDA only |
| bf16 weights, fp32 compute | [ONNX](onnx/s80-1201/teacher/bf16w.onnx) | [ONNX](onnx/s80-1201/student-10-step/bf16w.onnx) | [ONNX](onnx/s80-1201/student-5-step/bf16w.onnx) | CPU, CUDA |
| dynamic int8 | [ONNX](onnx/s80-1201/teacher/int8_dynamic.onnx) | [ONNX](onnx/s80-1201/student-10-step/int8_dynamic.onnx) | [ONNX](onnx/s80-1201/student-5-step/int8_dynamic.onnx) | CPU |

Inputs are `x` `[B,4,32,32]`, `t` `[B]`, `pool` `[B,2304]`, `tokens` `[B,64,2304]`, and `mask` `[B,64]`. Students additionally take `w` `[B]`. Output is velocity `v` `[B,4,32,32]`.

### Loss curves

![Solstice 80M training loss](images/training-loss-s80-1201.png)

![Solstice 80M held-out loss](images/heldout-loss-s80-1201.png)

#### s80-1201 evaluation loss

| Checkpoint | Train | Held-out designs | Held-out sprites |
|---|---:|---:|---:|
| s80-1201 (72k) | 0.0865 | 0.1208 | 0.0775 |
| s80-1201-100k | 0.0786 | 0.1253 | 0.0734 |

#### Distilled-model held-out flow loss

Measured at guidance scale 1; lower is better.

| Model | s80-1201 (72k) chain | s80-1201-100k chain |
|---|---:|---:|
| Teacher | 0.1211 | 0.1253 |
| Guidance-distilled, 40 steps | 0.1226 | 0.1253 |
| Student, 20 steps | 0.1225 | 0.1245 |
| Student, 10 steps | 0.1239 | 0.1252 |
| Student, 5 steps | 0.1303 | 0.1389 |

</details>