分支标签打开更多操作菜单

最新提交

 

历史

16 次提交16 次提交

文件夹和文件

名称名称最后提交信息最后提交日期
dockerdocker  
examplesexamples  
figuresfigures  
ming_sdkming_sdk  
mingtokmingtok  
mingunivisionmingunivision  
sentence_managersentence_manager  
talkertalker  
vllmvllm  
.gitignore.gitignore  
LEGAL.mdLEGAL.md  
LICENSELICENSE  
README.mdREADME.md  
app.pyapp.py  
requirements.txtrequirements.txt  

仓库文件导航

Ming-UniVision:基于连续统一 Tokenizer 的联合图像理解与生成

📄 技术报告 | 📖项目主页 |🤗 Hugging Face| 🤖 ModelScope

🌍 简介

🌐 Ming-UniVision 是一款突破性的多模态大语言模型(MLLM),它在单一自回归下一 token 预测(NTP)框架内统一了视觉理解、生成与编辑,其核心是 MingTok——首个连续、统一的视觉 tokenizer。通过消除离散量化并利用共享的连续隐空间,Ming-UniVision 能够在多种任务间实现无缝的端到端多模态推理。 基于高保真连续视觉表征训练,Ming-UniVision 支持多轮、上下文内的视觉-语言交互,例如迭代式问答、图像生成和语义编辑——全程无需将中间状态解码为像素。这实现了高效、连贯且类人的多模态对话,并始终保持一致的特征动态。

  • 🌐 首个采用连续统一视觉表征的 NTP MLLM: Ming-UniVision 通过下一 token 预测,使用连续视觉 token 统一视觉与语言——无需离散量化,完整的自回归生成范式,并在共享隐空间中同时支持理解与生成。
  • 🖼️ 首个连续统一视觉 Tokenizer: MingTok-Vision 在单一连续空间中同时支持理解与生成,保持语义与感知质量。
  • ⚡ 训练收敛速度提升 3.5 倍: 共享表征减少了任务间的冲突,实现更快、更稳定的联合训练。
  • 🔄 多轮上下文视觉任务: 在同一隐空间中执行迭代推理、生成与编辑——过程中无需图像解码。
  • 🔗 单一空间,统一工作流: 所有模态与任务共享一个连贯的特征空间——训练更简单、推理更高效、实现真正的自回归融合。

📌 更新

  • [2025.10.09] 📄 技术报告已发布!
    完整技术报告现已在 arXiv 上发布:
    👉 arXiv:2510.06590 | Ming-UniVision:基于统一连续 Tokenizer 的联合图像理解与生成
    深入了解支撑我们系统的架构、统一连续 tokenizer 以及端到端自回归框架。

  • [2025.10.02] 🔥 我们上线了!
    我们非常高兴地宣布发布 Ming-UniVision 和 MingTok-Vision ——首个采用统一连续视觉 tokenization 的联合自回归视觉-语言系统!

    ✨ 在单一隐空间中实现无缝的多模态推理、生成与编辑。
    🚀 更快的训练、更丰富的语义、真正的端到端自回归——无需量化,毫不妥协。

    👉 查看我们的 博客文章 ,了解我们如何重新定义统一的视觉-语言智能。

📊 评估

MingTok-Vision 具备强大的图像重建能力,Ming-UniVision 则在单一连续隐空间内实现了统一的多模态理解与生成。

图像重建

MingTok-Vision 以高 PSNR 和低 rFID 实现了有竞争力的重建质量,表明其能够在连续表征中同时保持感知保真度和语义结构。

