tencent / HunyuanOCR

huggingface.co
Total runs: 932.3K
24-hour runs: 0
7-day runs: 9.9K
30-day runs: 251.8K
Model's Last Updated: August 29 2026
image-text-to-text

Introduction of HunyuanOCR

Model Details of HunyuanOCR

HunyuanOCR


🎯 Demo | 📥 Model Download | 📄 Technical Report | 🌟 Github

📖 Introduction

HunyuanOCR stands as a leading end-to-end OCR expert VLM powered by Hunyuan's native multimodal architecture. With a remarkably lightweight 1B parameter design, it has achieved multiple state-of-the-art benchmarks across the industry. The model demonstrates mastery in complex multilingual document parsing while excelling in practical applications including text spotting, open-field information extraction, video subtitle extraction, and photo translation .

🚀 Quick Start with Transformers
Installation
pip install git+https://github.com/huggingface/transformers@82a06db03535c49aa987719ed0746a76093b1ec4

Note : We will merge it into the Transformers main branch later.

Model Inference
from transformers import AutoProcessor
from transformers import HunYuanVLForConditionalGeneration
from PIL import Image
import torch

model_name_or_path = "tencent/HunyuanOCR"
processor = AutoProcessor.from_pretrained(model_name_or_path, use_fast=False)
img_path = "path/to/your/image.jpg"
image_inputs = Image.open(img_path)
messages1 = [
    {
        "role": "user",
        "content": [
            {"type": "image", "image": img_path},
            {"type": "text", "text": (
                "Extract all information from the main body of the document image "
                "and represent it in markdown format, ignoring headers and footers. "
                "Tables should be expressed in HTML format, formulas in the document "
                "should be represented using LaTeX format, and the parsing should be "
                "organized according to the reading order."
            )},
        ],
    }
]
messages = [messages1]
texts = [
    processor.apply_chat_template(msg, tokenize=False, add_generation_prompt=True)
    for msg in messages
]
inputs = processor(
    text=texts,
    images=image_inputs,
    padding=True,
    return_tensors="pt",
)
model = HunYuanVLForConditionalGeneration.from_pretrained(
    model_name_or_path,
    attn_implementation="eager",
    dtype=torch.bfloat16,
    device_map="auto"
)
with torch.no_grad():
    device = next(model.parameters()).device
    inputs = inputs.to(device)
    generated_ids = model.generate(**inputs, max_new_tokens=16384, do_sample=False)
if "input_ids" in inputs:
    input_ids = inputs.input_ids
else:
    print("inputs: # fallback", inputs)
    input_ids = inputs.inputs
generated_ids_trimmed = [
    out_ids[len(in_ids):] for in_ids, out_ids in zip(input_ids, generated_ids)
]
output_texts = processor.batch_decode(
    generated_ids_trimmed, skip_special_tokens=True, clean_up_tokenization_spaces=False
)
print(output_texts)
🚀 Quick Start with vLLM
Installation
pip install vllm --extra-index-url https://wheels.vllm.ai/nightly
Model Inference
from vllm import LLM, SamplingParams
from PIL import Image
from transformers import AutoProcessor

model_path = "tencent/HunyuanOCR"
llm = LLM(model=model_path)
processor = AutoProcessor.from_pretrained(model_path)
sampling_params = SamplingParams(temperature=0.0, max_tokens=16384)

img_path = "/path/to/image.jpg"
img = Image.open(img_path)
messages = [
    {"role": "user", "content": [
        {"type": "image", "image": img_path},
        {"type": "text", "text": "Detect and recognize text in the image, and output the text coordinates in a formatted manner."}
    ]}
]
prompt = processor.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
inputs = {"prompt": prompt, "multi_modal_data": {"image": [img]}}
output = llm.generate([inputs], sampling_params)[0]
print(output.outputs[0].text)
💬 Application-oriented Prompts
Task English Chinese
Spotting Detect and recognize text in the image, and output the text coordinates in a formatted manner. 检测并识别图片中的文字,将文本坐标格式化输出。
Parsing • Identify the formula in the image and represent it using LaTeX format.

• Parse the table in the image into HTML.

• Parse the chart in the image; use Mermaid format for flowcharts and Markdown for other charts.

• Extract all information from the main body of the document image and represent it in markdown format, ignoring headers and footers. Tables should be expressed in HTML format, formulas in the document should be represented using LaTeX format, and the parsing should be organized according to the reading order.
• 识别图片中的公式,用 LaTeX 格式表示。

• 把图中的表格解析为 HTML。

• 解析图中的图表,对于流程图使用 Mermaid 格式表示,其他图表使用 Markdown 格式表示。

• 提取文档图片中正文的所有信息用 markdown 格式表示,其中页眉、页脚部分忽略,表格用 html 格式表达,文档中公式用 latex 格式表示,按照阅读顺序组织进行解析。
Information Extraction • Output the value of Key.

• Extract the content of the fields: ['key1','key2', ...] from the image and return it in JSON format.

• Extract the subtitles from the image.
• 输出 Key 的值。

• 提取图片中的: ['key1','key2', ...] 的字段内容,并按照 JSON 格式返回。

