Limbicnation commited on
Commit
355bc5a
·
verified ·
1 Parent(s): c162e9f

docs: add comprehensive model card with training details, usage instructions, and provenance info

Browse files
Files changed (1) hide show
  1. README.md +173 -36
README.md CHANGED
@@ -1,52 +1,189 @@
1
- # Pixel Art LoRA Test Samples
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2
 
3
- **Generated:** 2026-02-08 01:20 UTC
 
 
4
 
5
- **Model:** [Limbicnation/pixel-art-lora](https://huggingface.co/Limbicnation/pixel-art-lora)
 
 
 
 
 
 
 
6
 
7
- **Base Model:** [black-forest-labs/FLUX.2-klein-4B](https://huggingface.co/black-forest-labs/FLUX.2-klein-4B)
 
 
 
 
 
 
8
 
9
- **Samples Location:** `samples/` folder in this repository
 
10
 
11
- ## Generation Parameters
12
 
13
- - **Steps:** 4
14
- - **CFG Scale:** 1.0
15
- - **Seed:** 42
16
- - **Resolution:** 512x512
17
- - **Device:** cuda
 
 
 
 
 
 
 
18
 
19
  ## Sample Gallery
20
 
21
- | # | Preview | Prompt |
22
- |---|---------|--------|
23
- | 1 | ![Sample 1](./samples/01_a_brave_knight_in_shining_armor_holding_.png) | pixel art sprite, a brave knight in shining armor holding a ... |
24
- | 2 | ❌ Failed | pixel art sprite, a mystical wizard with a long beard and gl... |
25
- | 3 | ![Sample 3](./samples/03_an_elven_archer_with_bow_and_quiver_wear.png) | pixel art sprite, an elven archer with bow and quiver, weari... |
26
- | 4 | ![Sample 4](./samples/04_a_fierce_orc_warrior_with_battle_axe_and.png) | pixel art sprite, a fierce orc warrior with battle axe and a... |
27
- | 5 | ![Sample 5](./samples/05_a_dwarf_paladin_with_war_hammer_and_heav.png) | pixel art sprite, a dwarf paladin with war hammer and heavy ... |
28
- | 6 | ![Sample 6](./samples/06_a_fire-breathing_dragon_with_red_scales_.png) | pixel art sprite, a fire-breathing dragon with red scales an... |
29
- | 7 | ![Sample 7](./samples/07_a_cute_slime_monster_blue_and_bouncy.png) | pixel art sprite, a cute slime monster, blue and bouncy, gam... |
30
- | 8 | ![Sample 8](./samples/08_a_skeletal_warrior_with_rusty_sword_unde.png) | pixel art sprite, a skeletal warrior with rusty sword, undea... |
31
- | 9 | ![Sample 9](./samples/09_a_majestic_unicorn_with_rainbow_mane.png) | pixel art sprite, a majestic unicorn with rainbow mane, game... |
32
- | 10 | ![Sample 10](./samples/10_a_dark_vampire_lord_with_cape_and_fangs.png) | pixel art sprite, a dark vampire lord with cape and fangs, g... |
33
- | 11 | ![Sample 11](./samples/11_a_space_marine_in_power_armor_with_laser.png) | pixel art sprite, a space marine in power armor with laser r... |
34
- | 12 | ![Sample 12](./samples/12_a_cyberpunk_hacker_with_neon_implants_an.png) | pixel art sprite, a cyberpunk hacker with neon implants and ... |
35
- | 13 | ![Sample 13](./samples/13_a_cute_robot_companion_with_glowing_eyes.png) | pixel art sprite, a cute robot companion with glowing eyes, ... |
36
- | 14 | ![Sample 14](./samples/14_a_zombie_survivor_with_baseball_bat_and_.png) | pixel art sprite, a zombie survivor with baseball bat and ba... |
37
- | 15 | ![Sample 15](./samples/15_a_ninja_assassin_in_black_outfit_with_ka.png) | pixel art sprite, a ninja assassin in black outfit with kata... |
38
 
 
39
 
40
- ## Summary
41
 
42
- - **Total:** 15
43
- - **Success:** 14 ✅
44
- - **Failed:** 1
 
 
 
 
 
 
 
 
 
 
 
 
45
 
46
- ## Trigger Words
47
 
48
- For best results, always include: `pixel art sprite, game asset, transparent background`
49
 
50
- ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
51
 
52
- *Generated with Hugging Face Diffusers & FLUX.2-klein-4B*
 
 
 
 
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
+ | ![Knight](./samples/01_a_brave_knight_in_shining_armor_holding_.png) | pixel art sprite, a brave knight in shining armor holding a sword |
111
+ | ![Archer](./samples/03_an_elven_archer_with_bow_and_quiver_wear.png) | pixel art sprite, an elven archer with bow and quiver |
112
+ | ![Orc](./samples/04_a_fierce_orc_warrior_with_battle_axe_and.png) | pixel art sprite, a fierce orc warrior with battle axe |
113
+ | ![Dragon](./samples/06_a_fire-breathing_dragon_with_red_scales_.png) | pixel art sprite, a fire-breathing dragon with red scales |
114
+ | ![Slime](./samples/07_a_cute_slime_monster_blue_and_bouncy.png) | pixel art sprite, a cute slime monster, blue and bouncy |
115
+ | ![Skeleton](./samples/08_a_skeletal_warrior_with_rusty_sword_unde.png) | pixel art sprite, a skeletal warrior with rusty sword |
116
+ | ![Unicorn](./samples/09_a_majestic_unicorn_with_rainbow_mane.png) | pixel art sprite, a majestic unicorn with rainbow mane |
117
+ | ![Vampire](./samples/10_a_dark_vampire_lord_with_cape_and_fangs.png) | pixel art sprite, a dark vampire lord with cape and fangs |
118
+ | ![Marine](./samples/11_a_space_marine_in_power_armor_with_laser.png) | pixel art sprite, a space marine in power armor |
119
+ | ![Cyberpunk](./samples/12_a_cyberpunk_hacker_with_neon_implants_an.png) | pixel art sprite, a cyberpunk hacker with neon implants |
120
+ | ![Robot](./samples/13_a_cute_robot_companion_with_glowing_eyes.png) | pixel art sprite, a cute robot companion with glowing eyes |
121
+ | ![Ninja](./samples/15_a_ninja_assassin_in_black_outfit_with_ka.png) | 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)