aikx commited on
Commit
7c8514f
Β·
verified Β·
1 Parent(s): 405c5a0

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +174 -18
README.md CHANGED
@@ -1,18 +1,15 @@
1
- ---
2
- license: apache-2.0
3
- pipeline_tag: any-to-any
4
- library_name: transformers
5
- ---
6
-
7
  <div align='center'>
8
  <h1>Emu3.5: Native Multimodal Models are World Learners</h1>
9
 
10
  Emu3.5 Team, BAAI
11
 
12
- [Project Page](https://emu.world/) | [πŸ€—HF Models](https://huggingface.co/collections/BAAI/emu35) | [Paper](https://arxiv.org/pdf/2510.26583) | [Code](https://github.com/baaivision/Emu3.5)
13
  </div>
14
 
15
 
 
 
 
16
  <div align='center'>
17
  <img src="https://github.com/baaivision/Emu3.5/blob/main/assets/arch.png?raw=True" class="interpolation-image" alt="arch." height="100%" width="100%" />
18
  </div>
@@ -36,13 +33,21 @@ Emu3.5 Team, BAAI
36
  | πŸ† | **Performance Benchmark** | Matches **Gemini 2.5 Flash Image (Nano Banana)** on **image generation/editing**, and **outperforms** on **interleaved generation tasks**. |
37
 
38
 
 
 
 
 
 
 
 
39
 
40
  ## Table of Contents
41
 
42
  1. [Model & Weights](#1-model--weights)
43
  2. [Quick Start](#2-quick-start)
44
- 3. [Schedule](#3-schedule)
45
- 4. [Citation](#4-citation)
 
46
 
47
  ## 1. Model & Weights
48
 
@@ -52,14 +57,28 @@ Emu3.5 Team, BAAI
52
  | Emu3.5-Image | [πŸ€— HF link](https://huggingface.co/BAAI/Emu3.5-Image/tree/main) |
53
  | Emu3.5-VisionTokenizer | [πŸ€— HF link](https://huggingface.co/BAAI/Emu3.5-VisionTokenizer/tree/main) |
54
 
 
 
 
 
 
 
 
 
 
 
 
 
 
55
  ## 2. Quick Start
56
 
57
  ### Environment Setup
58
 
59
  ```bash
 
60
  git clone https://github.com/baaivision/Emu3.5
61
  cd Emu3.5
62
- pip install -r requirements.txt
63
  pip install flash_attn==2.8.3 --no-build-isolation
64
  ```
65
  ### Configuration
@@ -67,8 +86,10 @@ pip install flash_attn==2.8.3 --no-build-isolation
67
  Edit `configs/config.py` to set:
68
 
69
  - Paths: `model_path`, `vq_path`
70
- - Task template: `task_type in {t2i, x2i, howto, story, explore, vla}`, `use_image` controls `<|IMAGE|>` usage (set to true when reference images are provided)
 
71
  - Sampling: `sampling_params` (classifier_free_guidance, temperature, top_k/top_p, etc.)
 
72
 
73
  ### Run Inference
74
 
@@ -76,24 +97,158 @@ Edit `configs/config.py` to set:
76
  python inference.py --cfg configs/config.py
77
  ```
78
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
79
  Protobuf outputs are written to `outputs/<exp_name>/proto/`. For better throughput, we recommend β‰₯2 GPUs.
80
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
81
  ### Visualize Protobuf Outputs
82
 
83
- To visualize generated protobuf files:
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
84
 
 
 
 
 
 
 
 
 
 
85
  ```bash
86
- python src/utils/vis_proto.py --input <input_proto_file> --output <output_dir>
87
  ```
88
 
89
- ## 3. Schedule
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
90
 
91
- - [x] Inference Code
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
92
  - [ ] Advanced Image Decoder
93
- - [ ] Discrete Diffusion Adaptation(DiDA)
94
 
95
 
96
- ## 4. Citation
97
 
98
  ```bibtex
99
  @misc{cui2025emu35nativemultimodalmodels,
@@ -105,4 +260,5 @@ python src/utils/vis_proto.py --input <input_proto_file> --output <output_dir>
105
  primaryClass={cs.CV},
106
  url={https://arxiv.org/abs/2510.26583},
107
  }
108
- ```
 
 
 
 
 
 
 
 
1
  <div align='center'>
2
  <h1>Emu3.5: Native Multimodal Models are World Learners</h1>
3
 
4
  Emu3.5 Team, BAAI
5
 
6
+ [Project Page](https://emu.world/pages/web/landingPage) | [πŸ€—HF Models](https://huggingface.co/collections/BAAI/emu35) | [Paper](https://arxiv.org/pdf/2510.26583) | [App](https://emu.world/pages/web/home?route=index)
7
  </div>
8
 
9
 
10
+ > πŸ”” **Latest**: Emu3.5 Web & Mobile Apps and vLLM offline inference are live β€” see [πŸ”₯ News](#news) for details.
11
+
12
+
13
  <div align='center'>
14
  <img src="https://github.com/baaivision/Emu3.5/blob/main/assets/arch.png?raw=True" class="interpolation-image" alt="arch." height="100%" width="100%" />
15
  </div>
 
33
  | πŸ† | **Performance Benchmark** | Matches **Gemini 2.5 Flash Image (Nano Banana)** on **image generation/editing**, and **outperforms** on **interleaved generation tasks**. |
34
 
35
 
36
+ <a id="news"></a>
37
+
38
+ ## πŸ”₯ News
39
+
40
+ - **2025-11-28 Β· 🌐 Emu3.5 Web & Mobile Apps Live** β€” Official product experience is **now available** on the web at [zh.emu.world](https://zh.emu.world) (Mainland China) and [emu.world](https://emu.world) (global) πŸŽ‰ The new homepage highlights featured cases and a β€œGet Started” entry, while the workspace and mobile apps bring together creation, inspiration feed, history, profile, and language switch across web, Android APK, and H5. *([See more details](#official-web--mobile-apps) below.)*
41
+ - **2025-11-19 Β· πŸš€ vLLM Offline Inference Released** β€” Meet `inference_vllm.py` with a new cond/uncond batch scheduler, delivering **4–5Γ— faster end-to-end generation** on vLLM 0.11.0 across Emu3.5 tasks. Jump to [#Run Inference with vLLM](#run-inference-with-vllm) for setup guidance and see PR [#47](https://github.com/baaivision/Emu3.5/pull/47) for full details.
42
+ - **2025-11-17 Β· πŸŽ›οΈ Gradio Demo (Transformers Backend)** β€” Introduced `gradio_demo_image.py` and `gradio_demo_interleave.py` presets for the standard Transformers runtime, providing turnkey T2I/X2I and interleaved generation experiences with streaming output. Try the commands in [#Gradio Demo](#3-gradio-demo) to launch both UIs locally.
43
 
44
  ## Table of Contents
45
 
46
  1. [Model & Weights](#1-model--weights)
47
  2. [Quick Start](#2-quick-start)
48
+ 3. [Gradio Demo](#3-gradio-demo)
49
+ 4. [Schedule](#4-schedule)
50
+ 5. [Citation](#5-citation)
51
 
52
  ## 1. Model & Weights
53
 
 
57
  | Emu3.5-Image | [πŸ€— HF link](https://huggingface.co/BAAI/Emu3.5-Image/tree/main) |
58
  | Emu3.5-VisionTokenizer | [πŸ€— HF link](https://huggingface.co/BAAI/Emu3.5-VisionTokenizer/tree/main) |
59
 
60
+
61
+ *Note:*
62
+ - **Emu3.5** supports general-purpose multimodal predictions, including interleaved image-text generation and single-image generation (T2I/X2I) tasks.
63
+ - **Emu3.5-Image** is a model focused on T2I/X2I tasks for best performance on these scenarios.
64
+ - Both models are pure next-token predictors without DiDA acceleration (each image may take several minutes to generate).
65
+ - ⚑ **Stay tuned for DiDA-accelerated weights.**
66
+
67
+ > πŸ’‘ **Usage tip:**
68
+ > For **interleaved image-text generation**, use **Emu3.5**.
69
+ > For **single-image generation** (T2I and X2I), use **Emu3.5-Image** for the best quality.
70
+
71
+
72
+
73
  ## 2. Quick Start
74
 
75
  ### Environment Setup
76
 
77
  ```bash
78
+ # Requires Python 3.12 or higher.
79
  git clone https://github.com/baaivision/Emu3.5
80
  cd Emu3.5
81
+ pip install -r requirements/transformers.txt
82
  pip install flash_attn==2.8.3 --no-build-isolation
83
  ```
84
  ### Configuration
 
86
  Edit `configs/config.py` to set:
87
 
88
  - Paths: `model_path`, `vq_path`
89
+ - Task template: `task_type in {t2i, x2i, howto, story, explore, vla}`
90
+ - Input image: `use_image` (True to provide reference images, controls <|IMAGE|> token); set `reference_image` in each prompt to specify the image path. For x2i task, we recommand using `reference_image` as a list containing single/multiple image paths to be compatible with multi-image input.
91
  - Sampling: `sampling_params` (classifier_free_guidance, temperature, top_k/top_p, etc.)
92
+ - Aspect Ratio (for t2i task): `aspect_ratio` ("4:3", "21:9", "1:1", "auto" etc..)
93
 
94
  ### Run Inference
95
 
 
97
  python inference.py --cfg configs/config.py
98
  ```
99
 
100
+
101
+ #### Example Configurations by Task
102
+ Below are example commands for different tasks.
103
+ Make sure to set CUDA_VISIBLE_DEVICES according to your available GPUs.
104
+
105
+
106
+ ```bash
107
+ # πŸ–ΌοΈ Text-to-Image (T2I) task
108
+ CUDA_VISIBLE_DEVICES=0 python inference.py --cfg configs/example_config_t2i.py
109
+
110
+ # πŸ”„ Any-to-Image (X2I) task
111
+ CUDA_VISIBLE_DEVICES=0,1 python inference.py --cfg configs/example_config_x2i.py
112
+
113
+ # 🎯 Visual Guidance task
114
+ CUDA_VISIBLE_DEVICES=0,1 python inference.py --cfg configs/example_config_visual_guidance.py
115
+
116
+ # πŸ“– Visual Narrative task
117
+ CUDA_VISIBLE_DEVICES=0,1 python inference.py --cfg configs/example_config_visual_narrative.py
118
+
119
+
120
+ # After running inference, the model will generate results in protobuf format (.pb files) for each input prompt.
121
+ ```
122
+
123
+
124
  Protobuf outputs are written to `outputs/<exp_name>/proto/`. For better throughput, we recommend β‰₯2 GPUs.
125
 
126
+
127
+ ### Run Inference with vLLM
128
+
129
+ #### vLLM Enviroment Setup
130
+
131
+ 1. [Optional Recommendation] Use a new virtual environment for vLLM backend.
132
+ ```bash
133
+ conda create -n Emu3p5 python=3.12
134
+ ```
135
+
136
+ 2. Install vLLM and apply the patch files.
137
+ ```bash
138
+ # Requires Python 3.12 or higher.
139
+ # Recommended: CUDA 12.8.
140
+ pip install -r requirements/vllm.txt
141
+ pip install flash_attn==2.8.3 --no-build-isolation
142
+
143
+ cd Emu3.5
144
+ python src/patch/apply.py
145
+ ```
146
+
147
+ #### Example Configurations by Task
148
+
149
+ ```bash
150
+ # πŸ–ΌοΈ Text-to-Image (T2I) task
151
+ CUDA_VISIBLE_DEVICES=0,1 python inference_vllm.py --cfg configs/example_config_t2i.py
152
+
153
+ # πŸ”„ Any-to-Image (X2I) task
154
+ CUDA_VISIBLE_DEVICES=0,1 python inference_vllm.py --cfg configs/example_config_x2i.py
155
+
156
+ # 🎯 Visual Guidance task
157
+ CUDA_VISIBLE_DEVICES=0,1 python inference_vllm.py --cfg configs/example_config_visual_guidance.py
158
+
159
+ # πŸ“– Visual Narrative task
160
+ CUDA_VISIBLE_DEVICES=0,1 python inference_vllm.py --cfg configs/example_config_visual_narrative.py
161
+ ```
162
+
163
+
164
  ### Visualize Protobuf Outputs
165
 
166
+ To visualize generated protobuf files (--video: Generate video visualizations for interleaved output):
167
+
168
+ ```bash
169
+ python src/utils/vis_proto.py --input <input_proto_path> [--output <output_dir>] [--video]
170
+ ```
171
+
172
+ - `--input`: supports a single `.pb` file or a directory; directories are scanned recursively.
173
+ - `--output`: optional; defaults to `<input_dir>/results/<file_stem>` for files, or `<parent_dir_of_input>/results` for directories.
174
+
175
+ Expected output directory layout (example):
176
+
177
+ ```text
178
+ results/<pb_name>/
179
+ β”œβ”€β”€ 000_question.txt
180
+ β”œβ”€β”€ 000_global_cot.txt
181
+ β”œβ”€β”€ 001_text.txt
182
+ β”œβ”€β”€ 001_00_image.png
183
+ β”œβ”€β”€ 001_00_image_cot.txt
184
+ β”œβ”€β”€ 002_text.txt
185
+ β”œβ”€β”€ 002_00_image.png
186
+ β”œβ”€β”€ ...
187
+ └── video.mp4 # only when --video is enabled
188
+ ```
189
+
190
+ Each `*_text.txt` stores decoded segments, `*_image.png` stores generated frames, and matching `*_image_cot.txt` keeps image-level chain-of-thought notes when available.
191
+
192
+ ## 3. Gradio Demo
193
 
194
+ We provide two Gradio Demos for different application scenarios:
195
+
196
+ Emu3.5-Image Demo β€”β€” Interactive interface optimized for Text-to-Image (T2I) and Any-to-Image (X2I) tasks:
197
+
198
+ ```bash
199
+ CUDA_VISIBLE_DEVICES=0,1 python gradio_demo_image.py --host 0.0.0.0 --port 7860
200
+ ```
201
+
202
+ Emu3.5-Interleave Demo β€”β€” Launch Emu3.5 Interleave Tasks (Visual Guidance and Visual Narrate) Gradio Demo
203
  ```bash
204
+ CUDA_VISIBLE_DEVICES=0,1 python gradio_demo_interleave.py --host 0.0.0.0 --port 7860
205
  ```
206
 
207
+ ### Features
208
+
209
+ - Image Generation: Support Text-to-Image Generation and Multimodal Image Generation
210
+ - Interleaved Generation: Support long-sequence creation with alternating image and text generation
211
+ - Multiple Aspect Ratios for T2I: 9 preset aspect ratios (4:3, 16:9, 1:1, etc.) plus auto mode
212
+ - Chain-of-Thought Display: Automatically parse and format model's internal thinking process
213
+ - Real-time Streaming: Stream text and image generation with live updates
214
+
215
+ ### Official Web & Mobile Apps
216
+
217
+ - **Web**: Production-ready Emu3.5 experience is available at [zh.emu.world](https://zh.emu.world) (Mainland China) and [emu.world](https://emu.world) (global), featuring a curated homepage, β€œCreate” workspace, inspiration feed, history, personal profile, and language switching.
218
+ - **Mobile (Android APK & H5)**: Mobile clients provide the same core flows β€” prompt-based creation, β€œinspiration” gallery, personal center, and feedback & privacy entrypoints β€” with automatic UI language selection based on system settings.
219
+ - **Docs**: For product usage details, see the **Emu3.5 AI δ½Ώη”¨ζŒ‡ε— (Chinese)** and **Emu3.5 AI User Guide (English)**:
220
+ - CN: [Emu3.5 AI δ½Ώη”¨ζŒ‡ε—](https://jwolpxeehx.feishu.cn/wiki/BKuKwkzZOi4pdRkVV13csI0FnIg?from=from_copylink)
221
+ - EN: [Emu3.5 AI User Guide](https://jwolpxeehx.feishu.cn/wiki/Gcxtw9XHhisUu8kBEaac6s6xnhc?from=from_copylink)
222
+
223
+ #### Mobile App Download (QR Codes)
224
 
225
+ <div align='center'>
226
+ <table>
227
+ <tr>
228
+ <td align="center">
229
+ <img src="./assets/qr_zh.png" alt="Emu3.5 Mobile App (Mainland China)" width="220" />
230
+ <br />
231
+ <sub><b>Emu3.5 Mobile Β· Mainland China</b></sub>
232
+ </td>
233
+ <td align="center">
234
+ <img src="./assets/qr.png" alt="Emu3.5 Mobile App (Global)" width="220" />
235
+ <br />
236
+ <sub><b>Emu3.5 Mobile Β· Global</b></sub>
237
+ </td>
238
+ </tr>
239
+ </table>
240
+ </div>
241
+
242
+
243
+
244
+ ## 4. Schedule
245
+
246
+ - [x] Inference Code (NTP Version)
247
  - [ ] Advanced Image Decoder
248
+ - [ ] Discrete Diffusion Adaptation (DiDA) Inference & Weights
249
 
250
 
251
+ ## 5. Citation
252
 
253
  ```bibtex
254
  @misc{cui2025emu35nativemultimodalmodels,
 
260
  primaryClass={cs.CV},
261
  url={https://arxiv.org/abs/2510.26583},
262
  }
263
+ ```
264
+