Instructions to use MSALab/PerceptionDLM with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use MSALab/PerceptionDLM with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="MSALab/PerceptionDLM", trust_remote_code=True) messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] pipe(text=messages)# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("MSALab/PerceptionDLM", trust_remote_code=True, dtype="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use MSALab/PerceptionDLM with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "MSALab/PerceptionDLM" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "MSALab/PerceptionDLM", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }'Use Docker
docker model run hf.co/MSALab/PerceptionDLM
- SGLang
How to use MSALab/PerceptionDLM 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 "MSALab/PerceptionDLM" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "MSALab/PerceptionDLM", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }'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 "MSALab/PerceptionDLM" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "MSALab/PerceptionDLM", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }' - Docker Model Runner
How to use MSALab/PerceptionDLM with Docker Model Runner:
docker model run hf.co/MSALab/PerceptionDLM
PerceptionDLM
PerceptionDLM is a multimodal diffusion language model optimized for efficient parallel region perception. Built upon PerceptionDLM-Base, it fully leverages the parallel decoding nature of diffusion language models (DLMs): given an image and multiple region masks, it generates descriptions for all regions simultaneously within a single denoising process — avoiding the linear latency growth of autoregressive (AR) region captioners.
To the best of our knowledge, this is the first model to achieve parallel region captioning and perception by leveraging the advantages of diffusion language models.
📄 Paper | 💻 Code | 📊 ParaDLC-Bench
Highlights
- 🧩 Parallel region captioning. Region prompting + structured attention masking describe many masked regions in a single denoising pass.
- ⚡ Up to 3.44× throughput speedup in dense multi-region scenarios, with stable per-image latency (~2.9s).
- 🎯 Competitive quality with strong AR region captioners while being substantially faster.
Model Details
| Base model | MSALab/PerceptionDLM-Base |
| Key modules | Region prompting, RoI-aligned feature replay, structured attention masking |
| Region prompts | up to 6 per image |
| Default inference | 32 diffusion steps, generation length 32 per mask |
| Training | full ParaCaption corpus, ~2 days on 32× H100 |
| Precision | bfloat16 |
Results (ParaDLC-Bench)
| Method | Type | Avg (%) | TPF ↑ | Time (s) ↓ |
|---|---|---|---|---|
| GAR-8B | AR (sequential) | 69.5 | 1.0 | 479 |
| LLaDA-V-8B | Diffusion | 35.2 | 1.0 | 3241 |
| PerceptionDLM | Diffusion (parallel) | 62.4 | 2.9 | 276 |
TPF = Tokens Per Forward (higher = more parallel). PerceptionDLM nearly doubles the accuracy of prior diffusion VLMs while drastically reducing inference time.
Usage
Full inference scripts are provided in the GitHub repository.
python demo/infer_pdmllm.py \
--model-path MSALab/PerceptionDLM \
--image assets/demo.jpg \
--masks assets/demo_mask_0.jpg \
assets/demo_mask_1.jpg \
assets/demo_mask_2.jpg \
--gen-length 32 --steps 32 --temperature 0.0 --top-p 1.0
The model takes an RGB image plus one or more binary masks, and returns one caption per region — all generated in parallel.
Citation
@article{sun2026perceptiondlm,
title = {PerceptionDLM: Parallel Region Perception with Multimodal Diffusion Language Models},
author = {Sun, Yueyi and Wang, Yuhao and Li, Jason and Tian, Ye and Zhang, Tao and Mai, Jacky and Wang, Yihan and Wang, Haochen and Bai, Jinbin and Yang, Ling and Tong, Yunhai},
journal = {arXiv preprint arXiv:2606.19534},
year = {2026}
}
License
Released under the Apache License 2.0.
- Downloads last month
- -
Model tree for MSALab/PerceptionDLM
Base model
MSALab/PerceptionDLM-Base