表 1. 图像重建性能 ,基于 ImageNet-val-50k。
Tokenizer 分辨率 Token 数 rFID ↓ PSNR ↑ SSIM ↑ LPIPS ↓
专用 tokenizer
SD-VAE 256 1024 1.06 28.62 0.86 -
GigaTok 256 256 0.51 21.32 0.69 0.21
VA-VAE 256 256 0.26 28.59 0.80 0.09
HieraTok 256 256 1.04 23.90 0.72 0.09
DC-AE 512 64 0.22 26.15 0.71 0.08
MAE-Tok 512 128 0.62 - - -
TexTok 512 256 0.73 24.45 0.66 0.19
统一 tokenizer
UniTok 256 256 0.38 - - -
TokenFlow 384 729 0.63 22.77 0.73 -
MingTok-Vision 512 256 0.54 30.77 0.62 0.14
MingTok-Vision † 512 256 0.38 31.09 0.64 0.12
† 表示在联合预训练后使用语义解码器。

视觉理解

Ming-UniVision 在多模态理解基准上取得了有竞争力的表现,表明连续隐 token 无需离散量化即可有效支撑高层视觉-语言推理。

表 2. 定量评估 ,基于 MMBench、MMStar、MMMU、MathVista、HallusionBench、AI2D、MM-Vet、OCRBench 和 MME。
模型 MMB ↑ MMS ↑ MMMU ↑ MathV ↑ Hall ↑ AI2D ↑ MM-Vet ↑ OCRBench ↑ MME ↑
仅理解
Emu3-Chat 58.5 - 31.6 - - - 37.2 687 -
Qwen2.5-VL-3B 79.1 55.9 53.1 62.3 46.3 81.6 - 797 2157
Qwen2.5-VL-7B 83.5 63.9 58.6 68.2 52.9 83.9 67.1 864 2347
InternVL2.5-4B 81.1 58.3 52.3 60.5 46.3 81.4 60.6 828 2338
InternVL2.5-8B 84.6 62.8 56.0 64.4 50.1 84.5 62.8 822 2344
DeepSeek-VL2 79.6 61.3 51.1 62.8 - 81.4 - 811 2253
统一模型,分离表征
Janus-Pro-7B 79.2 - 41.0 - - - 50.0 - -
LMFusion - - 41.7 - - - - - 1603
MetaQuery-L 78.6 - 53.1 - - - 63.2 - -
Show-o2-7B 79.3 56.6 48.9 - - 78.6 - - -
BLIP3-o 4B 78.6 - 46.6 - - - 60.1 - 2161
BAGEL 85.0 - 55.3 73.1 - - 67.2 - 2388
统一模型,统一表征
VILA-U - - - - - - 33.5 - 1402
TokenFlow-XL 76.8 - 43.2 - - - 48.2 - 1922
UniTok - - - - - - 33.9 - 1448
Harmon-1.5B 65.5 - 38.9 - - - - - 1476
TokLIP 67.6 - 43.1 - - - 29.8 - -
Ming-UniVision-16B-A3B(本文) 78.5 63.7 40.3 66.6 47.8 82.8 64.2 724 2023

视觉生成

Ming-UniVision 在统一表征模型的文本到图像生成中取得最佳性能,展现出卓越的物体组合与空间推理能力。

表 3. 文本到图像生成能力评估 在 GenEval 和 DPG-Bench 上。 † 表示通过重写提示词获得的性能。
方法 单物体 ↑ 双物体 ↑ 计数 ↑ 颜色 ↑ 位置 ↑ 颜色属性 ↑ 总体 ↑ DPG-Bench ↑
仅生成
LlamaGen 0.71 0.34 0.21 0.58 0.07 0.04 0.32 -
PixArt-α 0.98 0.50 0.44 0.80 0.08 0.07 0.48 -
SDv2.1 0.98 0.51 0.44 0.85 0.07 0.17 0.50 -
DALL-E 2 0.94 0.66 0.49 0.77 0.10 0.19 0.52 -
Emu3-Gen 0.98 0.71 0.34 0.81 0.17 0.21 0.54 80.60
SDXL 0.98 0.74 0.39 0.85 0.15 0.23 0.55 74.65
DALL-E 3 0.96 0.87 0.47 0.83 0.43 0.45 0.67 83.50
SD3-Medium 0.99 0.94 0.72 0.89 0.33 0.60 0.74 84.08
统一模型,分离表征
Show-o 0.95 0.52 0.49 0.82 0.11 0.28 0.53 -
Ming-Lite-Uni 0.99 0.76 0.53 0.87 0.26 0.30 0.62 -
Janus-Pro-1B 0.98 0.82 0.51 0.89 0.65 0.56 0.73 82.63
Janus-Pro-7B 0.99 0.89 0.59 0.90 0.79 0.66 0.80 84.19
Show-o2-7B 1.00 0.87 0.58 0.92 0.52 0.62 0.76 86.14
MetaQuery-L† - - - - - - 0.78 81.10
Blip3-o 4B - - - - - - 0.81 79.36
BAGEL 0.99 0.94 0.81 0.88 0.64 0.63 0.82 -
统一模型,统一表征
Harmon-1.5B 0.99 0.86 0.66 0.85 0.74 0.48 0.79 -
TokenFlow-XL 0.95 0.60 0.41 0.81 0.16 0.24 0.55 73.38
Ming-UniVision-16B-A3B(本文) 1.00 0.93 0.59 0.93 0.92 0.70 0.85 82.12

