/ Модель

Характеристики

Лицензия
CC0 1.0
Опубликована
5 ноя 2026

pixl

Генерация изображенийТекст → изображение3 профессии

pixl создаёт небольшие пиксельные сцены 32×32 по подписям с четырьмя объектами, расположенными в заданных квадрантах.

196скачиваний за 30 дней2лайкавеса обновлены5 ноя 2026

Бенчмарки

Как модель справилась с задачами пользователей ailist и что о ней публикуют открытые лидерборды

Публичные оценки

Из открытых лидербордов. Сравнивайте результаты одного теста при одинаковых условиях — отсутствие оценки не значит, что модель хуже.

В подключённых источниках результатов для этой модели пока нет.

Что умеет модель

Описание составлено по карточке модели и метаданным Hugging Face

pixl — модель генерации пиксельной графики, разработанная ocdbytes и обученная с нуля. Она преобразует подпись в сцену размером 32×32 пикселя, предсказывая изображение по одному пикселю за раз. Модель содержит 26,7 млн параметров и использует encoder-decoder Transformer: текст обрабатывается байтовым BPE-токенизатором, а изображение представляется 1 024 токенами фиксированной палитры. Обучение проведено на одном миллионе сгенерированных сцен; веса доступны в форматах float32 и bfloat16.

Модель предназначена для создания пиксельных сцен с четырьмя объектами, расположенными по одному в каждом квадранте. Подпись должна перечислять объекты и их позиции в соответствии с шаблоном обучающих данных. На тесте модель хорошо обобщала комбинации известных объектов, но заметно хуже справлялась с новыми спрайтами. Она ограничена выученными названиями объектов и фона, сеткой 2×2, размером 32×32 и фиксированной палитрой; свободные подписи, другие раскладки и смешение стилей не проверены. Лицензия весов — CC0 1.0.

Сценарии применения

  • создание пиксельной сцены подземелья по подписи
  • генерация изображения с четырьмя объектами в сетке 2×2
  • комбинирование известных спрайтов в новых расположениях
  • создание простых пиксельных иллюстраций для прототипов игр

Ограничения

Модель рассчитана на шаблонные подписи с четырьмя объектами в сетке 2×2 и знает только обученные названия объектов и фонов. Генерация новых спрайтов, смешение стилей и свободные раскладки не подтверждены; качество выборок оценивалось визуально, без автоматической проверки их расположения.

Для каких профессий подходит3

Разделы каталога профессий, в задачах которых используется эта модель

Все профессии

Карточка модели

README от автора на Hugging Face, как он его опубликовал

Открыть на Hugging Face

Pixl: 16 scenes drawn by the model

16 scenes drawn by pixl from their captions, in one batch: seed 0, temperature 0.7, top-k 32, guidance 3.

pixl

🙏 Thanks to @harshitruwali for the GPU compute used to train pixl.

pixl draws a 32×32 pixel-art scene from a caption, one pixel at a time. It is a 26.7M-parameter encoder-decoder Transformer trained from scratch on one million generated scenes. Each scene has four sprites, one in each quadrant, and a caption that says which sprite goes where:

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

Code, training and the Docker image are at github.com/ocdbytes/PIXL.

Files

FileContents
model.safetensorsThe weights in float32 (106.8 MB)
model-bf16.safetensorsThe same weights in bf16 (53.4 MB)
config.jsonThe model's shape, for pixl.model.Config
tokenizer.json, palette.jsonThe caption tokenizer and colour palette the model was trained with; the pixl package bundles the same files

Model

PartDetails
Caption tokensByte-level BPE with 1,024 tokens (3 special, 256 bytes, 765 merges), left-padded into a 96-token slot between <bos> and <eos>
Image tokens1,024 palette tokens per image in row-major order: 0 is transparent, 1–255 are the colours of a fixed palette
Encoder4 bidirectional pre-norm Transformer blocks over the caption slot, padding included, with learned token and slot embeddings
Decoder8 causal pre-norm blocks over a learned start token and the pixels. Each has self-attention, cross-attention to the encoder's output, and a GELU MLP. Pixels have learned token, row and column embeddings
Width384, with 6 heads of 64 and an MLP of 1,536
OutputA distribution over the 256 palette tokens for each pixel
Parameters26.7M
GenerationKey-value cache, temperature, top-k, and classifier-free guidance (Ho & Salimans, 2022), which works because 10 % of training captions were left empty

