Instructions to use azyg0s/Krea-2-pixelart-lora with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Diffusers
How to use azyg0s/Krea-2-pixelart-lora with Diffusers:
pip install -U diffusers transformers accelerate
import torch from diffusers import DiffusionPipeline # switch to "mps" for apple devices pipe = DiffusionPipeline.from_pretrained("krea/Krea-2-Turbo", dtype=torch.bfloat16, device_map="cuda") pipe.load_lora_weights("azyg0s/Krea-2-pixelart-lora") prompt = "Astronaut in a jungle, cold color palette, muted colors, detailed, 8k" image = pipe(prompt).images[0] - Inference
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- Draw Things
- DiffusionBee
pip install -U diffusers transformers accelerate
import torch
from diffusers import DiffusionPipeline
# switch to "mps" for apple devices
pipe = DiffusionPipeline.from_pretrained("krea/Krea-2-Turbo", dtype=torch.bfloat16, device_map="cuda")
pipe.load_lora_weights("azyg0s/Krea-2-pixelart-lora")
prompt = "Astronaut in a jungle, cold color palette, muted colors, detailed, 8k"
image = pipe(prompt).images[0]You need to agree to share your Hugging Face information to access this model
This repository is publicly accessible, but you have to accept the conditions to access its files and content.
This LoRA is a Derivative of the Krea 2 Model. By downloading it you agree to be bound by the Krea 2 Community License Agreement and the Krea Acceptable Use Policy, including the revenue threshold for commercial use and the content-filtering requirement for deployments.
Log in or Sign Up to review the conditions and access this model content.
Krea 2 Pixel-art LoRA
A rank-32 LoRA for Krea 2 that draws 32ร32 pixel-art game icons. Each 512ร512 render is an exact 32ร32 grid of 16 px blocks on flat magenta (#FF00FF). Taking each block's centre pixel and keying out the magenta gives a clean 32ร32 RGBA sprite.
It rendered the 121,394 lora sprites in azyg0s/pixelart-172k.
64 sprites from Krea 2 Turbo + this LoRA, 4 steps, after extraction (checkerboard = transparent).
Usage
You need access to the gated krea/Krea-2-Turbo repo and a GPU (an A100 renders about 3,500 sprites an hour at batch 16).
pip install diffusers transformers accelerate safetensors pillow numpy
python generate.py "haunted scarecrow hat" "marble cranberry bowl" --out sprites
or directly in diffusers:
import torch
from diffusers import Krea2Pipeline
pipe = Krea2Pipeline.from_pretrained("krea/Krea-2-Turbo", torch_dtype=torch.bfloat16).to("cuda")
pipe.load_lora_weights("azyg0s/Krea-2-pixelart-lora", weight_name="pytorch_lora_weights.safetensors")
img = pipe("pixel art 32x32 game icon, haunted scarecrow hat, dark outline, plain magenta background",
num_inference_steps=4, guidance_scale=0.0, height=512, width=512).images[0]
- Prompt template:
pixel art 32x32 game icon, <subject>, dark outline, plain magenta background. - Settings: 512ร512, 4 steps, guidance 0. Smaller renders break the shapes.
- Extraction (in
generate.py): sprite pixel = block centreimg[8::16, 8::16]; pixels within 90 of magenta become transparent. Reject renders with grid purity < 0.9 (share of pixels within 24 of their block centre). - About a third of sprites keep 1โ2 dark-magenta pixels on outline corners. Strip them if you need clean edges.
Training
Trained with the diffusers train_dreambooth_lora_krea2 script on Krea 2 Raw. The training set was 1,500 of
our own 32ร32 house-style sprites, upscaled ร16 onto magenta and captioned with the template above. Rank 32,
alpha 32, lr 2e-4 (constant, 100 warmup), batch 2, 1,500 steps, 8-bit AdamW, bf16, 512 px. It is used with
Krea 2 Turbo at inference.
License
This LoRA is a Derivative of the Krea 2 Model and is distributed under the Krea 2 Community License Agreement (LICENSE.pdf); see NOTICE. Recipients are bound by that agreement and the Krea Acceptable Use Policy. Among other things:
- commercial use is allowed only below $1M annual company-wide revenue; above that you need an enterprise licence from Krea;
- deployments must use reasonable content filters;
- any model you distribute that contains this LoRA must start its name with "Krea".
This is not an official Krea product and is not endorsed by Krea.
- Downloads last month
- 16
# Gated model: Login with a HF token with gated access permission hf auth login