• 提取图片中的字幕。
Translation First extract the text, then translate the text content into English. If it is a document, ignore the header and footer. Formulas should be represented in LaTeX format, and tables should be represented in HTML format. 先提取文字,再将文字内容翻译为英文。若是文档,则其中页眉、页脚忽略。公式用latex格式表示,表格用html格式表示。
📚 Citation

@misc{hunyuanocr2025, title={HunyuanOCR Technical Report}, author={Tencent Hunyuan Vision Team}, year={2025}, publisher={GitHub}, journal={GitHub repository}, howpublished={\url{ https://github.com/Tencent-Hunyuan/HunyuanOCR}} }

🙏 Acknowledgements

We would like to thank PaddleOCR , MinerU , MonkeyOCR , DeepSeek-OCR , dots.ocr for their valuable models and ideas. We also appreciate the benchmarks: OminiDocBench , OCRBench , DoTA .

Special thanks to vLLM Community for Day-0 inference support.

Runs of tencent HunyuanOCR on huggingface.co

932.3K
Total runs
0
24-hour runs
-5.3K
3-day runs
9.9K
7-day runs
251.8K
30-day runs

More Information About HunyuanOCR huggingface.co Model

HunyuanOCR huggingface.co

HunyuanOCR huggingface.co is an AI model on huggingface.co that provides HunyuanOCR's model effect (), which can be used instantly with this tencent HunyuanOCR model. huggingface.co supports a free trial of the HunyuanOCR model, and also provides paid use of the HunyuanOCR. Support call HunyuanOCR model through api, including Node.js, Python, http.

HunyuanOCR huggingface.co Url

https://huggingface.co/tencent/HunyuanOCR

tencent HunyuanOCR online free

HunyuanOCR huggingface.co is an online trial and call api platform, which integrates HunyuanOCR's modeling effects, including api services, and provides a free online trial of HunyuanOCR, you can try HunyuanOCR online for free by clicking the link below.

tencent HunyuanOCR online free url in huggingface.co:

https://huggingface.co/tencent/HunyuanOCR

HunyuanOCR install

HunyuanOCR is an open source model from GitHub that offers a free installation service, and any user can find HunyuanOCR on GitHub to install. At the same time, huggingface.co provides the effect of HunyuanOCR install, users can directly use HunyuanOCR installed effect in huggingface.co for debugging and trial. It also supports api for free installation.

HunyuanOCR install url in huggingface.co:

https://huggingface.co/tencent/HunyuanOCR

Url of HunyuanOCR

HunyuanOCR huggingface.co Url

Provider of HunyuanOCR huggingface.co

tencent
ORGANIZATIONS

Other API from tencent

huggingface.co

Total runs: 126.6K
Run Growth: 28.3K
Growth Rate: 22.32%
Updated:October 17 2025
huggingface.co

Total runs: 90.7K
Run Growth: -582.4K
Growth Rate: -642.43%
Updated:September 12 2025
huggingface.co

Total runs: 62.0K
Run Growth: 6.8K
Growth Rate: 11.03%
Updated:October 17 2025
huggingface.co

Total runs: 29.7K
Run Growth: 4.2K
Growth Rate: 14.01%
Updated:May 26 2026
huggingface.co

Total runs: 13.8K
Run Growth: 4.8K
Growth Rate: 34.56%
Updated:October 17 2025
huggingface.co

Total runs: 11.5K
Run Growth: -1.6K
Growth Rate: -13.97%
Updated:July 30 2025
huggingface.co

Total runs: 11.5K
Run Growth: -2.1K
Growth Rate: -18.21%
Updated:May 26 2026
huggingface.co

Total runs: 6.6K
Run Growth: -660
Growth Rate: -9.98%
Updated:January 01 2026
huggingface.co

Total runs: 4.3K
Run Growth: 4.0K
Growth Rate: 87.85%
Updated:September 10 2026
huggingface.co

Total runs: 2.9K
Run Growth: 115
Growth Rate: 3.95%
Updated:February 24 2026
huggingface.co

Total runs: 2.8K
Run Growth: 2.6K
Growth Rate: 86.10%
Updated:September 09 2026
huggingface.co

Total runs: 2.3K
Run Growth: -334
Growth Rate: -14.28%
Updated:December 30 2025
huggingface.co

Total runs: 1.9K
Run Growth: 1.1K
Growth Rate: 58.26%
Updated:March 06 2025
huggingface.co

Total runs: 1.6K
Run Growth: 690
Growth Rate: 42.67%
Updated:October 09 2026
huggingface.co

Total runs: 1.4K
Run Growth: 293
Growth Rate: 20.52%
Updated:October 17 2025
huggingface.co

Total runs: 1.1K
Run Growth: 151
Growth Rate: 13.96%
Updated:June 01 2026
huggingface.co

Total runs: 629
Run Growth: 48
Growth Rate: 7.63%
Updated:October 09 2026
huggingface.co

Total runs: 425
Run Growth: 102
Growth Rate: 24.00%
Updated:March 11 2026
huggingface.co

Total runs: 402
Run Growth: 164
Growth Rate: 40.80%
Updated:December 31 2025
huggingface.co

Total runs: 388
Run Growth: 85
Growth Rate: 21.91%
Updated:March 06 2026
huggingface.co

Total runs: 372
Run Growth: -3.0K
Growth Rate: -804.03%
Updated:September 15 2025