Text-to-Image
Diffusers
English
lora
pixel-art
sprites
game-assets
16x16
krea-2

Krea 2 PixelArt 16x16

A LoRA for Krea 2 that draws 16x16 pixel-art game icons: one item per image, dark outline, flat shading, on a flat magenta (#FF00FF) background that comes off with a simple colour key, including the holes inside handles, rings and loops.

examples

Uncurated outputs, background removed by colour key. Objects absent from the training set (snowman, anchor, chess knight, sushi, ice cream cone, space helmet, teapot) come out as well as the trained ones.

How to use

Trained on Krea 2 Raw, used on Krea 2 Turbo: 512x512, 8 steps (6 also works), guidance 0. Prompt template:

pixel art 16x16 game icon, <your object and details>, dark outline, plain magenta background

The render is a 16x16 grid of 32x32 blocks. Take one pixel from the centre of each block, then make magenta transparent:

import numpy as np
import torch
from diffusers import Krea2Pipeline
from PIL import Image

pipe = Krea2Pipeline.from_pretrained("krea/Krea-2-Turbo", torch_dtype=torch.bfloat16).to("cuda")
pipe.load_lora_weights("Angais/Krea-2-PixelArt-16x16", weight_name="krea-2-pixelart-16x16.safetensors")

prompt = "pixel art 16x16 game icon, rusty iron key with a red ribbon, dark outline, plain magenta background"
img = pipe(prompt, num_inference_steps=8, guidance_scale=0.0, height=512, width=512).images[0]

rgb = np.asarray(img.convert("RGB"))[16::32, 16::32]                   # 16x16, one pixel per block
alpha = np.where(np.abs(rgb.astype(int) - [255, 0, 255]).max(-1) <= 90, 0, 255).astype(np.uint8)
Image.fromarray(np.dstack([rgb, alpha]), "RGBA").save("icon.png")       # exact 16x16 sprite, transparent background

Upscale with nearest-neighbour (for example x8) to view it.

Results

Measured on 80 uncurated renders (64 varied prompts plus 16 test objects, 7 of them absent from the training set):

backgrounds removed cleanly by colour key 79 / 80
background colour, median distance from #FF00FF 5 / 255
renders with see-through holes (handles, rings) 13 / 80
grid purity (share of each 32x32 block that is one colour), median 0.989

raw renders

Raw 512x512 renders before the 16x16 conversion.

Training

  • Data: 550 synthetic 16x16 icons (CC0), each upscaled x32 onto flat magenta, captioned with the prompt that made it.
  • Setup: ai-toolkit, Krea 2 Raw in bf16, LoRA rank 32 / alpha 32, 512x512, batch 2, AdamW 8-bit, lr 1e-4, flow-matching loss, 1,000 steps (about 14 minutes on one H100).

Limitations

  • 16x16 icons only: one object, centred, no scenes or characters in poses.
  • Avoid asking for pure magenta objects: magenta is reserved for the background.
  • Colours sometimes come out darker than asked (an "emerald green sheep" may turn out dark green).
  • Outputs are AI-generated. Where law or platform policy requires it, disclose that when you publish them.

License

This LoRA is a Derivative of Krea 2 and is distributed under the Krea 2 Community License Agreement. See NOTICE. Commercial use is allowed only for companies under US$1M annual revenue; read the agreement and the Krea Acceptable Use Policy before use.

Krea 2 PixelArt 16x16 is not an official Krea product and is not endorsed by Krea.

An Apache-2.0 MOSS-Image version of this LoRA, trained on the same data, is also available.

Downloads last month
112
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for Angais/Krea-2-PixelArt-16x16

Base model

krea/Krea-2-Raw
Adapter
(1024)
this model

Dataset used to train Angais/Krea-2-PixelArt-16x16