docs: add comprehensive model card with training details, usage instructions, and provenance info
Browse files
README.md
CHANGED
|
@@ -1,52 +1,189 @@
|
|
| 1 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2 |
|
| 3 |
-
|
|
|
|
|
|
|
| 4 |
|
| 5 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 6 |
|
| 7 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 8 |
|
| 9 |
-
|
|
|
|
| 10 |
|
| 11 |
-
##
|
| 12 |
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
-
|
| 16 |
-
|
| 17 |
-
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 18 |
|
| 19 |
## Sample Gallery
|
| 20 |
|
| 21 |
-
|
|
| 22 |
-
|---
|
| 23 |
-
|
|
| 24 |
-
|
|
| 25 |
-
|
|
| 26 |
-
|
|
| 27 |
-
|
|
| 28 |
-
|
|
| 29 |
-
|
|
| 30 |
-
|
|
| 31 |
-
|
|
| 32 |
-
|
|
| 33 |
-
|
|
| 34 |
-
|
|
| 35 |
-
| 13 |  | pixel art sprite, a cute robot companion with glowing eyes, ... |
|
| 36 |
-
| 14 |  | pixel art sprite, a zombie survivor with baseball bat and ba... |
|
| 37 |
-
| 15 |  | pixel art sprite, a ninja assassin in black outfit with kata... |
|
| 38 |
|
|
|
|
| 39 |
|
| 40 |
-
##
|
| 41 |
|
| 42 |
-
|
| 43 |
-
-
|
| 44 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 45 |
|
| 46 |
-
|
| 47 |
|
| 48 |
-
|
| 49 |
|
| 50 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 51 |
|
| 52 |
-
*
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
language:
|
| 3 |
+
- en
|
| 4 |
+
license: apache-2.0
|
| 5 |
+
library_name: diffusers
|
| 6 |
+
tags:
|
| 7 |
+
- lora
|
| 8 |
+
- flux
|
| 9 |
+
- pixel-art
|
| 10 |
+
- game-asset
|
| 11 |
+
- sprite
|
| 12 |
+
- character-design
|
| 13 |
+
- text-to-image
|
| 14 |
+
- FLUX.2-klein-4B
|
| 15 |
+
base_model: black-forest-labs/FLUX.2-klein-4B
|
| 16 |
+
datasets:
|
| 17 |
+
- Limbicnation/pixel-art-character
|
| 18 |
+
pipeline_tag: text-to-image
|
| 19 |
+
widget:
|
| 20 |
+
- text: "pixel art sprite, a brave knight in shining armor holding a sword, game asset, transparent background"
|
| 21 |
+
output:
|
| 22 |
+
url: samples/01_a_brave_knight_in_shining_armor_holding_.png
|
| 23 |
+
- text: "pixel art sprite, a fire-breathing dragon with red scales, game asset, transparent background"
|
| 24 |
+
output:
|
| 25 |
+
url: samples/06_a_fire-breathing_dragon_with_red_scales_.png
|
| 26 |
+
- text: "pixel art sprite, a cute slime monster, blue and bouncy, game asset, transparent background"
|
| 27 |
+
output:
|
| 28 |
+
url: samples/07_a_cute_slime_monster_blue_and_bouncy.png
|
| 29 |
+
---
|
| 30 |
+
|
| 31 |
+
# Pixel Art Sprite LoRA for FLUX.2-klein-4B
|
| 32 |
+
|
| 33 |
+
A LoRA adapter trained on FLUX.2-klein-4B for generating pixel art character sprites. Optimized for game-ready assets with transparent backgrounds.
|
| 34 |
+
|
| 35 |
+
## Highlights
|
| 36 |
+
|
| 37 |
+
- **4-step inference** — FLUX.2-klein is distilled, so generation is fast
|
| 38 |
+
- **512x512 RGBA** output with transparent backgrounds
|
| 39 |
+
- **CC0 training data** — 100% public domain, no copyright concerns
|
| 40 |
+
- **Game-ready** — designed for Godot, Unity, and other engines
|
| 41 |
+
|
| 42 |
+
## Quick Start
|
| 43 |
+
|
| 44 |
+
### Trigger Words
|
| 45 |
+
|
| 46 |
+
Always include in your prompt:
|
| 47 |
+
|
| 48 |
+
```
|
| 49 |
+
pixel art sprite, [your character description], game asset, transparent background
|
| 50 |
+
```
|
| 51 |
+
|
| 52 |
+
**Style modifiers:** `16-bit pixel art`, `32-bit pixel art`, `chibi`
|
| 53 |
+
|
| 54 |
+
### Inference Parameters
|
| 55 |
+
|
| 56 |
+
| Parameter | Value |
|
| 57 |
+
|-----------|-------|
|
| 58 |
+
| Steps | 4 |
|
| 59 |
+
| CFG Scale | 1.0 |
|
| 60 |
+
| Resolution | 512x512 |
|
| 61 |
+
| Sampler | Euler |
|
| 62 |
+
|
| 63 |
+
### Python (Diffusers)
|
| 64 |
+
|
| 65 |
+
> Requires `diffusers >= 0.37.0.dev0` (install from git main)
|
| 66 |
|
| 67 |
+
```python
|
| 68 |
+
import torch
|
| 69 |
+
from diffusers import Flux2KleinPipeline
|
| 70 |
|
| 71 |
+
# Load base model + LoRA
|
| 72 |
+
pipe = Flux2KleinPipeline.from_pretrained(
|
| 73 |
+
"black-forest-labs/FLUX.2-klein-4B",
|
| 74 |
+
torch_dtype=torch.bfloat16,
|
| 75 |
+
low_cpu_mem_usage=False,
|
| 76 |
+
)
|
| 77 |
+
pipe.load_lora_weights("Limbicnation/pixel-art-lora")
|
| 78 |
+
pipe.to("cuda")
|
| 79 |
|
| 80 |
+
image = pipe(
|
| 81 |
+
"pixel art sprite, a brave knight in shining armor, game asset, transparent background",
|
| 82 |
+
num_inference_steps=4,
|
| 83 |
+
guidance_scale=1.0,
|
| 84 |
+
height=512,
|
| 85 |
+
width=512,
|
| 86 |
+
).images[0]
|
| 87 |
|
| 88 |
+
image.save("knight.png")
|
| 89 |
+
```
|
| 90 |
|
| 91 |
+
### ComfyUI
|
| 92 |
|
| 93 |
+
1. Download the LoRA weights:
|
| 94 |
+
```bash
|
| 95 |
+
huggingface-cli download Limbicnation/pixel-art-lora \
|
| 96 |
+
pytorch_lora_weights.safetensors \
|
| 97 |
+
--local-dir ./models/loras/
|
| 98 |
+
```
|
| 99 |
+
2. Load FLUX.2-klein-4B as the base checkpoint
|
| 100 |
+
3. Add a **Load LoRA** node, point to `pytorch_lora_weights.safetensors`
|
| 101 |
+
4. Set LoRA strength: **0.85 - 1.4** (tested range)
|
| 102 |
+
5. Use trigger words in your positive prompt
|
| 103 |
+
|
| 104 |
+
A sample workflow is included: [`comfyui_workflow.json`](./comfyui_workflow.json)
|
| 105 |
|
| 106 |
## Sample Gallery
|
| 107 |
|
| 108 |
+
| Preview | Prompt |
|
| 109 |
+
|---------|--------|
|
| 110 |
+
|  | pixel art sprite, a brave knight in shining armor holding a sword |
|
| 111 |
+
|  | pixel art sprite, an elven archer with bow and quiver |
|
| 112 |
+
|  | pixel art sprite, a fierce orc warrior with battle axe |
|
| 113 |
+
|  | pixel art sprite, a fire-breathing dragon with red scales |
|
| 114 |
+
|  | pixel art sprite, a cute slime monster, blue and bouncy |
|
| 115 |
+
|  | pixel art sprite, a skeletal warrior with rusty sword |
|
| 116 |
+
|  | pixel art sprite, a majestic unicorn with rainbow mane |
|
| 117 |
+
|  | pixel art sprite, a dark vampire lord with cape and fangs |
|
| 118 |
+
|  | pixel art sprite, a space marine in power armor |
|
| 119 |
+
|  | pixel art sprite, a cyberpunk hacker with neon implants |
|
| 120 |
+
|  | pixel art sprite, a cute robot companion with glowing eyes |
|
| 121 |
+
|  | pixel art sprite, a ninja assassin in black outfit with katana |
|
|
|
|
|
|
|
|
|
|
| 122 |
|
| 123 |
+
**14/15 samples generated successfully** (1 failed due to content filter)
|
| 124 |
|
| 125 |
+
## Training Details
|
| 126 |
|
| 127 |
+
| Parameter | Value |
|
| 128 |
+
|-----------|-------|
|
| 129 |
+
| Base model | `black-forest-labs/FLUX.2-klein-4B` |
|
| 130 |
+
| LoRA rank | 64 |
|
| 131 |
+
| LoRA alpha | 128 |
|
| 132 |
+
| rsLoRA | Yes |
|
| 133 |
+
| Dtype | bfloat16 |
|
| 134 |
+
| Steps | 1000 |
|
| 135 |
+
| Batch size | 1 |
|
| 136 |
+
| Gradient accumulation | 4 |
|
| 137 |
+
| Learning rate | 1e-4 |
|
| 138 |
+
| LR scheduler | Cosine with restarts |
|
| 139 |
+
| Optimizer | AdamW 8-bit |
|
| 140 |
+
| Resolution | 512x512 |
|
| 141 |
+
| Dataset | 500 images (CC0 curated + synthetic) |
|
| 142 |
|
| 143 |
+
**Final loss:** ~1.8 - 2.0 (stable convergence)
|
| 144 |
|
| 145 |
+
Full training config: [`config.yaml`](./config.yaml)
|
| 146 |
|
| 147 |
+
## Dataset & Provenance
|
| 148 |
+
|
| 149 |
+
- **Training dataset:** [Limbicnation/pixel-art-character](https://huggingface.co/datasets/Limbicnation/pixel-art-character) (1,010 images)
|
| 150 |
+
- **License:** All training images are CC0 (public domain) — no copyright restrictions
|
| 151 |
+
- **Provenance:** Full manifest with source attribution available in the dataset repo
|
| 152 |
+
- **Legal analysis:** Synthetic training data compliant for commercial use
|
| 153 |
+
|
| 154 |
+
This model was trained with full data provenance tracking. All source images are CC0 public domain, making the outputs safe for commercial game development, Steam releases, and B2B studio use.
|
| 155 |
+
|
| 156 |
+
## Architecture Notes
|
| 157 |
+
|
| 158 |
+
FLUX.2-klein-4B uses a different architecture from FLUX.1:
|
| 159 |
+
|
| 160 |
+
- **Text encoder:** Qwen3 (not CLIP+T5)
|
| 161 |
+
- **Pipeline class:** `Flux2KleinPipeline` (not `FluxPipeline`)
|
| 162 |
+
- **VAE:** `AutoencoderKLFlux2`
|
| 163 |
+
- **Distilled:** 4-step inference with guidance scale 1.0
|
| 164 |
+
|
| 165 |
+
> You must use `diffusers >= 0.37.0.dev0` (install from git main branch). The released 0.36.x does not include `Flux2KleinPipeline`.
|
| 166 |
+
|
| 167 |
+
## License
|
| 168 |
+
|
| 169 |
+
This LoRA adapter is released under [Apache 2.0](./LICENSE).
|
| 170 |
+
|
| 171 |
+
The base model (FLUX.2-klein-4B) is also Apache 2.0 licensed.
|
| 172 |
+
|
| 173 |
+
## Citation
|
| 174 |
+
|
| 175 |
+
```bibtex
|
| 176 |
+
@misc{pixel-art-lora-2026,
|
| 177 |
+
title={Pixel Art Sprite LoRA for FLUX.2-klein-4B},
|
| 178 |
+
author={Limbicnation},
|
| 179 |
+
year={2026},
|
| 180 |
+
url={https://huggingface.co/Limbicnation/pixel-art-lora}
|
| 181 |
+
}
|
| 182 |
+
```
|
| 183 |
+
|
| 184 |
+
## Links
|
| 185 |
|
| 186 |
+
- **Model:** [Limbicnation/pixel-art-lora](https://huggingface.co/Limbicnation/pixel-art-lora)
|
| 187 |
+
- **Dataset:** [Limbicnation/pixel-art-character](https://huggingface.co/datasets/Limbicnation/pixel-art-character)
|
| 188 |
+
- **Base model:** [black-forest-labs/FLUX.2-klein-4B](https://huggingface.co/black-forest-labs/FLUX.2-klein-4B)
|
| 189 |
+
- **Training code:** [Limbicnation/SpriteForge](https://github.com/Limbicnation/SpriteForge)
|