File size: 5,626 Bytes
c3bae56
 
 
 
 
 
 
964cba0
 
c3bae56
 
964cba0
 
 
 
 
 
 
c3bae56
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
964cba0
 
 
 
 
 
 
 
 
 
 
 
 
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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
---
license: apache-2.0
base_model: Qwen/Qwen3.5-9B
library_name: transformers
pipeline_tag: any-to-any
---

<div align="center">

# Integral-9B

**Let Vision-Language Models Generate Images through Their Representations**

[![Project Page](https://img.shields.io/badge/Project-Page-blue?logo=googlechrome&logoColor=white)](https://thejb.ai/integral/)
[![arXiv](https://img.shields.io/badge/arXiv-2611.31237-b31b1b?logo=arxiv&logoColor=white)](https://arxiv.org/abs/2611.31237)
[![Code](https://img.shields.io/badge/Code-GitHub-181717?logo=github&logoColor=white)](https://github.com/the-jb/integral)

</div>

Integral is a unified multimodal model that extends pretrained vision-language models with image generation through
shared visual representations. Built upon Qwen3.5-9B, Integral supports image understanding, text-to-image
generation, and image editing within a single framework.

Integral introduces two complementary components: Abstraction Fusion, which constructs a shared visual representation
space for understanding and generation, and Block-wise MoT, which enables efficient visual generation while leveraging
pretrained multimodal knowledge.

## Setup

```bash
git clone https://github.com/the-jb/integral.git
cd integral
pip install -r requirements.txt
```

Run from the repository root (or put it on `PYTHONPATH`).

## Load model

```python
import torch
from integral import IntegralForConditionalGeneration, IntegralProcessor

repo = "the-jb/Integral-9B"
model = IntegralForConditionalGeneration.from_pretrained(
    repo, dtype=torch.bfloat16,
    attn_implementation={"text_config": "flash_attention_2"},
).to("cuda").eval()
processor = IntegralProcessor.from_pretrained(repo)
```

Do not call `model.to(torch.bfloat16)` afterwards: parts of the model stay in fp32.

## Text-to-image

```python
inputs = processor.prepare_image_generation(["a photo of a red apple on a wooden table"], height=512, width=512)
out = model.generate_image(**inputs, generator=torch.Generator().manual_seed(0))
out.images[0].save("apple.png")
```

Height and width are multiples of 32.

| Argument | Default | Description |
|---|---|---|
| `solver` | `"dpm_solver++"` | Sampler: `"dpm_solver++"` or `"euler"` |
| `num_inference_steps` | 50 | Number of sampling steps |
| `guidance_scale` | 4.0 | Text guidance scale |
| `time_shift` | 4.0 | Timestep schedule shift |
| `num_images_per_prompt` | 1 | Number of images per prompt |
| `latents` / `generator` | `None` | Initial noise, or the generator it is drawn from |
| `output_type` | `"pil"` | `"pil"`, `"pt"` or `"latent"` |

## Image editing

```python
from PIL import Image

source = Image.open("input.jpg").convert("RGB").resize((512, 512), Image.BICUBIC)
inputs = processor.prepare_image_generation(["Change the color of the car to red."], height=512, width=512,
                                            images=[source])
edited = model.generate_image(**inputs, generator=torch.Generator().manual_seed(0))
edited.images[0].save("edited.png")
```

Input image sides are multiples of 32.

| Argument | Default | Description |
|---|---|---|
| `image_guidance_scale` | 1.5 | Image guidance scale; `None` for text guidance only |
| `guidance_interval` | `(0.0, 1.0)` | Timestep range where guidance is applied |
| `guidance_renorm` | `"text_channel"` | Guidance renormalization: `"text_channel"`, `"global"` or `"none"` |
| `guidance_renorm_min` | 1.0 | Lower bound of the renormalization ratio |

## Image understanding

```python
messages = [{"role": "user", "content": [{"type": "image"}, {"type": "text", "text": "Describe this image."}]}]
text = processor.apply_chat_template(messages, tokenize=False, add_generation_prompt=True, enable_thinking=False)
inputs = processor(text=[text], images=[source], return_tensors="pt").to("cuda")
answer = model.generate(**inputs, max_new_tokens=256, do_sample=False)
print(processor.tokenizer.decode(answer[0, inputs["input_ids"].shape[1]:], skip_special_tokens=True))
```

## vLLM

From the repository root:

```python
from integral.vllm import register
register()   # at the script's top level, before creating the LLM

from vllm import LLM, SamplingParams
llm = LLM(model="the-jb/Integral-9B")
out = llm.generate({"prompt": text, "multi_modal_data": {"image": [source]}},
                   SamplingParams(temperature=0, max_tokens=256))
```

## Evaluation

The recommended settings are DPM-Solver++ with 50 steps, text guidance 4.0, time shift 4.0 and a 512×512 output.
For editing, add image guidance 1.5.
Visual understanding is evaluated with VLMEvalKit with thinking disabled: MMStar and MMMU use Qwen's official
settings (temperature 0.7, top-p 0.8, top-k 20, presence penalty 1.5), and the other benchmarks use temperature 0.01,
top-p 0.8, top-k 20 and at most 64 new tokens. With these settings, Integral-9B scores as follows.

Visual understanding

| POPE | MME-P | MME-C | MMB | SEED | SEED2+ | MMStar | MMMU | OCRBench |
|---|---|---|---|---|---|---|---|---|
| 89.6 | 1716 | 695 | 85.4 | 78.8 | 73.2 | 76.0 | 73.5 | 87.3 |

Image generation

| GenEval | GenEval2 (direct / CoT) | GenEval++ | DPG |
|---|---|---|---|
| 0.88 | 30.47 / 39.56 | 0.732 | 84.76 |

Image editing

| ImgEdit | KRIS-Bench |
|---|---|
| 3.50 | 60.79 |

## Citation

```bibtex
@article{kim2026integral,
  title   = {Let Vision-Language Models Generate Images through
             Their Representations},
  author  = {Kim, JB and Jeon, Byungwoo and Lee, Kyungmin and Kang, Hyeonmo and
             Park, Cheonbok and Joo, Shinyoung and Shin, Jinwoo and Kim, Jeonghoon},
  journal = {arXiv preprint arXiv:2611.31237},
  year    = {2026}
}
```