flux2tiny β€” Distilled FLUX.2-klein-4B with MiniCPM5-1B Text Encoder

This repository contains the trained adapter and LoRA weights for flux2tiny, a distilled version of FLUX.2-klein-4B that replaces the 4B-parameter Qwen3-4B text encoder with MiniCPM5-1B (1.08B parameters).

What's in this repo

File Size Description
adapter.safetensors ~23 MB Projection adapter (3Γ— Linear 1536β†’2560, concatenated to 7680)
transformer_lora/adapter_model.safetensors ~7.5 MB PEFT LoRA weights (rank 16) for Flux2Transformer2DModel
transformer_lora/adapter_config.json ~1 KB PEFT LoRA configuration

Required base models (downloaded automatically)

Usage

# Clone the code repo
# git clone https://github.com/ElMiloPy/flux2tiny.git

from pipeline import Flux2TinyPipeline

pipe = Flux2TinyPipeline(
    adapter_path="path/to/adapter.safetensors",
    lora_path="path/to/transformer_lora",
)

image = pipe("A cat sitting on a windowsill at sunset", height=512, width=512)
image.save("output.png")

Or via CLI:

python generate.py "A cat sitting on a windowsill at sunset" \
    --adapter path/to/adapter.safetensors \
    --lora path/to/transformer_lora \
    --size 512x512

Training details

Trained via a 3-stage knowledge distillation pipeline:

  1. Adapter pre-training β€” MSE alignment between MiniCPM5-1B and Qwen3-4B hidden states
  2. Teacher latent generation β€” 15,000 latent-prompt pairs from the original FLUX.2 pipeline
  3. Flow Matching LoRA distillation β€” Joint training of adapter + transformer LoRA on teacher latents

See github.com/ElMiloPy/flux2tiny for full details.

License

  • These weights: MIT
  • FLUX.2-klein-4B: Apache 2.0
  • MiniCPM5-1B: Apache 2.0
Downloads last month
4
Inference Providers NEW
This model isn't deployed by any Inference Provider. πŸ™‹ Ask for provider support

Model tree for Emilio407/flux2tiny-MiniCPM5-1B

Adapter
(65)
this model