PixelLock — Gemma-4-12B Pixel-Art Retexturer (GGUF, q4_k_m)
A QLoRA fine-tune of google/gemma-4-12b-it for footprint-locked pixel-art retexturing.
It is a text LLM, not an image generator. A sprite is serialized to a
palette-indexed text grid (a PALETTE block plus a GRID of space-separated
cells). The model rewrites that grid in a new style, and a per-sprite GBNF
decoding grammar (llama.cpp) forces every transparent cell to stay transparent
— so the exact silhouette and transparency are preserved by construction, not
by luck.
What it does
- Retheme / restyle palette-indexed pixel-art sprites (best at 16-64px) to any vibe (lava, ice, gold, cosmic, ...) - pixel-perfect.
- 2x upscale with added shading (each input pixel becomes a 2x2 block).
How to use
Run with llama.cpp and pass a footprint-derived GBNF grammar per sprite. The
sprite is sent as a PALETTE + GRID wire block; the grammar pins every
transparent cell. See the PixelLock app for the wire format and grammar builder.
Training
Supervised fine-tune (QLoRA, rank 64, alpha 64, lr 1e-4, completion-only loss) on a curated corpus of palette-indexed pixel-art sprites (<=64px), with step-checkpointing + best-eval selection and a held-out eval set. Final eval loss ~0.38.
Files
pixellock-gemma-12b-q4_k_m.gguf- q4_k_m quant for llama.cpp / LM Studio / Ollama.
Built for the Build Small hackathon.