Pixelquill-61M
16×16 pixel-art sprite generation without diffusion or a VAE
3 min read
A compact 61.3M-parameter model by MahdiAlikhah that turns short English prompts into ready-to-use 16×16 pixel sprites. Unlike standard image generators, it was trained from scratch without diffusion or a VAE (an encoder network used to compress images). Instead of producing blurry pixels, the model autoregressively predicts a sequence of 289 discrete tokens: it first picks a 32-color palette and then fills each of the 256 pixels with indices from that palette, including transparency. Ideal for indie devs and hobbyists looking to quickly prototype game icons, items, and simple characters.
Key features
- Tokens instead of diffusion: the model locks in a 32-color palette before placing pixels, preventing color bleed and outputting a clean RGBA sprite right away.
- Lightweight architecture trained from scratch: pairs a 3-layer text encoder with a closed 8,643-word vocabulary and a 12-layer decoder featuring 2D axial RoPE and SwiGLU; fp32 weights take up just 245.5 MB.
- Color accuracy and novelty: in tests, 23 out of 24 color-named prompts hit the target hue (with a 4° median error), and none of the generated sprites were exact duplicates from the training set.
- Open license: code and weights are released under Apache-2.0, trained on the open pixel-art-atlas-1.4m dataset (CC0-1.0).
What you can do
- Prototype game assets: quickly draft icons for potions, weapons, monsters, or environment props using short text prompts like
cute teal slimeorgreen potion. - Batch-generate sprite sheets: pass a list of prompts directly to
generate()and save upscaled image sets (such as crisp 16×16 to 128×128 scaling without blur) straight from Python or the CLI. - Recolor objects via prompts: swap just the color word in your prompt to generate variations of the same item—this works best on round shapes like slimes and potions.
Example
import sys
from huggingface_hub import snapshot_download
path = snapshot_download("MahdiAlikhah/pixelquill-61m", local_dir="pixelquill")
sys.path.insert(0, path)
from pixelquill import Pixelquill
model = Pixelquill.from_pretrained(path)
model.generate_one("cute teal slime", scale=8).save("slime.png")
Read more
DetailsMetrics on held-out objects with zero training overlap: per-pixel accuracy is 80.65% with teacher-forcing and 31.6% in free-running generation, with 0.00% exact full-sprite matches.
Speed and hardware: on an NVIDIA L4, generation takes ~2.8 s per sprite (~90 s for a batch of 32), as sampling does not yet use KV-caching.
Limitations: fixed 16×16 canvas, a closed 8,643-word English vocabulary (unknown words become
), weak structural consistency on thin objects like swords (0.46 IoU vs. 0.94 for slimes), confusion when combining two objects in a single prompt, and high variance across seeds (28% pixel overlap).









Comments