📥 模型下载

模型 Hugging Face ModelScope
Ming-UniVision-16B-A3B 下载 下载
MingTok-Vision 下载 下载

🔗 两个模型均已公开供研究使用。请访问相应页面了解模型详情、推理示例和集成指南。

🚀 使用示例

🔧 安装

首先,克隆仓库并安装所需依赖:

git clone https://github.com/inclusionAI/Ming-UniVision.git
cd Ming-UniVision
conda create -n ming python=3.10 -y
conda activate ming
pip install -r requirements.txt --extra-index-url https://download.pytorch.org/whl/cu128
pip install flash_attn
modelscope download --model inclusionAI/Ming-UniVision-16B-A3B --local_dir ./models/Ming-UniVision-16B-A3B
modelscope download --model inclusionAI/MingTok-Vision --local_dir ./models/MingTok-Vision

💬 快速开始

# >=44GB VRAM
python app.py

# >=22GB VRAM
python app.py --dtype int8

# >=14GB VRAM
python app.py --dtype int4

🖼️ 使用 MingTok-Vision 进行图像重建

以下是一个简单示例,演示如何使用 MingTok-Vision 的连续隐空间重建图像:

# test_infer_recon_image.py
import torch
from PIL import Image
import torchvision.transforms as T
from omegaconf import OmegaConf
from mingtok.modeling_mingtok import MingTok
from mingtok.utils import CenterCropProcessor

if __name__ == "__main__":
    # Load model
    mingtok_model = MingTok.from_pretrained("./models/MingTok-Vision")
    mingtok_model = mingtok_model.cuda()

    img_path = "mingtok/asset/mingtok.png"
    save_path = "mingtok/asset/mingtok_recon.png"

    # Load and preprocess image
    image = Image.open(img_path).convert("RGB")
    processor = CenterCropProcessor(image_size=512, mean=[0.5, 0.5, 0.5], std=[0.5, 0.5, 0.5])
    image = processor(image).cuda().unsqueeze(0)

    # Reconstruct
    out = mingtok_model.forward_enc_dec(image)

    # Denormalize and save
    output_mean = torch.Tensor([0.5, 0.5, 0.5]).view(1, -1, 1, 1).cuda()
    output_std = torch.Tensor([0.5, 0.5, 0.5]).view(1, -1, 1, 1).cuda()
    output_image = (out * output_std + output_mean)[0]
    output_image = T.ToPILImage()(output_image)
    output_image.save(save_path)
    print(f"Reconstructed image saved to {save_path}")

💬 使用 Ming-UniVision 进行多模态推理

使用 MingUniVisionInfer 完成统一任务,包括图像生成、理解以及单轮和多轮编辑。

from mingunivisioninfer import MingUniVisionInfer
model = MingUniVisionInfer("./models/Ming-UniVision-16B-A3B")

# single round generation
image_gen_prompt = "Please generate the corresponding image based on the description. A cute girl."
messages = [{
  "role": "HUMAN",
  "content": [{"type": "text", "text": image_gen_prompt},],
}]
output_text = model.generate(messages, max_new_tokens=512, output_image_prefix="a_cute_girl")
model.reset_inner_state()

