fix(agent): call _format_base_models via self. to prevent NameError

The bare call  inside _build_prompt_context
would raise NameError because class methods don't close over class-level
scope. Use  instead to trigger attribute lookup.

Update enrich_hf_metadata prompt.md clue locations for better LLM accuracy.
Update baseline report to v2 (mean 69.0, 46 models, +2.2pp vs baseline 71.1%).
Consolidate README snapshots into baselines/readmes/.
This commit is contained in:
Will Miao
2026-07-06 00:10:30 +08:00
parent 13ed898b6b
commit d0e8938039
6 changed files with 1120 additions and 860 deletions

View File

@@ -0,0 +1,155 @@
---
language:
- en
license: apache-2.0
library_name: diffusers
tags:
- lora
- flux
- pixel-art
- game-asset
- sprite
- character-design
- text-to-image
- FLUX.2-klein-4B
base_model: black-forest-labs/FLUX.2-klein-4B
datasets:
- Limbicnation/pixel-art-character
pipeline_tag: text-to-image
widget:
- text: "pixel art sprite, a brave knight in shining armor holding a sword, game asset, transparent background"
output:
url: samples/01_a_brave_knight_in_shining_armor_holding_.png
- text: "pixel art sprite, a fire-breathing dragon with red scales, game asset, transparent background"
output:
url: samples/06_a_fire-breathing_dragon_with_red_scales_.png
- text: "pixel art sprite, a cute slime monster, blue and bouncy, game asset, transparent background"
output:
url: samples/07_a_cute_slime_monster_blue_and_bouncy.png
---
# Pixel Art Sprite LoRA for FLUX.2-klein-4B
A LoRA adapter trained on FLUX.2-klein-4B for generating pixel art character sprites. Optimized for game-ready assets with transparent backgrounds.
## Highlights
- **4-step inference** — FLUX.2-klein is distilled, so generation is fast
- **512x512 RGBA** output with transparent backgrounds
- **CC0 training data** — 100% public domain, no copyright concerns
- **Game-ready** — designed for Godot, Unity, and other engines
## Quick Start
### Trigger Words
Always include in your prompt:
```
pixel art sprite, [your character description], game asset, transparent background
```
**Style modifiers:** `16-bit pixel art`, `32-bit pixel art`, `chibi`
### Inference Parameters
| Parameter | Value |
|-----------|-------|
| Steps | 4 |
| CFG Scale | 1.0 |
| Resolution | 512x512 |
| Sampler | Euler |
### Python (Diffusers)
> Requires `diffusers >= 0.37.0.dev0` (install from git main)
```python
import torch
from diffusers import Flux2KleinPipeline
# Load base model + LoRA
pipe = Flux2KleinPipeline.from_pretrained(
"black-forest-labs/FLUX.2-klein-4B",
torch_dtype=torch.bfloat16,
low_cpu_mem_usage=False,
)
pipe.load_lora_weights("Limbicnation/pixel-art-lora")
pipe.to("cuda")
image = pipe(
"pixel art sprite, a brave knight in shining armor, game asset, transparent background",
num_inference_steps=4,
guidance_scale=1.0,
height=512,
width=512,
).images[0]
image.save("knight.png")
```
### ComfyUI
1. Download the LoRA weights:
```bash
huggingface-cli download Limbicnation/pixel-art-lora \
pytorch_lora_weights.safetensors \
--local-dir ./models/loras/
```
2. Load FLUX.2-klein-4B as the base checkpoint
3. Add a **Load LoRA** node, point to `pytorch_lora_weights.safetensors`
4. Set LoRA strength: **0.85 - 1.4** (tested range)
5. Use trigger words in your positive prompt
A sample workflow is included: [`comfyui_workflow.json`](./comfyui_workflow.json)
## Training Details
| Parameter | Value |
|-----------|-------|
| Base model | `black-forest-labs/FLUX.2-klein-4B` |
| LoRA rank | 64 |
| LoRA alpha | 128 |
| rsLoRA | Yes |
| Dtype | bfloat16 |
| Steps | 1000 |
| Batch size | 1 |
| Gradient accumulation | 4 |
| Learning rate | 1e-4 |
| LR scheduler | Cosine with restarts |
| Optimizer | AdamW 8-bit |
| Resolution | 512x512 |
| Dataset | 500 images (CC0 curated + synthetic) |
## Architecture Notes
FLUX.2-klein-4B uses a different architecture from FLUX.1:
- **Text encoder:** Qwen3 (not CLIP+T5)
- **Pipeline class:** `Flux2KleinPipeline` (not `FluxPipeline`)
- **VAE:** `AutoencoderKLFlux2`
- **Distilled:** 4-step inference with guidance scale 1.0
## License
This LoRA adapter is released under [Apache 2.0](./LICENSE).
The base model (FLUX.2-klein-4B) is also Apache 2.0 licensed.
## Citation
```bibtex
@misc{pixel-art-lora-2026,
title={Pixel Art Sprite LoRA for FLUX.2-klein-4B},
author={Limbicnation},
year={2026},
url={https://huggingface.co/Limbicnation/pixel-art-lora}
}
```
## Links
- **Model:** [Limbicnation/pixel-art-lora](https://huggingface.co/Limbicnation/pixel-art-lora)
- **Dataset:** [Limbicnation/pixel-art-character](https://huggingface.co/datasets/Limbicnation/pixel-art-character)
- **Base model:** [black-forest-labs/FLUX.2-klein-4B](https://huggingface.co/black-forest-labs/FLUX.2-klein-4B)
- **Training code:** [Limbicnation/SpriteForge](https://github.com/Limbicnation/SpriteForge)

View File

@@ -0,0 +1,117 @@
---
tags:
- text-to-image
- lora
- diffusers
- template:diffusion-lora
- Long-Toons
- 3D
- Toon
widget:
- text: >-
Long toons, a close-up of a cartoon characters face is featured in a vibrant
red backdrop. The characters head is adorned with a gray hoodie, a red
t-shirt, and a pair of pink earbuds. His eyes, a nose, and mustache are
adorned with tiny white dots, adding a pop of color to the scene. His hair
is a mix of black and gray, while his ears are a darker shade of pink.
output:
url: images/LT4.png
- text: >-
Long toons, Super Detail, a close-up shot of a womans head and shoulders is
seen against a vibrant red backdrop. The womans face is adorned with a white
face, adorned with blue eyes, and her brown hair cascades over her
shoulders. She is wearing a red turtleneck, with a ribbed collar. Her lips
are painted a vibrant shade of red, adding a pop of color to her face. Her
eyebrows are a darker shade of blue, addinga depth to the composition.
output:
url: images/LT5.png
- text: >-
Long Toons, Cat 4K
........................................................................................................................................................................................
output:
url: images/LT6.png
- text: >-
Long toons, a close-up portrait of a soccer player is depicted. The players
uniform is a light blue and white striped jersey with the Adidas logo on the
left side of the chest. The jersey also has three stars and the letters
"AFA" on the right side. His hair is styled in a mohawk, adding a pop of
color to his face. The background is blurred, suggesting a sports field.
output:
url: images/LT1.png
- text: >-
Long toons, Captured at eye-level, a close-up shot of a black-haired doll
with dreadlocks stands in front of a blurred backdrop of a cityscape. The
dolls head is facing the viewer, and its eyes are squinted with black
eyebrows and black eyes, and the dolls mouth is slightly open, as if it is
frowning. His eyes are a piercing blue, and he is wearing a black hoodie
with a white design on the front, adding a pop of color to the scene. The
background is a mix of red and black, creating a vibrant contrast to the
doll.
output:
url: images/LT2.png
- text: >-
Long toons, Captured at eye-level on a sunny day, a mario figurine rests on
a sandy beach. The figurine, dressed in a red cap, a red shirt, and blue
overalls, is adorned with a yellow button. His hands are covered in white
gloves, adding a touch of warmth to the scene. In the distance, a body of
water can be seen, dotted with white clouds. The sky is a deep blue, with a
few wispy white clouds streaming across it.
output:
url: images/LT3.png
base_model: black-forest-labs/FLUX.1-dev
instance_prompt: Long toons
license: creativeml-openrail-m
---
# Flux-Long-Toon-LoRA
<Gallery />
**The model is still in the training phase. This is not the final version and may contain artifacts and perform poorly in some cases.**
## Model description
**prithivMLmods/Flux-Long-Toon-LoRA**
Image Processing Parameters
| Parameter | Value | Parameter | Value |
|---------------------------|--------|---------------------------|--------|
| LR Scheduler | constant | Noise Offset | 0.03 |
| Optimizer | AdamW | Multires Noise Discount | 0.1 |
| Network Dim | 64 | Multires Noise Iterations | 10 |
| Network Alpha | 32 | Repeat & Steps | 25 & 3270 |
| Epoch | 18 | Save Every N Epochs | 1 |
Labeling: florence2-en(natural language & English)
Total Images Used for Training : 15
## Best Dimensions
- 768 x 1024 (Best)
- 1024 x 1024 (Default)
## Setting Up
```python
import torch
from pipelines import DiffusionPipeline
base_model = "black-forest-labs/FLUX.1-dev"
pipe = DiffusionPipeline.from_pretrained(base_model, torch_dtype=torch.bfloat16)
lora_repo = "prithivMLmods/Flux-Long-Toon-LoRA"
trigger_word = "Long toons"
pipe.load_lora_weights(lora_repo)
device = torch.device("cuda")
pipe.to(device)
```
## Trigger words
You should use `Long toons` to trigger the image generation.
## Download model
Weights for this model are available in Safetensors format.
[Download](/prithivMLmods/Flux-Long-Toon-LoRA/tree/main) them in the Files & versions tab.

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,154 @@
# HF Metadata Enrichment Validation Report
Generated: 2026-07-06 00:01:38
Models evaluated: **46**
Successful enrichments: **46**
Failures: **0**
## Preprocessing Audit
| Metric | Value |
|--------|-------|
| Models audited | 46 |
| README fetch failed | 0 |
| Section extraction activated | 19.6% |
| Basename found in section | 43.5% |
| Has YAML frontmatter | 100.0% |
| Has YAML widget section | 25.0% |
| Avg README compression | 41.1% |
| Avg cleaned length | 1812 chars |
### Audit Flags (most frequent)
- **SECTION_EXTRACTION_NOT_ACTIVATED**: 37x
- **BASENAME_NOT_IN_EXTRACTED_SECTION**: 1x
**Interpretation:**
- ⚠️ Section extraction activated for fewer than 50% of repos. This may indicate the basename doesn't match README content, or the repos are mostly single-model (where full README is expected).
- ⚠️ The safetensors basename was NOT found in the extracted section for many repos. This could mean the section extraction matched the wrong section, or the README doesn't explicitly reference the filename.
## ⚠️ Configuration Warnings
- ✅ LLM config matches between pipeline --settings and LLMService.
## Timing
- Total wall time: **544 s**
(9.1 min)
- Mean per model: **11.8 s**
- Median per model: **10.1 s**
- Fastest: **6.3 s**
- Slowest: **74.7 s**
## Overall Score Distribution (0100)
| Metric | Value |
|--------|-------|
| Mean | 69.0 |
| Median | 70.0 |
| Min | 30 |
| Max | 90 |
- **Excellent (≥80)**: 16 models (34.8%)
- **Good (6079)**: 18 models (39.1%)
- **Fair (4059)**: 10 models (21.7%)
- **Poor (2039)**: 2 models (4.3%)
- **Bad (<20)**: 0 models (0.0%)
## Per-Field Completeness
| Field | Mean Score | Fill Rate | Empty Rate |
|-------|-----------:|----------:|-----------:|
| base_model | 11.7 | 78.3% | 21.7% |
| trigger_words | 8.8 | 58.7% | 41.3% |
| short_description | 8.7 | 87.0% | 13.0% |
| tags | 14.3 | 95.7% | 4.3% |
| tags_priority_coverage | 3.9 | 71.7% | 13.0% |
| notes | 3.8 | 76.1% | 23.9% |
| usage_tips | 0.8 | 15.2% | 84.8% |
| modelDescription_html | 9.6 | 95.7% | 4.3% |
| preview_downloaded | 7.4 | 73.9% | 26.1% |
## LLM Confidence Distribution
- **high**: 14 ██████░░░░░░░░░░░░░░ 30.4%
- **medium**: 21 █████████░░░░░░░░░░░ 45.7%
- **low**: 11 █████░░░░░░░░░░░░░░░ 23.9%
- **(not reported)**: 0 ░░░░░░░░░░░░░░░░░░░░ 0.0%
## Most Frequent Issues
- **usage_tips is empty or invalid JSON** — 39/46 (84.8%)
- **trigger_words are missing or contain only placeholders** — 19/46 (41.3%)
- **preview image not downloaded (URL missing or download failed)** — 12/46 (26.1%)
- **notes are too short or empty** — 11/46 (23.9%)
- **base_model is empty or 'Unknown'** — 7/46 (15.2%)
- **short_description is too short or empty** — 6/46 (13.0%)
- **tags have low overlap with priority_tags (< 50%)** — 4/46 (8.7%)
- **tags are missing, too few, or purely technical** — 2/46 (4.3%)
- **modelDescription is too short (README may not have been converted)** — 2/46 (4.3%)
- **base_model 'Tongyi-MAI/Z-Image-Turbo' not in SUPPORTED_BASE_MODELS** — 1/46 (2.2%)
- **base_model 'Illustrious-xl-early-release-v0' not in SUPPORTED_BASE_MODELS** — 1/46 (2.2%)
- **base_model 'Pony SDXL' not in SUPPORTED_BASE_MODELS** — 1/46 (2.2%)
## Optimisation Suggestions
- **trigger_words 空置率高 (41%)**: 大量 HF 模型卡没有明确的 `instance_prompt:` 或 trigger word 说明。当前 prompt 已覆盖常见模式。若确认这些模型确实没有 trigger words例如 style lora空数组是正确结果不需优化。
- **usage_tips 空置率极高 (85%)**: 这是预期行为。HF 模型卡通常不包含 LoRA 强度/CLIP skip 等结构化参数。当前提取策略已合理。若需要可用数据,可以考虑使用模型类型的通用默认值。
## Per-Model Detail
<details>
<summary>Click to expand</summary>
| # | Repo ID | Score | Issues | Confidence |
|---|---------|------:|--------|------------|
| 1 | k2styles/krea-2-cobalt-sky-anime-lora | 90 | ✓ ok | high |
| 2 | k2styles/krea-2-azure-gouache-daylight-lora | 87 | ✓ ok | high |
| 3 | TheDivergentAI/krea2-turbo-distill-lora | 70 | 2 issue(s) | medium |
| 4 | DeverStyle/Krea2-Loras | 65 | 2 issue(s) | medium |
| 5 | Komorebi1995/krea2-raw-jpaf-celpaint-lora | 90 | ✓ ok | medium |
| 6 | artificialguybr/pixelartredmond-1-5v-pixel-art-loras-for-sd-1-5 | 72 | 2 issue(s) | medium |
| 7 | Shakker-Labs/FLUX.1-dev-LoRA-Logo-Design | 90 | ✓ ok | high |
| 8 | glif-loradex-trainer/bingbangboom_flux_surf | 65 | 2 issue(s) | medium |
| 9 | prithivMLmods/Ton618-Epic-Realism-Flux-LoRA | 85 | 1 issue(s) | high |
| 10 | prithivMLmods/Fashion-Hut-Modeling-LoRA | 85 | 1 issue(s) | high |
| 11 | prithivMLmods/Retro-Pixel-Flux-LoRA | 80 | 2 issue(s) | medium |
| 12 | D1-3105/HiDream-E1-Full_lora | 55 | 4 issue(s) | low |
| 13 | renderartist/Classic-Painting-Z-Image-Turbo-LoRA | 70 | 2 issue(s) | medium |
| 14 | DeverStyle/Z-Image-loras | 55 | 3 issue(s) | medium |
| 15 | deadman44/Z-Image_LoRA | 55 | 4 issue(s) | low |
| 16 | zyuzuguldu/vton-lora-linen | 75 | 2 issue(s) | medium |
| 17 | svntax-dev/pixel_spritesheet_4walk_small_lora_v1 | 67 | 2 issue(s) | high |
| 18 | Haruka041/z-image-anime-lora | 55 | 4 issue(s) | low |
| 19 | systms/SYSTMS-INFL8-LoRA-Wan22 | 85 | 1 issue(s) | medium |
| 20 | crafiq/flux-2-klein-9b-360-panorama-lora | 85 | 1 issue(s) | medium |
| 21 | Leon1000/pixel_spritesheet_4walk_small_lora_v1 | 67 | 2 issue(s) | high |
| 22 | Muapi/pov-missionary-legs-together-lora | 70 | 2 issue(s) | medium |
| 23 | ostris/ideogram_4_unconditional_lora | 60 | 3 issue(s) | medium |
| 24 | ilkerzgi/krea-2-bleached-surreal-uncanny-lora | 85 | 1 issue(s) | high |
| 25 | ilkerzgi/krea-2-azure-surreal-collage-lora | 88 | ✓ ok | high |
| 26 | ilkerzgi/krea-2-airy-gouache-minimalist-lora | 82 | 1 issue(s) | high |
| 27 | k2styles/krea-2-airy-watercolor-chibi-lora | 90 | ✓ ok | high |
| 28 | TakeAswing/sdxl-lora-lofi | 50 | 5 issue(s) | medium |
| 29 | heville/anna-lora-krea2 | 85 | 1 issue(s) | high |
| 30 | Brioch/krea2_loras | 35 | 6 issue(s) | low |
| 31 | hr16/Miwano-Rag-LoRA | 75 | 2 issue(s) | medium |
| 32 | ikuseiso/Personal_Lora_collections | 30 | 6 issue(s) | low |
| 33 | Tanger/LoraByTanger | 55 | 3 issue(s) | medium |
| 34 | DS-Archive/ds-LoRA | 60 | 3 issue(s) | medium |
| 35 | soknife/loras | 70 | 2 issue(s) | low |
| 36 | prompthero/openjourney-lora | 75 | 2 issue(s) | medium |
| 37 | Banano/banchan-lora | 40 | 5 issue(s) | low |
| 38 | Maisman/No-Game-NoLife-LoRAs | 70 | 2 issue(s) | medium |
| 39 | EarthnDusk/Gambit_Xmen_Anime_Lora_V1.1 | 50 | 4 issue(s) | low |
| 40 | EarthnDusk/DuskfallArt_LoRa | 40 | 6 issue(s) | low |
| 41 | gaoxiao/pokemon-lora | 65 | 3 issue(s) | medium |
| 42 | wtcherr/sd-unsplash_10k_canny-model-control-lora | 65 | 3 issue(s) | low |
| 43 | wtcherr/sd-unsplash_10k_blur_rand_KS-model-control-lora | 65 | 3 issue(s) | medium |
| 44 | samurai-architects/lora-starbucks | 50 | 4 issue(s) | low |
| 45 | prithivMLmods/Flux-Long-Toon-LoRA | 85 | 1 issue(s) | high |
| 46 | Limbicnation/pixel-art-lora | 87 | ✓ ok | high |
</details>