From e1dfd1c2a60bb2bd1d765f216e7b0b2c48d01380 Mon Sep 17 00:00:00 2001 From: Will Miao Date: Sun, 5 Jul 2026 20:45:01 +0800 Subject: [PATCH] chore(tests): add two test entries and their HF README snapshots --- .../hf_lora_models_with_safetensors.txt | 2 + .../readmes/Limbicnation__pixel-art-lora.md | 155 ++++++++++++++++++ .../prithivMLmods__Flux-Long-Toon-LoRA.md | 117 +++++++++++++ 3 files changed, 274 insertions(+) create mode 100644 tests/enrich_hf_validation/test_data/readmes/Limbicnation__pixel-art-lora.md create mode 100644 tests/enrich_hf_validation/test_data/readmes/prithivMLmods__Flux-Long-Toon-LoRA.md diff --git a/tests/enrich_hf_validation/test_data/hf_lora_models_with_safetensors.txt b/tests/enrich_hf_validation/test_data/hf_lora_models_with_safetensors.txt index 03fb833e..68f7647d 100644 --- a/tests/enrich_hf_validation/test_data/hf_lora_models_with_safetensors.txt +++ b/tests/enrich_hf_validation/test_data/hf_lora_models_with_safetensors.txt @@ -42,3 +42,5 @@ gaoxiao/pokemon-lora, pytorch_lora_weights.safetensors wtcherr/sd-unsplash_10k_canny-model-control-lora, diffusion_pytorch_model.safetensors wtcherr/sd-unsplash_10k_blur_rand_KS-model-control-lora, diffusion_pytorch_model.safetensors samurai-architects/lora-starbucks, starbucks_interior.safetensors +prithivMLmods/Flux-Long-Toon-LoRA, Long-Toon.safetensors +Limbicnation/pixel-art-lora, pytorch_lora_weights.comfyui.safetensors diff --git a/tests/enrich_hf_validation/test_data/readmes/Limbicnation__pixel-art-lora.md b/tests/enrich_hf_validation/test_data/readmes/Limbicnation__pixel-art-lora.md new file mode 100644 index 00000000..687d35f7 --- /dev/null +++ b/tests/enrich_hf_validation/test_data/readmes/Limbicnation__pixel-art-lora.md @@ -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) diff --git a/tests/enrich_hf_validation/test_data/readmes/prithivMLmods__Flux-Long-Toon-LoRA.md b/tests/enrich_hf_validation/test_data/readmes/prithivMLmods__Flux-Long-Toon-LoRA.md new file mode 100644 index 00000000..93e9848c --- /dev/null +++ b/tests/enrich_hf_validation/test_data/readmes/prithivMLmods__Flux-Long-Toon-LoRA.md @@ -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 + + + +**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.