File size: 11,620 Bytes
48441eb
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
47f584a
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
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Solstice 80M WebGPU</title>
  <meta name="description" content="Solstice 80M and Nyx Image 36M pixel-art sprite generation in the browser with WebGPU: prompt sweeps, embedding arithmetic and LoRAs.">
  <link rel="icon" href="data:image/svg+xml,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 viewBox=%270 0 8 8%27 shape-rendering=%27crispEdges%27%3E%3Crect width=%278%27 height=%278%27 fill=%27%232b2540%27/%3E%3Crect x=%272%27 y=%272%27 width=%274%27 height=%274%27 fill=%27%23ffd36b%27/%3E%3Crect x=%273%27 y=%270%27 width=%272%27 height=%271%27 fill=%27%23f0913a%27/%3E%3Crect x=%273%27 y=%277%27 width=%272%27 height=%271%27 fill=%27%23f0913a%27/%3E%3Crect x=%270%27 y=%273%27 width=%271%27 height=%272%27 fill=%27%23f0913a%27/%3E%3Crect x=%277%27 y=%273%27 width=%271%27 height=%272%27 fill=%27%23f0913a%27/%3E%3C/svg%3E">
  <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=Plus+Jakarta+Sans:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500;600&display=swap" rel="stylesheet">
  <link rel="stylesheet" href="style.css">
  <script type="module" src="js/app.js"></script>
