At a glance
| Model repo & revision |
ihor-umanets/pixelsprite-canvas-v2
· pinned revision 0a29494e9fc020a26feb6f97ec2047fc207ce898
|
|---|---|
| Verified download artifacts |
onnx/decoder.onnx (527,408 B) +
onnx/decoder.f16 (76,635,138 B) +
onnx/embeddings.bin (3,117,056 B) +
onnx/embeddings.json (1,343 B) +
palette.json (15,880 B) =
80,296,825 B (80.30 MB, catalogue 80.3 MB)
|
| Task & architecture |
text-to-image · CanvasGPT2 (39.1M params, 12 decoder layers,
8 heads, d_model = 512, KV-cached autoregressive next-pixel prediction over
1,024 OKLab palette tokens + empty = 1024 + BOS = 1025)
|
| Quantization & dtype |
fp16 external weights (onnx/decoder.f16) expanded in-worker via a
65,536-entry LUT to fp32 (decoder.data, ~30 ms) for universal CPU
WASM execution
|
| Runtime & caching |
Raw onnxruntime-web@1.21.0 CPU WASM (no WebGPU required) inside dedicated
worker.js; atomic OPFS storage via lib/model-store.mjs with Cache Storage
read-through fallback (zero double-storage)
|
| Conditioning & resolutions |
384-d paraphrase-multilingual-MiniLM-L12-v2 text embeddings (15 bundled EN/RU/UK Apache-2.0
starter prompts + optional 2-prompt vector blend + unconditional null_cond) ·
16×16, 24×24 (windowed in 32×32), and 32×32 sprites
|
| License | CC-BY-NC-4.0 (model weights © 2026 Ihor Umanets) · Apache-2.0 (inference code & starter presets) |
1. Live Autoregressive Pixel-Sprite Generator
Initialise PixelSprite Canvas v2 above to synthesize a transparent pixel sprite on-device.
Interactive Autoregressive Pixel Grid
See Inside · Sequence Prefix & 1,024-Color OKLab Tokens
Before pixel (0,0), CanvasGPT2 builds a prefix of 2 + S + 1 tokens
(text projection + size embedding + S row-mask vectors + BOS), then decodes
each pixel in raster scan order over 1,024 OKLab colors + empty (#1024).
Selected pixel telemetry (token ID, OKLab coordinates, p(empty), entropy) appears after generation.
Top Sampled OKLab Palette Tokens
Why PixelSprite Canvas v2 matters
Conventional text-to-image diffusion models need gigabytes of VRAM and still struggle to emit clean, single-pixel
transparent edges without anti-aliased haloing. PixelSprite Canvas v2 treats pixel art as a
discrete 1,024-color OKLab sequence inside a 39.1M-parameter decoder that runs in
80.30 MB on plain CPU WebAssembly:
- Native transparent pixels: empty background is token
#1024directly inside the softmax — zero alpha-matting artifacts. - Split shape vs. colour guidance: separate
g_shape(empty log-odds) andg_colour(1,024-color distribution) sliders let developers tune silhouette tightness independently from palette saturation. - Zero-violation silhouette conditioning: feeding a binary mask via
mask_projand edge flags (interior vs. boundary) guarantees exact-outline auto-colorization. - Sub-2-second CPU WASM synthesis: 16×16 sprites generate in ~1–2 seconds with zero server GPU bills and zero prompt/image egress.
Use-case ladder
1. Basics · Split-CFG & Silhouette Playground
Tune temperature, g_shape, and g_colour while contrasting unconstrained synthesis against exact-outline silhouette auto-colorization.
2. Practical · Batch Sprite Sheet & Favicon Factory
Queue 4–6 game props with Pause, Resume, and Cancel controls and export multi-scale PNG sprite sheets, binary .ico favicons, and CSV/JSON ledgers.
3. Wild · Seed Stability & CFG Perturbation Sweep
Sweep seed shifts, high CFG, 384-d conditioning noise, and flipped silhouette masks while charting OKLab color spread and convergence stability.
4. Multi-model · Photo → U-2-Netp → PixelSprite
Chain 4.57 MB U-2-Netp foreground extraction with 80.30 MB PixelSprite Canvas v2 to turn real photos into auto-colorized pixel sprites (~84.87 MB total).
How the API works
Inside worker.js, PixelSprite Canvas v2 expands onnx/decoder.f16 to float32 via a
65,536-entry LUT, loads onnx/decoder.onnx with onnxruntime-web@1.21.0 on CPU WASM,
builds the 2 + S + 1 conditioning prefix, and autoregressively decodes each pixel with KV-caching.