GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - ocdbytes/PIXL: A low compute sprite generator

BranchesTags
Open more actions menu

Latest commit

 

History

19 Commits
19 Commits

Folders and files

NameName
Last commit message
Last commit date
.github/workflows
.github/workflows
 
 
docs
docs
 
 
notebooks
notebooks
 
 
scripts
scripts
 
 
src/pixl
src/pixl
 
 
tests
tests
 
 
.dockerignore
.dockerignore
 
 
.gitignore
.gitignore
 
 
.python-version
.python-version
 
 
Dockerfile
Dockerfile
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
pyproject.toml
pyproject.toml
 
 
uv.lock
uv.lock
 
 

Repository files navigation

16 scenes drawn by pixl

Seed 0, temperature 0.7, top-k 32 and guidance 3.

Pixl is a small text-to-pixel-art model trained from scratch. It draws a 32×32 scene one pixel at a time from a caption such as “a wizard at the top left … on a dark dungeon floor”. Training uses one million generated scenes made from four sprites placed in the image's four quadrants.

GPU compute: Thanks to @harshitruwali for the GPU time used to train the published model.

Generate an image

The weights are at ocdbytes/pixl. Install the package directly from this repository:

pip install git+https://github.com/ocdbytes/PIXL
import torch
from PIL import Image

from pixl.model import encode_captions
from pixl.preprocess import decode, load_palette
from pixl.tokenizer import Tokenizer
from pixl.train import load_pretrained

model = load_pretrained()  # pass bf16=True for the half-size weights
torch.manual_seed(0)
caption = ("a purple robed wizard at the top left, a closed treasure chest at the top right, "
           "a brown bat at the bottom left and a red potion at the bottom right on a dark dungeon floor")
ids = encode_captions([caption], Tokenizer.load(), length=model.config.caption)
pixels = model.generate(ids, temperature=0.7, top_k=32, guidance=3.0)
image = decode(pixels.view(32, 32).numpy(), load_palette())
image.resize((256, 256), Image.Resampling.NEAREST).save("scene.png")

The model expects the same shape of caption it saw during training: four objects from one sprite pack, each assigned to a quadrant, followed by the ground. See the model card for its vocabulary and limits, or use notebooks/generate.ipynb to try prompts.

App

The pixl app

uv run python -m pixl.app
# open http://127.0.0.1:7860

Pick a preset or build a scene from the model's known sprite packs. Randomize chooses a new scene; Rotate clockwise is useful for checking whether the model follows positions. Advanced controls expose the seed, guidance and temperature.

Flag Effect
--bf16 Use the smaller half-precision weights
--device auto Pick an available GPU, falling back to the CPU
--share Create a temporary public Gradio link

If you installed with pip, install gradio separately.

Documentation

  • Model and inputs: palette, tokenizer and architecture
  • Data: datasets and scene generation
  • Training: running, evaluating and resuming training
  • Remote training: Docker setup for an NVIDIA server
  • Development: repository layout and checks
  • Sprite sources: accepted sprite packs and licences

License

The code uses the BSD 3-Clause License. Downloaded images and datasets keep their original licences.

About

A low compute sprite generator

Resources

Readme
BSD-3-Clause license
Activity

Stars

0 stars

Watchers

0 watching

Forks

0 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.