</head>
<body>
<div class="container">

  <header>
    <div class="brand">
      <div class="brand-mark" aria-hidden="true"></div>
      <div class="brand-title">
        <h1>Solstice 80M</h1>
        <p>32×32 RGBA pixel-art sprites · runs in your browser</p>
      </div>
    </div>
    <div class="badge" id="engine-badge">
      <span class="dot" id="engine-dot"></span>
      <span id="engine-text">Checking WebGPU…</span>
    </div>
  </header>

  <!-- Model -->
  <section class="card" id="model-card">
    <div class="card-head">
      <h2>Model</h2>
      <span class="muted small" id="model-info"></span>
    </div>
    <div class="row wrap">
      <label class="field grow">
        <span class="field-label">Checkpoint</span>
        <select id="model-select"></select>
      </label>
      <label class="field">
        <span class="field-label">Weights</span>
        <select id="variant-select"></select>
      </label>
      <label class="field">
        <span class="field-label">Backend</span>
        <select id="backend-select">
          <option value="webgpu">WebGPU (WASM fallback)</option>
          <option value="wasm">WASM only</option>
        </select>
      </label>
      <button class="btn" id="btn-load" type="button">Load</button>
    </div>

    <div class="settings">
      <div class="setting">
        <div class="setting-head"><span>Steps</span><span class="val" id="val-steps">20</span></div>
        <input type="range" id="slider-steps" min="1" max="40" step="1" value="20">
      </div>
      <div class="setting">
        <div class="setting-head"><span>Guidance</span><span class="val" id="val-guidance">4.0</span></div>
        <input type="range" id="slider-guidance" min="1" max="7" step="0.5" value="4">
      </div>
      <label class="setting">
        <span class="setting-head"><span>Sampler</span></span>
        <select id="sampler-select">
          <option value="euler">Euler</option>
          <option value="heun">Heun</option>
        </select>
      </label>
      <label class="setting">
        <span class="setting-head"><span>Seed</span><button class="link" id="btn-random-seed" type="button">random</button></span>
        <input type="number" id="seed-input" value="42" min="0" step="1">
      </label>
    </div>

    <div class="progress" id="progress">
      <div class="progress-head"><span id="progress-text">Idle</span><span id="progress-pct"></span></div>
      <div class="track"><div class="fill" id="progress-fill"></div></div>
    </div>
  </section>

  <!-- LoRA -->
  <section class="card" id="lora-card" hidden>
    <div class="card-head">
      <h2>LoRAs</h2>
      <span class="muted small" id="lora-status"></span>
    </div>
    <p class="muted small">Trained on the r80-1202 teacher. Start the prompt with the trigger; prompts without it stay unchanged. Several LoRAs can run at once.</p>
    <div class="lora-list" id="lora-list"></div>
    <label class="btn ghost file-btn">
      Add a LoRA file (.safetensors)
      <input type="file" id="lora-file" accept=".safetensors" hidden>
    </label>
  </section>

  <!-- Modes -->
  <section class="card">
    <div class="tabs" role="tablist">
      <button class="tab active" data-tab="generate" role="tab">Generate</button>
      <button class="tab" data-tab="sweep" role="tab">Prompt sweep</button>
      <button class="tab" data-tab="arith" role="tab">Arithmetic</button>
      <button class="tab" data-tab="library" role="tab">Prompt library</button>
    </div>

    <!-- Generate -->
    <div class="panel active" id="panel-generate">
      <div class="row">
        <input type="text" id="prompt-input" list="library-list" value="golden crown with rubies" placeholder="Pick a precomputed prompt…" autocomplete="off">
        <button class="btn primary" id="btn-generate" type="button">Generate</button>
      </div>
      <div class="hint small" id="prompt-hint"></div>
      <div class="chips" id="chips"></div>
      <div class="row wrap between">
        <div class="field-inline">
          <span class="field-label">Batch</span>
          <div class="pills" id="batch-pills">
            <button class="pill" data-batch="1">1</button>
            <button class="pill active" data-batch="4">4</button>
            <button class="pill" data-batch="8">8</button>
            <button class="pill" data-batch="16">16</button>
          </div>
        </div>
        <label class="check small" id="live-encoder-wrap" hidden>
          <input type="checkbox" id="live-encoder"> Encode free text live (SigLIP, 106 MB)
        </label>
      </div>
    </div>

    <!-- Sweep -->
    <div class="panel" id="panel-sweep">
      <p class="muted small">Interpolate the text conditioning from prompt A to prompt B: token states are slerped per position, the pool vector too, and the noise is fixed for each row.</p>
      <div class="row wrap">
        <label class="field grow"><span class="field-label">Preset</span><select id="sweep-preset"></select></label>
      </div>
      <div class="row wrap">
        <label class="field grow"><span class="field-label">A (t = start)</span><input type="text" id="sweep-a" list="library-list" autocomplete="off"></label>
        <label class="field grow"><span class="field-label">B (t = end)</span><input type="text" id="sweep-b" list="library-list" autocomplete="off"></label>
      </div>
      <div class="settings">
        <div class="setting">
          <div class="setting-head"><span>Frames</span><span class="val" id="val-frames">11</span></div>
          <input type="range" id="sweep-frames" min="3" max="21" step="1" value="11">
        </div>
        <div class="setting">
          <div class="setting-head"><span>Seeds (rows)</span><span class="val" id="val-sweep-seeds">2</span></div>
          <input type="range" id="sweep-seeds" min="1" max="6" step="1" value="2">
        </div>
        <div class="setting">
          <div class="setting-head"><span>t range</span><span class="val" id="val-trange">0 – 1</span></div>
          <div class="row tight">
            <input type="number" id="sweep-t0" value="0" step="0.1" min="-0.5" max="1.5">
            <input type="number" id="sweep-t1" value="1" step="0.1" min="-0.5" max="1.5">
          </div>
        </div>
      </div>
      <button class="btn primary" id="btn-sweep" type="button">Run sweep</button>
    </div>

    <!-- Arithmetic -->
    <div class="panel" id="panel-arith">
      <p class="muted small">
        <b>Word arithmetic</b> computes A − B + C on the token states and pool.
        <b>Averaged direction</b> adds the mean of E[“C obj”] − E[“B obj”] over a group of objects, so the attribute moves without the single words' own objects. Token rows are rescaled to the reference norm.
      </p>
      <div class="row wrap">
        <label class="field grow"><span class="field-label">Preset</span><select id="arith-preset"></select></label>
      </div>
      <div class="row wrap">
        <label class="field grow"><span class="field-label">A (start)</span><input type="text" id="arith-a" list="library-list" autocomplete="off"></label>
        <label class="field grow"><span class="field-label">− B</span><input type="text" id="arith-b" list="library-list" autocomplete="off"></label>
        <label class="field grow"><span class="field-label">+ C</span><input type="text" id="arith-c" list="library-list" autocomplete="off"></label>
        <label class="field grow"><span class="field-label">Direct prompt (compare)</span><input type="text" id="arith-d" list="library-list" autocomplete="off"></label>
      </div>
      <div class="row wrap">
        <label class="field"><span class="field-label">Direction group</span><select id="arith-group"></select></label>
        <label class="field"><span class="field-label">From attribute</span><select id="arith-from"></select></label>
        <label class="field"><span class="field-label">To attribute</span><select id="arith-to"></select></label>
      </div>
      <div class="settings">
        <div class="setting">
          <div class="setting-head"><span>Strength</span><span class="val" id="val-strength">1.00</span></div>
          <input type="range" id="arith-strength" min="0" max="2" step="0.05" value="1">
        </div>
        <div class="setting">
          <div class="setting-head"><span>Seeds (rows)</span><span class="val" id="val-arith-seeds">3</span></div>
          <input type="range" id="arith-seeds" min="1" max="6" step="1" value="3">
        </div>
        <label class="check small"><input type="checkbox" id="arith-ladder"> Also sweep strength 0 → 2 for the averaged direction</label>
      </div>
      <button class="btn primary" id="btn-arith" type="button">Run arithmetic</button>
    </div>

    <!-- Library -->
    <div class="panel" id="panel-library">
      <div class="row">
        <input type="text" id="library-search" placeholder="Search the precomputed prompts…" autocomplete="off">
      </div>
      <div class="muted small" id="library-count"></div>
      <div class="library" id="library"></div>
    </div>
  </section>

  <!-- Output -->
  <section class="card">
    <div class="card-head">
      <h2 id="output-title">Sprites</h2>
      <div class="row tight">
        <label class="check small"><input type="checkbox" id="checker" checked> checkerboard</label>
        <button class="btn ghost small-btn" id="btn-sheet" type="button" disabled>Download sheet</button>
      </div>
    </div>
    <div id="output" class="output"><p class="muted small">Pick a model, then generate. The model downloads once and is cached by your browser.</p></div>
  </section>

  <datalist id="library-list"></datalist>

  <footer>
    <div>
      Models: <a href="https://huggingface.co/ThalisAI/solstice-80m" target="_blank" rel="noopener">ThalisAI/solstice-80m</a> ·
      <a href="https://huggingface.co/Bhoidy/nyx-image-36m" target="_blank" rel="noopener">Bhoidy/nyx-image-36m</a>
    </div>
    <div class="small">
      Inference runs locally with ONNX Runtime Web. Solstice's T5Gemma-2b text encoder is too large for a browser,
      so its prompts are precomputed; sweeps and arithmetic combine those embeddings live.
    </div>
  </footer>
</div>
</body>
</html>