File size: 2,445 Bytes
4dd4f01
 
36f6fd7
 
4dd4f01
36f6fd7
 
 
 
4dd4f01
 
36f6fd7
 
 
 
d7050be
 
 
 
 
36f6fd7
 
 
 
 
 
 
 
 
 
d7050be
 
36f6fd7
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
---
base_model: black-forest-labs/FLUX.2-klein-base-4B
library_name: diffusers
pipeline_tag: text-to-image
tags:
- text-to-image
- diffusers
- reinforcement-learning
- imago
---

# Imago-4B

**Imago-4B** is a full-parameter RL post-trained DiT transformer from *Imago: Maturing Visual Generation with RL*, initialized from [`black-forest-labs/FLUX.2-klein-base-4B`](https://huggingface.co/black-forest-labs/FLUX.2-klein-base-4B).


![Qualitative comparison between Imago-4B and FLUX.2-Klein-Base-4B](assets/qualitative.jpg)

*Paired qualitative comparisons between **Imago-4B** and **FLUX.2-Klein-Base-4B** across diverse artistic styles and aspect ratios (21:9 to 9:21), generated from identical prompts and initial noise.*

## Benchmark Results (Kimi-K2.6 Judge)

| Model | Mean | T2I-CompBench | TIIF-Bench | SpatialGenEval | T2I-CoReBench | LPD-Bench | Arena-T2I-Hard | LongBench-T2I | DrawBench PickScore |
|---|---:|---:|---:|---:|---:|---:|---:|---:|---:|
| Imago-4B | **82.7** | 4.09 | 84.7 | 80.9 | 88.7 | 93.0 | 80.0 | 3.50 | 22.8 |
| FLUX.2-Klein-Base (4B) | 73.8 | 3.84 | 77.1 | 71.6 | 77.2 | 88.8 | 67.7 | 2.88 | 22.4 |

## Training Recipe
- **Reward**: Zero-shot Qwen3.5-9B ProbScore
- **Curriculum**: Two-stage sequential RL (`Jialuo21/Imago-Short` -> `Jialuo21/Imago-Long`)
- **Algorithm**: DiffusionNFT with Tree Sampling, DAVE, and NormReg (no CFG, no KL penalty)
- **Settings**: LR `1e-6`, 500 steps on `Imago-Short` -> 500 steps on `Imago-Long`, Tree Sampling (`t in [0.8, 1.0]`), DAVE (`block 14/25`), NormReg (`beta=0.07`)

## Usage

This repository contains the fine-tuned DiT transformer weights (`config.json` + `diffusion_pytorch_model.safetensors`). Load it into the base `Flux2KleinPipeline`:

```python
import torch
from diffusers import Flux2KleinPipeline, Flux2Transformer2DModel

transformer = Flux2Transformer2DModel.from_pretrained(
    "Jialuo21/Imago-4B",
    torch_dtype=torch.bfloat16,
)
pipe = Flux2KleinPipeline.from_pretrained(
    "black-forest-labs/FLUX.2-klein-base-4B",
    transformer=transformer,
    torch_dtype=torch.bfloat16,
).to("cuda")

image = pipe(
    prompt="A weathered brass telescope resting on a wooden tripod next to an open leather-bound star atlas on a stone balcony overlooking a moonlit harbor.",
    height=1024,
    width=1024,
    num_inference_steps=50,
    guidance_scale=4.0,
    generator=torch.Generator("cuda").manual_seed(0),
).images[0]
image.save("imago-4b.png")
```