Instructions to use zwning/ThinkUnify-7B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use zwning/ThinkUnify-7B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="zwning/ThinkUnify-7B")# pip install -U transformers accelerate # Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("zwning/ThinkUnify-7B", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use zwning/ThinkUnify-7B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "zwning/ThinkUnify-7B" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "zwning/ThinkUnify-7B", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/zwning/ThinkUnify-7B
- SGLang
How to use zwning/ThinkUnify-7B with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "zwning/ThinkUnify-7B" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "zwning/ThinkUnify-7B", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "zwning/ThinkUnify-7B" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "zwning/ThinkUnify-7B", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use zwning/ThinkUnify-7B with Docker Model Runner:
docker model run hf.co/zwning/ThinkUnify-7B
ThinkUnify-7B
A Unified Multimodal Framework for Multi-Round Interleaved Visual Reasoning with Efficient Distillation
ThinkUnify-7B is a unified vision-language model that bridges image understanding and image generation inside a single Mixture-of-Transformers (MoT) backbone, enabling coherent multi-round interleaved visual reasoning (text โ image thinking) and high-quality image synthesis. It extends the BAGEL-7B-MoT architecture with three components that make unified interleaved reasoning both accurate and fast.
- ๐ป Code: https://github.com/pami-zwning/ThinkUnify
- ๐ Training data: zwning/ThinkUnify-Train
- ๐งฉ Base model: ByteDance-Seed/BAGEL-7B-MoT
Highlights
- Q-Proj โ a Q-Former-based projection module that aligns VAE latent features with the SigLIP understanding space, eliminating the decode-re-encode bottleneck in multi-round reasoning.
- ITD (Incremental Timestep Distillation) โ compresses 50-step ODE solving into ~8 steps via online self-distillation, enabling interactive-speed generation within the unified 7B backbone.
- ReAL (Reconstruction Alignment Loss) โ enforces spatial-gradient and spectral-magnitude fidelity on predicted VAE latents, improving both generation quality and downstream reasoning.
Model Details
| Architecture | Mixture-of-Transformers (MoT), based on BAGEL-7B-MoT |
| Understanding encoder | SigLIP ViT (NaViT variable-resolution) |
| Generation | VAE + Flow Matching (Euler ODE), dual CFG / APG guidance |
| Parameters | ~7B |
| Precision | bf16 |
| Training | FSDP (FULL_SHARD), fine-tuned from BAGEL-7B-MoT on the 123K interleaved-reasoning SFT set |
| License | Apache-2.0 |
The MoT backbone processes a packed sequence of text tokens, ViT understanding tokens, and VAE generation tokens: all tokens share multi-head self-attention while routing through modality-specific feed-forward experts. Q-Proj bridges the generation and understanding pathways, ITD accelerates denoising with shortcut velocities, and ReAL sharpens the predicted clean latent.
Results
General Multimodal Understanding
| Model | AI2D | ChartQA | MathVista | MMMU | MMStar | RealWorldQA | VStar | Overall |
|---|---|---|---|---|---|---|---|---|
| BAGEL-7B | 74.6 | 79.1 | 54.8 | 49.9 | 49.1 | 50.1 | 55.5 | 59.0 |
| ThinkUnify-7B | 77.5 | 81.0 | 67.1 | 50.0 | 60.3 | 62.6 | 63.9 | 65.5 |
Text-to-Image Generation (GenEval)
| Model | Single | Two | Counting | Colors | Position | Color Attr. | Overall |
|---|---|---|---|---|---|---|---|
| BAGEL | 100 | 96 | 76 | 86 | 52 | 68 | 81 |
| ThinkUnify-7B | 99 | 95 | 91 | 88 | 60 | 75 | 85 |
Interleaved Reasoning (MIRA / UniMMMU / RealUnify)
| Model | MIRA | UniMMMU Avg | RealUnify Avg | Overall |
|---|---|---|---|---|
| BAGEL-7B | 8.8 | 22.8 | 33.3 | 21.6 |
| ThinkUnify-7B (Ours) | 13.6 | 35.0 | 34.8 | 27.8 |
Usage
Clone the code repo and point it at this checkpoint plus the BAGEL-7B-MoT config.
# 1. Download weights
huggingface-cli download ByteDance-Seed/BAGEL-7B-MoT --local-dir ./checkpoints/BAGEL-7B-MoT
huggingface-cli download zwning/ThinkUnify-7B --local-dir ./checkpoints/ThinkUnify-7B
# 2. Run evaluation (MIRA / GenEval / MathVista)
export MODEL_PATH=./checkpoints/ThinkUnify-7B
export BAGEL_CONFIG_PATH=./checkpoints/BAGEL-7B-MoT # llm_config.json, vit_config.json, ae.safetensors
export EVAL_DATA_ROOT=/abs/path/to/ThinkUnify_eval
export PYTHON_EXE=$(which python)
bash scripts/thinkunify_eval_srun.sh MIRA GenEval MathVista
See the GitHub repository for environment setup, training, and full evaluation instructions.
Note:
BAGEL_CONFIG_PATHmust point to the BAGEL-7B-MoT directory, which providesllm_config.json,vit_config.json, andae.safetensorsused to build the model.
Intended Use & Limitations
ThinkUnify-7B is a research model for unified multimodal understanding, generation, and interleaved visual reasoning. It inherits the capabilities and limitations of its BAGEL-7B-MoT base and SigLIP/VAE components, and may produce factually incorrect text or imperfect images. It is not intended for safety-critical use. Generated images may reflect biases present in the pretraining and SFT data.
Citation
@article{thinkunify2026,
title={ThinkUnify: A Unified Multimodal Framework for Multi-Round Visual Understanding and Generation with Efficient Distillation},
author={Zhiwei Ning and Bingkun Nian and Xuanang Gao and Jie Yang and Wei Liu},
journal={IJCV},
year={2026}
}
License
Released under the Apache-2.0 license. Built on BAGEL; please also comply with the licenses of the base model and upstream components.