inclusionAI/LLaDA2.0-Uni
LLaDA2.0-Uni: Understanding and Generation the World.
LLaDA2.0‑Uni – マルチモーダル理解と生成のための統合拡散LLM
概要 – LLaDA2.0‑Uniは、拡散ベースの大規模言語モデル(dLLM)とMixture‑of‑Expertsバックボーンを組み合わせた大規模マルチモーダルモデルです。単一の マスク・トークン予測 インターフェースを通じて、テキスト、画像、および画像編集の指示を処理します。このモデルは、視覚データを離散的な意味トークンに変換し(SigLIP‑VQトークナイザー経由)、高速な拡散デコーダー(8ステップ蒸留推論)でそれらのトークンをデコードします。
主な機能
- テキストから画像への生成 – 高品質な1024×1024画像。モデルの内部推論ステップを表示するオプションの「思考」モード。
- 画像理解 – 同じトークンベースのインターフェースを使用した視覚的質問応答と文書理解。
- 指示ガイド付き画像編集 – リクエストされた変更を適用しながら詳細を保持する、単一または複数の参照編集。
- インターリーブ生成と推論 – 統一されたトークン表現により、モデルは同じプロンプト内で画像の生成とそれに関する推論を切り替えることができます。
- SPRINT加速 – 推論時間を短縮するキャッシュ再利用および適応型アンマスキングスキーム(decoder‑turboによりデコードが最大約10倍高速化)。
- 統合フック – ComfyUI、Diffusers、および高スループットサービング用のSGLang‑Omni向けのすぐに使えるノード。
モデルアーキテクチャ
- LLaDA 2.0上に構築された統合dLLM‑MoEバックボーン。
- 画像をトークンシーケンスに変換する離散意味トークナイザー(SigLIP‑VQ)。
- 効率的な拡散デコーダー(標準の50ステップODEまたは蒸留された8ステップの「turbo」)。
はじめ方
# Clone & create environment
git clone https://github.com/inclusionAI/LLaDA2-Uni && cd LLaDA2-Uni
conda create -n llada2_uni python=3.10 -y && conda activate llada2_uni
# Install PyTorch (CUDA 12.4) and FlashAttention 2
pip install torch torchvision --index-url https://download.pytorch.org/whl/cu124
pip install flash-attn --no-build-isolation
# Install the rest of the dependencies
pip install -r requirements.txt
Pythonクイックスタート – 画像生成
from transformers import AutoModelForCausalLM, AutoTokenizer
from decoder import decode_vq_tokens
model_path = "inclusionAI/LLaDA2.0-Uni"
tokenizer = AutoTokenizer.from_pretrained(model_path, trust_remote_code=True)
model = AutoModelForCausalLM.from_pretrained(
model_path, device_map="cuda", torch_dtype="bfloat16", trust_remote_code=True
).eval()
model.tokenizer = tokenizer
result = model.generate_image(
"A modern Scandinavian kitchen with white cabinetry, marble countertops, and a single orchid on the island.",
image_h=1024, image_w=1024, steps=8, cfg_scale=2.0,
)
# Decode (8‑step turbo decoder for speed)
image = decode_vq_tokens(
result["token_ids"], result["h"], result["w"], model_path, "cuda",
num_steps=8, decode_mode="decoder-turbo",
)
image.save("kitchen.png")
画像理解の例
from encoder.image_tokenizer import ImageTokenizer
from decoder.smart_img_process import smart_resize_images
image_tokenizer = ImageTokenizer(model_path=model_path, device="cuda")
pil = smart_resize_images(["./assets/understanding_example.png"])[0]
info = image_tokenizer.encode_with_info(pil)
image_tokens = [t + model.config.image_token_offset for t in info["token_ids"]]
_, h, w = info["grid_thw"]
response = model.understand_image(
image_tokens, h, w,
question="Describe this image in detail.",
steps=32, gen_length=2048,
)
print(response)
画像編集の例
# Same tokenisation as above, then:
result = model.edit_image(
image_tokens, h, w,
instruction="Change the background to a beach.",
steps=8, cfg_text_scale=4.0,
)
edited = decode_vq_tokens(
result["token_ids"], result["h"], result["w"], model_path, "cuda",
num_steps=8, decode_mode="decoder-turbo",
)
edited.save("beach.png")
ComfyUI統合 – リポジトリをクローンした後、apps/comfyuiフォルダをComfyUIのcustom_nodesディレクトリにリンクします(または提供されているinstall.shを実行します)。このパッケージは、モデルのロード、テキストから画像への生成、画像理解、画像編集、およびトークンデコード用のノードを追加します。
SGLangサービング – リンクされているSGLang‑Omniクックブックを参照してください。同じ低遅延推論パスで多くの同時リクエストを処理できる、すぐに実行可能なサーバーが用意されています。
モデルチェックポイント – HuggingFaceおよびModelScopeで入手可能。フル精度バージョンとFP8量子化バージョンの両方があります。
ライセンス – Apache 2.0。
引用
@article{LLaDA2Uni,
title = {LLaDA2.0‑Uni: Unifying Multimodal Understanding and Generation with Diffusion Large Language Model},
author = {Tiwei Bie and Haoxing Chen and Tieyuan Chen and Zhenglin Cheng and Long Cui and Kai Gan and Zhicheng Huang and Zhenzhong Lan and Haoquan Li and Jianguo Li and Tao Lin and Qi Qin and Hongjun Wang and Xiaomei Wang and Haoyuan Wu and Yi Xin and Junbo Zhao},
journal = {arXiv preprint arXiv:2604.20796},
year = {2026}
}
LLaDA2.0‑Uniは、マルチモーダル知覚と拡散ベースの生成を単一のトークン予測モデルの下に統合し、高品質な画像合成、視覚的推論、または指示駆動型の編集を必要とする開発者に、高速でキャッシュ加速された推論を備えた多用途のツールボックスを提供します。
関連
- プロジェクト
- プロジェクト
- プロジェクト
- プロジェクト