# single ground understanding
messages = [{
  "role": "HUMAN",
  "content": [
    {"type": "image", "image": "a_cute_girl.png"},
    {"type": "text", "text": "Please describe the picture in detail."},
  ],
}]
output_text = model.generate(messages, max_new_tokens=512)
print(output_text)
model.reset_inner_state()

# multi-round editing
messages = [{
  "role": "HUMAN",
  "content": [
    {"type": "image", "image": "a_cute_girl.png"},
    {"type": "text", "text": "Given the edit instruction: Change the color of her cloth to red, please identify the editing region"},
  ],
}]
output_text = model.generate(messages, max_new_tokens=512, for_edit=True, output_image_prefix="edit_round_0")

messages = [{
  "role": "HUMAN",
  "content": [
    {"type": "text", "text": "Change the color of her cloth to red."},
  ],
}]
output_text = model.generate(messages, max_new_tokens=512, for_edit=True, output_image_prefix="edit_round_1")

messages = [{
  "role": "HUMAN",
  "content": [
    {"type": "text", "text": "Refine the image for better clarity."},
  ],
}]
output_text = model.generate(messages, max_new_tokens=512, for_edit=True, output_image_prefix="edit_round_2")

model.reset_inner_state()

# single round text-based conversation
messages = [{
  "role": "HUMAN",
  "content": [
    {"type": "text", "text": "请详细介绍鹦鹉的习性。"},
  ],
}]

output_text = model.generate(messages, max_new_tokens=512)
print(output_text)
model.reset_inner_state()

📌 提示:

  • 图像生成:使用描述性提示词 + output_image_prefix 保存输出。
  • 图像理解:在同一条消息中包含 "image" 和 "text"。
  • 图像编辑:串联多个 generate(..., for_edit=True) 调用,并使用唯一的 output_image_prefix 名称。
  • 多轮交互通过内部状态支持——调用 model.reset_inner_state() 进行重置。
  • 输入类型:"text" 和 "image"——顺序灵活,允许混合输入。

📝 注意(模型局限性):

  • 当前模型 仅使用两轮对话进行训练,尚未针对图像理解与生成的交替轮次进行优化,尽管在推理时可能泛化到超过两轮。因此,在需要跨轮次深度上下文推理的复杂多模态对话场景中,性能可能受限。
  • 本开源版本 采用混合分辨率策略训练:图像理解使用高分辨率,但图像编辑和生成使用较低分辨率。此外,预训练期间未包含大规模交错图文数据。
  • 由于上述因素, 图像编辑质量和一致性可能欠佳 ,与完全端到端的高分辨率多模态模型相比。我们正在积极开发改进版本,采用统一分辨率训练和更丰富的交错数据。

注意:我们在 NVIDIA H800-80GB/H20-96G 硬件上使用 CUDA 12.4 测试了这些示例。

✍️ 引用

如果您发现我们的工作对您的研究或应用有帮助,请考虑引用:

@article{huang2025mingunivision,
  title={Ming-UniVision: Joint Image Understanding and Generation with a Unified Continuous Tokenizer},
  author={Huang, Ziyuan and Zheng, DanDan and Zou, Cheng and Liu, Rui and Wang, Xiaolong and Ji, Kaixiang and Chai, Weilong and Sun, Jianxin and Wang, Libin and Lv, Yongjie and Huang, Taozhi and Liu, Jiajia and Guo, Qingpei and Yang, Ming and Chen, Jingdong and Zhou, Jun},
  journal={arXiv preprint arXiv:2510.06590},
  year={2025}
}

关于

Ming-UniVision 的代码发布:使用连续统一 tokenizer 的联合图像理解与生成

主题

图像图像编辑图像生成图像理解统一模型

资源

自述文件MIT 许可证活动自定义属性

星标

144 星标

关注者

2 关注

分支

5 分支报告仓库

发布

软件包

使用者

贡献者

语言