This is the
FP8 quantized version of
LLaDA2.0-Uni, featuring block-wise FP8 quantization of MoE expert weights. This reduces GPU memory usage by ~48% for model loading while preserving output quality.
1from transformers import AutoModelForCausalLM, AutoTokenizer
2
3model_path = "inclusionAI/LLaDA2.0-Uni-FP8"
4
5tokenizer = AutoTokenizer.from_pretrained(model_path, trust_remote_code=True)
6model = AutoModelForCausalLM.from_pretrained(
7 model_path, device_map="cuda", trust_remote_code=True
8).eval()
9model.tokenizer = tokenizer
10
11# Text-to-Image Generation
12result = model.generate_image(
13 "A cat sitting on a windowsill at sunset",
14 image_h=1024, image_w=1024,
15 steps=16, cfg_scale=4.0,
16)
17
18# Decode VQ tokens to image
19from decoder import decode_vq_tokens
20image = decode_vq_tokens(
21 result["token_ids"], result["h"], result["w"],
22 model_path, "cuda",
23 num_steps=8, decode_mode="decoder-turbo",
24)
25image.save("output.png")
This project is licensed under the terms of the
Apache License 2.0.
1@article{LLaDA2Uni,
2title = {LLaDA2.0-Uni: Unifying Multimodal Understanding and Generation with Diffusion Large Language Model},
3author = {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},
4journal = {arXiv preprint arXiv:2604.20796},
5year = {2026}
6}