PXG-Tiny is a deliberately miniature text-to-sprite model: 483k parameters, a pure NumPy inference runtime, and a built-in verifier that checks every sprite against your prompt before showing it. Runs on any laptop CPU in ~0.6 s per sprite.
The final acceptance run tested every class with two prompt styles × two seeds through the exact shipped user path: 152/152 passed (100%). A second, independent sweep with 39 never-seen phrasings scored 99.1%. Each card below is a real accepted render — hover any sprite to zoom.
The corpus is built from a procedural rasterizer with counterfactual twin pairs — identical geometry, one changed word — so the model learns word→pixel causality, not vibes.
| Protocol | Result | What it measures |
|---|---|---|
| Full 38-class grid | 152/152 = 100% | 2 prompt styles × 2 seeds per class, exact shipped pipeline (verifier-guided retries on) |
| Fresh-phrasing sweep | 116/117 = 99.1% | 39 novel phrasings × 3 seeds, same pipeline — guards against overfitting to test prompts |
| Raw held-out (verifier off) | 59.4% mean · 50% strict | 46 adversarial rephrasings, single free-run sample — the honest backbone-only number |
| Parity gate | PASS | NumPy runtime vs trained torch model, bit-level teacher-forced comparison |
No GPU. No PyTorch at inference. No internet. Python ≥ 3.9 with numpy and pillow.
# 1. get the bundle git clone https://github.com/tarulahsan/PXG-Tiny-AI cd PXG-Tiny-AI pip install numpy pillow pytest # 2. single sprite python3 cli.py "a golden sword" -o sword.png # 3. four variations on one sheet python3 cli.py "an iron chest" --variations 4 \ --sheet chest_variants.png # 4. batch from a prompt list python3 cli.py --sheet-from-prompts prompts.txt \ --outdir sprites/
# Python API from pxg_tiny.pipeline import PXGPipeline pipe = PXGPipeline() grid, meta = pipe.generate_pixels( "a ruby potion that glows", seed=7) if grid is None: print(meta["message"]) # clarify / refuse else: pipe.generate_png("a ruby potion that glows", "ruby_potion.png") # ask-first gate (rule-based, offline) PXGPipeline.ask("render a 3d photo") # -> "i only make 16x16 pixel-art sprites..."
pytest tests/ -qcaption ids (32 chars) ──► intent encoder (bi-attention, fp32) ──► 8 prefix vectors [8 prefixes | 256 visual tokens] ──► 4× pre-LN causal blocks (d=96, 4 heads, FFN 256) └─► 32-way softmax over master-palette indices (0 = transparent) teacher-forced top-1 98.89% · KV-cached decode ~0.6 s/sprite on 2 CPU cores training corpus: 97,005 fully procedural rows (CC0), counterfactual twins + paraphrase engine