Accept the Tencent Hunyuan 3D 2.1 Community License Agreement to access these files
This repository is publicly accessible, but you have to accept the conditions to access its files and content.
These files are modified Tencent Hunyuan 3D 2.1 Works, licensed under the Tencent Hunyuan 3D 2.1 Community License Agreement (LICENSE.txt in every folder), including its Acceptable Use Policy (Exhibit A). The license does not apply in the European Union, the United Kingdom or South Korea: you may not use, reproduce, modify, distribute or display these files or their outputs there (Section 5.c). Products or services with more than 1 million monthly active users need a separate license from Tencent (Section 4).
Log in or Sign Up to review the conditions and access this model content.
Hunyuan3D-2.1 ONNX
ONNX builds of Hunyuan3D-2.1, made by Moonbox for on-device use with ONNX Runtime (CPU, CUDA, DirectML). Each
precision is one folder holding the graphs and a small Python pipeline.py that does the rest (image preprocessing,
the sampling loop, mesh extraction); what the graphs take and return is under How to run.
Files
The last column is the benchmark against the original PyTorch model (details under How to run): how closely each mesh matches the original's, made from the same pictures and the same starting noise.
| Precision | File | Size | sha256 | Benchmark |
|---|---|---|---|---|
| fp16 | fp16/LICENSE.txt |
17.9 kB | 5bd08f93b2d2 |
F-score@0.01 vs the original's mesh 0.999 / 0.950 / 0.995 (original bf16 vs fp16: 0.836 / 0.896 / 0.968); ~290 s per mesh (CUDA; original ~145 s) |
| fp16 | fp16/NOTICE.txt |
0.4 kB | 8d43ad886429 |
F-score@0.01 vs the original's mesh 0.999 / 0.950 / 0.995 (original bf16 vs fp16: 0.836 / 0.896 / 0.968); ~290 s per mesh (CUDA; original ~145 s) |
| fp16 | fp16/TENCENT_NOTICE.txt |
16.6 kB | ffccf6b539a8 |
F-score@0.01 vs the original's mesh 0.999 / 0.950 / 0.995 (original bf16 vs fp16: 0.836 / 0.896 / 0.968); ~290 s per mesh (CUDA; original ~145 s) |
| fp16 | fp16/cond.onnx |
0.6 MB | 29c73b7e93dc |
F-score@0.01 vs the original's mesh 0.999 / 0.950 / 0.995 (original bf16 vs fp16: 0.836 / 0.896 / 0.968); ~290 s per mesh (CUDA; original ~145 s) |
| fp16 | fp16/cond.onnx.data |
608.7 MB | 542582ee5f81 |
F-score@0.01 vs the original's mesh 0.999 / 0.950 / 0.995 (original bf16 vs fp16: 0.836 / 0.896 / 0.968); ~290 s per mesh (CUDA; original ~145 s) |
| fp16 | fp16/dit.onnx |
0.8 MB | 0b4ca21b29e8 |
F-score@0.01 vs the original's mesh 0.999 / 0.950 / 0.995 (original bf16 vs fp16: 0.836 / 0.896 / 0.968); ~290 s per mesh (CUDA; original ~145 s) |
| fp16 | fp16/dit.onnx.data |
6.10 GB | a26cbd61aa52 |
F-score@0.01 vs the original's mesh 0.999 / 0.950 / 0.995 (original bf16 vs fp16: 0.836 / 0.896 / 0.968); ~290 s per mesh (CUDA; original ~145 s) |
| fp16 | fp16/geo.onnx |
22.1 kB | af8289b7e689 |
F-score@0.01 vs the original's mesh 0.999 / 0.950 / 0.995 (original bf16 vs fp16: 0.836 / 0.896 / 0.968); ~290 s per mesh (CUDA; original ~145 s) |
| fp16 | fp16/geo.onnx.data |
25.3 MB | 475e15e52d8a |
F-score@0.01 vs the original's mesh 0.999 / 0.950 / 0.995 (original bf16 vs fp16: 0.836 / 0.896 / 0.968); ~290 s per mesh (CUDA; original ~145 s) |
| fp16 | fp16/pipeline.py |
8.0 kB | c67147d8fa9d |
F-score@0.01 vs the original's mesh 0.999 / 0.950 / 0.995 (original bf16 vs fp16: 0.836 / 0.896 / 0.968); ~290 s per mesh (CUDA; original ~145 s) |
| fp16 | fp16/vae.onnx |
0.3 MB | 9695ae0af236 |
F-score@0.01 vs the original's mesh 0.999 / 0.950 / 0.995 (original bf16 vs fp16: 0.836 / 0.896 / 0.968); ~290 s per mesh (CUDA; original ~145 s) |
| fp16 | fp16/vae.onnx.data |
403.1 MB | 3806ab662a4f |
F-score@0.01 vs the original's mesh 0.999 / 0.950 / 0.995 (original bf16 vs fp16: 0.836 / 0.896 / 0.968); ~290 s per mesh (CUDA; original ~145 s) |
| int8 | int8/LICENSE.txt |
17.9 kB | 5bd08f93b2d2 |
DiT MatMuls 8-bit: F-score 0.996 / 0.927 / 0.981; ~290 s per mesh (CUDA) |
| int8 | int8/NOTICE.txt |
0.4 kB | 8d43ad886429 |
DiT MatMuls 8-bit: F-score 0.996 / 0.927 / 0.981; ~290 s per mesh (CUDA) |
| int8 | int8/TENCENT_NOTICE.txt |
16.6 kB | ffccf6b539a8 |
DiT MatMuls 8-bit: F-score 0.996 / 0.927 / 0.981; ~290 s per mesh (CUDA) |
| int8 | int8/cond.onnx |
0.6 MB | 29c73b7e93dc |
DiT MatMuls 8-bit: F-score 0.996 / 0.927 / 0.981; ~290 s per mesh (CUDA) |
| int8 | int8/cond.onnx.data |
608.7 MB | 542582ee5f81 |
DiT MatMuls 8-bit: F-score 0.996 / 0.927 / 0.981; ~290 s per mesh (CUDA) |
| int8 | int8/dit.onnx |
0.9 MB | d64861cd7b36 |
DiT MatMuls 8-bit: F-score 0.996 / 0.927 / 0.981; ~290 s per mesh (CUDA) |
| int8 | int8/dit.onnx.data |
3.24 GB | 185c176410e0 |
DiT MatMuls 8-bit: F-score 0.996 / 0.927 / 0.981; ~290 s per mesh (CUDA) |
| int8 | int8/geo.onnx |
22.1 kB | af8289b7e689 |
DiT MatMuls 8-bit: F-score 0.996 / 0.927 / 0.981; ~290 s per mesh (CUDA) |
| int8 | int8/geo.onnx.data |
25.3 MB | 475e15e52d8a |
DiT MatMuls 8-bit: F-score 0.996 / 0.927 / 0.981; ~290 s per mesh (CUDA) |
| int8 | int8/pipeline.py |
8.0 kB | c67147d8fa9d |
DiT MatMuls 8-bit: F-score 0.996 / 0.927 / 0.981; ~290 s per mesh (CUDA) |
| int8 | int8/vae.onnx |
0.3 MB | 9695ae0af236 |
DiT MatMuls 8-bit: F-score 0.996 / 0.927 / 0.981; ~290 s per mesh (CUDA) |
| int8 | int8/vae.onnx.data |
403.1 MB | 3806ab662a4f |
DiT MatMuls 8-bit: F-score 0.996 / 0.927 / 0.981; ~290 s per mesh (CUDA) |
How to run
Hunyuan3D-2.1's shape model (Tencent: one image to a 3D mesh; a 3.3B flow-matching DiT with mixture-of-experts layers
over a ShapeVAE's latents, conditioned on DINOv2 image features) as four ONNX graphs plus pipeline.py, a numpy
runtime that reproduces the official Hunyuan3DDiTFlowMatchingPipeline. The texture (PBR paint) model is not
included: the meshes come out untextured.
License limits. The Tencent Hunyuan 3D 2.1 Community License (LICENSE.txt in every folder) does not apply in
the European Union, the United Kingdom or South Korea: these files and their outputs may not be used there. Its
Acceptable Use Policy applies, and products or services with more than 1 million monthly active users need a
separate license from Tencent. Access is gated on accepting it. NOTICE.txt carries the required notice;
TENCENT_NOTICE.txt is the original's Notice.txt (its third-party components).
The graphs.
cond.onnx: DINOv2-L at 518 px,image[1, 3, 512, 512] in [-1, 1] ->cond[1, 1370, 1024] (fp32 out).dit.onnx:latents[B, 4096, 64],t[B] (timestep / 1000),cond[B, 1370, 1024] ->velocity[B, 4096, 64], fp16. B = 2 with classifier-free guidance; the unconditional row gets an all-zero condition. Its attention is ONNX Runtime'scom.microsoftMultiHeadAttention, fused on CUDA. The MoE layers run every expert weighted by the gate (zero outside the top 2): the same result as the original's routing, without data-dependent shapes.vae.onnx:latents[1, 4096, 64] ->decoded[1, 4096, 1024], the ShapeVAE's transformer. Once per mesh.geo.onnx:queries[1, N, 3],latents(decoded) -> occupancylogits[1, N] (fp32, > 0 inside), for points in [-1.01, 1.01]^3.
pipeline.py does the rest in numpy:
- Input: an RGBA picture with the object matted (or RGB, used whole). The repository removes backgrounds with BRIA RMBG-1.4, a separately licensed model that is not included; any matting model works. As the original: the alpha's bounding box recentred with a 15 % border, composited on white, 512 px (OpenCV).
- Sampling: 50 flow-matching Euler steps with guidance 5, the scheduler's arithmetic (fp32 sample, fp16 velocity).
- Mesh: occupancy on a 385^3 grid in chunks, marching cubes at level 0 (scikit-image, Lewiner).
It needs numpy, onnxruntime-gpu (or onnxruntime), opencv-python, scikit-image and Pillow; trimesh saves the mesh.
import sys
from PIL import Image
sys.path.insert(0, "fp16")
import pipeline, trimesh
hy = pipeline.Hunyuan3DShape("fp16", "cuda")
v, f = hy(Image.open("object_rgba.png"), seed=1234)
trimesh.Trimesh(v, f).export("object.glb")
Or: python fp16/pipeline.py object_rgba.png object.glb --cuda --seed 1234. Noise comes from numpy's generator, so a
seed doesn't reproduce the PyTorch pipeline's shape; sample(cond, noise=...) takes your own. The original's
octree / "flash" extraction paths aren't ported; this is its plain grid extraction. Sessions are opened with graph
optimization at the basic level and loaded one at a time; on Windows the CUDA sessions get the run option
memory.enable_memory_arena_shrinkage = gpu:0, as pipeline.py does.
Precisions.
fp16/: every graph fp16, as the original runs (the DiT exported from the fp16 checkpoint).int8/: the DiT's MatMuls (attention, MLPs, every MoE expert) 8-bit MatMulNBits (block 32); the other graphs asfp16/.- No int4: tried (the DiT 4-bit) and far below the pass mark (below). No bf16: fp16 passes.
Running it. About 9 GB of system memory on Windows (where GPU allocations count toward it). On an RTX 3080 Laptop
GPU a mesh takes about 290 s with fp16/ or int8/: about 110 s for the 100 DiT evaluations and 170 s for the
385^3 occupancy grid. The original takes about 145 s on the same machine (61 s + 82 s).
Benchmark.
- Inputs: the repository's demo picture and two of its example pictures (052, 1008), all with alpha.
- Settings: seed 1234, 50 steps, guidance 5, the original's own starting noise, the same 385^3 grid extraction for both sides.
- Original:
Hunyuan3DDiTFlowMatchingPipeline(GitHub @ 82920d6) in float16 on CUDA, as it runs. - Score: F-score at 0.01 between each mesh and the original's, on 200k surface samples (the shapes span about 2 units): the share of each surface within 0.01 of the other, the harmonic mean of both directions. Also the occupancy IoU on the grid.
- Pass mark: on every picture, at least as close as the original's own bfloat16 run (same noise) is to its float16 run. The float32 original doesn't fit this machine's memory.
| F-score: demo / 052 / 1008 | grid IoU: demo / 052 / 1008 | |
|---|---|---|
| original in bf16 (PyTorch, CUDA) | 0.836 / 0.896 / 0.968 | 0.957 / 0.955 / 0.977 |
fp16/ |
0.999 / 0.950 / 0.995 | 0.994 / 0.978 / 0.988 |
int8/ |
0.996 / 0.927 / 0.981 | 0.988 / 0.968 / 0.983 |
| int4 (not published) | 0.242 / 0.618 / 0.577 | 0.837 / 0.881 / 0.912 |
The VAE and occupancy graphs alone, from the original's latents, give 0.9999 / 0.985 / 0.9999 (grid IoU >= 0.9998). Before the benchmark each graph was checked against its PyTorch module: the conditioner's features at cosine
= 0.99996, the DiT's velocity at 0.99995, the VAE's output at ~1.0, the occupancy signs 100 % equal.
How these were made
From Hunyuan3D-2.1 at revision 0b94677654. The graphs were exported from the original PyTorch modules with
torch.onnx (opset 17 / 18) and checked against them. Weight-only quantization: int8 is a per-output-channel int8
weight behind DequantizeLinear, int4 is ONNX Runtime's MatMulNBits (block 32). Each card above says which precision
every graph uses. Every precision was benchmarked against the original before upload (the pass mark is under How to run), and the
sha256 column above is what the files must hash to.
License
Tencent Hunyuan Community (region-restricted). These files are a derivative of the original model and carry its license: it is copied in this repository, and it governs your use of these files. The original model card follows unchanged.
Original model card
π BibTeX
If you found this repository helpful, please cite our report:
@misc{hunyuan3d2025hunyuan3d,
title={Hunyuan3D 2.1: From Images to High-Fidelity 3D Assets with Production-Ready PBR Material},
author={Team Hunyuan3D and Shuhui Yang and Mingxin Yang and Yifei Feng and Xin Huang and Sheng Zhang and Zebin He and Di Luo and Haolin Liu and Yunfei Zhao and Qingxiang Lin and Zeqiang Lai and Xianghui Yang and Huiwen Shi and Zibo Zhao and Bowen Zhang and Hongyu Yan and Lifu Wang and Sicong Liu and Jihong Zhang and Meng Chen and Liang Dong and Yiwen Jia and Yulin Cai and Jiaao Yu and Yixuan Tang and Dongyuan Guo and Junlin Yu and Hao Zhang and Zheng Ye and Peng He and Runzhou Wu and Shida Wei and Chao Zhang and Yonghao Tan and Yifu Sun and Lin Niu and Shirui Huang and Bojian Zheng and Shu Liu and Shilin Chen and Xiang Yuan and Xiaofeng Yang and Kai Liu and Jianchen Zhu and Peng Chen and Tian Liu and Di Wang and Yuhong Liu and Linus and Jie Jiang and Jingwei Huang and Chunchao Guo},
year={2025},
eprint={2506.15442},
archivePrefix={arXiv},
primaryClass={cs.CV}
}
@misc{hunyuan3d22025tencent,
title={Hunyuan3D 2.0: Scaling Diffusion Models for High Resolution Textured 3D Assets Generation},
author={Tencent Hunyuan3D Team},
year={2025},
eprint={2501.12202},
archivePrefix={arXiv},
primaryClass={cs.CV}
}
@misc{yang2024tencent,
title={Tencent Hunyuan3D-1.0: A Unified Framework for Text-to-3D and Image-to-3D Generation},
author={Tencent Hunyuan3D Team},
year={2024},
eprint={2411.02293},
archivePrefix={arXiv},
primaryClass={cs.CV}
}
Acknowledgements
We would like to thank the contributors to the TripoSG, DINOv2, Stable Diffusion, FLUX, diffusers and HuggingFace repositories, for their open research and exploration.
Star History
Model tree for moonbox-dev/Hunyuan3D-2.1-ONNX
Base model
tencent/Hunyuan3D-2.1