kibako items-klein4b

A LoRA for FLUX.2 [klein] 4B that turns a bare item name into a game item icon on a plain white background.

Without the LoRA, an iron sword gives a photograph. With it, you get a single centered icon, with no prompt engineering.

Base model, plain prompt + this LoRA (base-4B, 25 steps) + this LoRA (distilled 4B, 4 steps)

(The prompts are the plain item names an iron sword, a battle axe, ... with seeds 1 and 2. The base column is the distilled 4B model with 4 steps.)

Usage

import torch
from diffusers import DiffusionPipeline

pipe = DiffusionPipeline.from_pretrained(
    "black-forest-labs/FLUX.2-klein-base-4B", torch_dtype=torch.bfloat16
).to("cuda")
pipe.load_lora_weights("ttreetoshi/kibako-items-klein4b")

image = pipe(
    prompt="a treasure chest",
    width=1024, height=1024,
    num_inference_steps=25, guidance_scale=4.0,
).images[0]
  • Trained on FLUX.2-klein-base-4B; use 25 steps and guidance 4 there.
  • It also loads on the distilled FLUX.2-klein-4B (4 steps, guidance 1). The icon framing carries over, but the style is more realistic and the effect is weaker.
  • Prompt with the bare item name (a red health potion). There is no trigger word.

Training

  • Base: black-forest-labs/FLUX.2-klein-base-4B (Apache-2.0).
  • Data: 262 images of 132 generic items, generated by FLUX.2-klein-4B with the prompt game item icon of {item}, single object, centered, plain white background (4 candidates per item, an automatic white-background / margin / subject-size check, then hand-picked). The caption of each image is the item name alone, so the LoRA learns the icon style from the name.
  • LoRA rank 32 / alpha 32, batch size 2, AdamW, lr 1e-4, bf16, 768 and 1024 px. The run was 2000 steps and the released weights are the step 1500 checkpoint; step 2000 had started to lose shapes (potions turned into gems, bows into sticks).
  • The full recipe is in train.yaml; every image, prompt and seed is in manifest.jsonl. The dataset is published as ttreetoshi/kibako-items-klein4b-data.

Reproducing

  • Base weights: black-forest-labs/FLUX.2-klein-base-4B at revision a3b4f4849157f664bdbc776fd7453c2783562f4d. Data generator: black-forest-labs/FLUX.2-klein-4B at revision e7b7dc27f91deacad38e78976d1f2b499d76a294.
  • Trainer: ai-toolkit at commit 4a7f28532ed6fe81d9f8c00718878bb3b8739015 (reports version 0.13.42), on one NVIDIA GB10.
  • Data: install the generation extras (uv sync --group gen) and download the generator at that revision first (hf download black-forest-labs/FLUX.2-klein-4B --revision e7b7dc27f91deacad38e78976d1f2b499d76a294; kibako.synth uses the locally cached snapshot and records its revision). Then run python -m kibako.synth models/items-klein4b/items.yaml RAW_DIR, then python -m kibako.curate check RAW_DIR and python -m kibako.curate build RAW_DIR models/items-klein4b/selection.yaml DATASET_DIR. Then train with train.yaml, pointing folder_path at DATASET_DIR.
  • GPU generation and training are not bit-exact across hardware and library versions, so a rebuild gives close but not byte-identical images and weights. The published dataset holds the exact images that were used (their SHA-256 hashes are in the manifest).
  • items_bows.yaml, selection_bows.yaml and kibako.synth_sketch belong to an unreleased experiment with bow sketches (see Limits); they are not part of this model.

Limits

  • It is a style LoRA: it does not teach the base model objects it cannot draw. Items the base model gets wrong (crossbows, slings, long spears, maps, tarot cards, ...) were left out of the training set and stay unreliable.
  • Bows: the bare prompt a wooden bow gives a symmetric diamond-shaped bow with a crossed string. Describing the shape works: a wooden hunting bow, side view, strung gave a recognisable strung bow on all 4 seeds tried, though usually with an arrow drawn in (top row below is the bare prompt, bottom row the descriptive one). Training with bow images did not give a better model: long captions made it worse, and 16 bows drawn from procedural sketches fixed the bare prompt but made boned meat, fishing rods, bombs and subject size worse across the other items. So this is documented rather than trained away.

  • a roasted meat on the bone often looks like a club.
  • Text on items (books, maps) is not legible.
  • Single objects only. It was not trained for sprite sheets, characters or scenes.
  • Not pixel art. Output is smooth, painted-looking icons at 1024 px.
  • Evaluated by eye on 20 fixed items x 2 seeds; there is no quantitative benchmark. 18 of the 20 items are also in the training set (all but a wooden bow and a fishing rod), so the samples show the learned style more than generalisation. The training-time samples of two unseen items (a pocket watch, a cupcake, one seed each) at step 1500 have the same icon style.

Commercial use

  • Base model: Apache-2.0.
  • Training data: images generated by FLUX.2-klein-4B, which is Apache-2.0; its model card states that the open weights are available for commercial use, and the base-4B card states that outputs can be used for commercial purposes. Each manifest entry records the generator, the exact weights revision, the prompt and the seed.
  • This LoRA: Apache-2.0.

Do not prompt for existing characters, brands or other third-party IP. Whether AI-generated images are protected by copyright differs by jurisdiction; this is not legal advice. See the licensing policy.

Downloads last month
21
Inference Providers NEW

Model tree for ttreetoshi/kibako-items-klein4b

Adapter
(119)
this model