CoolFace
Modelpublic

BachNgoH/flux2-klein-4b-overlap-ownership-lora

sourceHugging Faceupdated 6mo agoView on Hugging Face
0likes4downloads
Model Card

FLUX.2 Klein 4B — Overlap-Ownership LoRA

LoRA adapter fine-tuned on FLUX.2-klein-base-4B for count-preserving dense image generation with overlap-ownership attention zones.

Model Details

  • —Base model: black-forest-labs/FLUX.2-klein-base-4B
  • —LoRA rank: 16, alpha: 32
  • —Target modules: tok, tov, toq, toout.0, toqkvmlp_proj
  • —Training steps: 2000
  • —Training framework: PEFT + diffusers

Training Configuration

  • —Effective batch size: 4 (bs=1 x grad_accum=4)
  • —Learning rate: 5e-5
  • —Optimizer: AdamW
  • —Precision: bf16
  • —Features: GLIGEN-style layout attention + AIBL loss + Overlap-Ownership zones

Overlap-Ownership Zones (Idea 7)

Three-zone classification for overlapping bboxes:

  • —Winner zone: pixels owned by one bbox (strong positive bias)
  • —Contested zone: pixels claimed by multiple bboxes (moderate positive bias)
  • —Loser zone: pixels occluded by other bboxes (reduced bias)

Evaluation Results (1000 samples, val split)

MetricValueBaseline
Exact Match14.72%15.34%
±1 Tolerance36.00%—
±2 Tolerance51.26%—
MAE4.2854.22
RMSE6.8448.12

Usage

python
from diffusers import Flux2KleinPipeline
from peft import PeftModel

pipe = Flux2KleinPipeline.from_pretrained("black-forest-labs/FLUX.2-klein-base-4B")
pipe.transformer = PeftModel.from_pretrained(pipe.transformer, "BachNgoH/flux2-klein-4b-overlap-ownership-lora")

Framework Versions

  • —PEFT 0.18.1
  • —Diffusers
  • —PyTorch 2.x