Training data

The scenes config of ocdbytes/pixl-data, CC0 1.0:

  • Train: 1,000,000 scenes.
    • Each scene uses one sprite style: a background tile repeated in every 16 px slot, and four coloured objects with different labels, one centred in each quadrant.
    • The caption names each object's quadrant, in random order, then the ground.
  • Sprites: 2,240 object labels and 40 background tiles from 10 sprite styles:
    • Kenney's Tiny Town, Tiny Dungeon, Tiny Farm, Tiny Battle, Pixel Shmup, Pixel Vehicle Pack and 1-Bit Pack (coloured).
    • ansimuz's Sunny Land and GrafxKid's Mini Pixel Pack 3.
    • The Dungeon Crawl Stone Soup 32×32 tiles, halved to 16 px.
  • Test: 2,000 scenes, never trained on:
    • 1,000 new sprites scenes built from held-out sprite images.
    • 1,000 new pair scenes built from train sprites, each with at least one pair of labels that never appears together in a train scene. 5 % of label pairs are held out this way.

Training

python -m pixl.train --run scenes-four-margin-2ep --epochs 2
SettingValue
Steps62,500 batches of 32 scenes: two passes over the train scenes
OptimizerAdamW, betas (0.9, 0.95), weight decay 0.1 on matrices and embeddings
Learning rateLinear warm-up to 3e-4 over 1,000 steps, then cosine decay to 3e-5
Gradient clipping1.0
Precisionbf16 autocast, with TF32 matrix multiplies
Caption dropout10 %, for guidance
LossPixel cross-entropy, plus a hinge (--margin 2): each caption's loss must be at least 2 nats per scene below the loss of the same caption with two random objects' quadrants exchanged
HardwareOne 24 GB NVIDIA GPU, about 5 hours at 0.28–0.29 s per step
Seed0

The margin is what taught positions. Without it, the model learned which objects to draw from the caption but ignored where they go.

Evaluation

These scores are from after the last step, over every evaluation scene:

  • Loss: mean cross-entropy per pixel, in nats.
  • Position: the share of scenes whose loss is lower under their caption than under the same caption with its first two objects' quadrants exchanged. Chance is 0.5.
ScenesLossPosition
Train (500, seen in training)0.0061.00
New pair (1,000)0.0051.00
New sprites (1,000)1.7060.86

The published files give the same results. They were scored again on the CPU in float32, on every test scene; the bf16 copy is loaded into float32 parameters:

FileNew pair lossNew pair positionNew sprites lossNew sprites position
model.safetensors0.00531.0001.70600.858
model-bf16.safetensors0.00531.0001.70540.859

New-pair position for the same data and settings:

RunNew-pair position
Pixel loss only, 1 pass0.50
With the margin, 1 pass0.80
With the margin, 2 passes1.00

Limitations

  • Vocabulary: the model knows only the object labels and ground names it was trained on. Other words still tokenize, into pieces, but mean nothing to it.
  • Layout: always four objects in a 2×2 grid, in the training caption template. One or two objects, other positions and free-form text are outside what it learned.
  • Styles: each training scene takes all its objects from one sprite style. Captions that mix styles are untested.
  • New shapes: it draws sprites it has seen. On held-out sprite images the loss is 1.7 nats per pixel, against 0.005 for known sprites. Those held-out sprites can share labels with train sprites.
  • What was measured: position compares captions against real scenes; it does not check where generated sprites land. Generated samples have only been judged by eye.
  • Size: 32×32 pixels and a fixed palette of 255 colours.

Use

Install the pixl package, which brings the model code, tokenizer and palette:

pip install git+https://github.com/ocdbytes/PIXL

load_pretrained() downloads the weights from this repo and checks that its tokenizer and palette match the package's. The training preview uses temperature 0.7, top-k 32 and guidance 3; torch.manual_seed() makes samples repeatable.

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()  # load_pretrained(bf16=True) downloads the half-size copy
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")

Licence

  • Code: BSD 3-Clause.
  • Training data: CC0 1.0.
  • Weights: CC0 1.0.

Как запустить

На своей GPU в ailist. Цена — по текущим предложениям провайдеров

GPU в ailist

Универсальный рантайм

Нельзя запустить

Не удалось определить, чем загружать веса модели (нет library_name и architectures).

Ревизия весов
c4414a8

0 моделей