Image-to-3D
TensorRT
moonbox
hunyuan3d
hunyuan3d-2.1
3d
mesh
flow-matching

Run this model with HF Jobs

Run moonbox-dev/Hunyuan3D-2.1-TensorRT on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.

Paste one of these prompts into your coding agent:

Fine-tune on my dataset

Use HF Jobs to fine-tune https://huggingface.co/moonbox-dev/Hunyuan3D-2.1-TensorRT. Ask me which dataset to train on, then push the fine-tuned model to a new private model repo. Run `hf jobs --help` first to learn the CLI.

Run batch inference

Use HF Jobs to run batch inference with https://huggingface.co/moonbox-dev/Hunyuan3D-2.1-TensorRT on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.

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 TensorRT

TensorRT engines of Hunyuan3D-2.1, made by Moonbox for NVIDIA RTX GPUs. Each precision is one folder holding the engine, trt_runner.py (a small numpy runner: TensorRT plus Polygraphy, no PyTorch) and a script that does the rest of the pipeline. What the engine takes and returns is under How to run.

Compatibility. The engines are built hardware compatible (Ampere and newer: RTX 30, 40 and 50 series) and version compatible (any TensorRT 10.x from 10.13 on, through its lean runtime). That costs a little speed against an engine built for one GPU, but no rebuild is needed. Install the runtime with pip install "tensorrt-cu12>=10.13,<11" "tensorrt-lean-cu12>=10.13,<11" polygraphy numpy.

Files

The last column is the benchmark (details under How to run).

Precision File Size sha256 Benchmark
fp16 fp16/LICENSE.txt 17.9 kB 5bd08f93b2d2 F-score@0.01 vs the original's mesh 0.9998 / 0.940 / 0.997 (ONNX fp16 0.999 / 0.950 / 0.995; original bf16 0.836 / 0.896 / 0.968); VAE + occupancy alone 0.9999 / 0.985 / 0.9999, grid IoU vs the ONNX fp16 build 0.9999 / 0.9997 / 0.9998; ~160 s per mesh (ONNX fp16 ~290 s)
fp16 fp16/NOTICE.txt 0.4 kB a2a58de0528f (the same build: numbers in its first row)
fp16 fp16/TENCENT_NOTICE.txt 16.6 kB ffccf6b539a8 (the same build: numbers in its first row)
fp16 fp16/cond.engine 687.7 MB 3d926086c3b0 (the same build: numbers in its first row)
fp16 fp16/device_chain.py 8.3 kB e675d2e7e2d1 (the same build: numbers in its first row)
fp16 fp16/dit_0.engine 636.7 MB 8a0f20fefcc6 (the same build: numbers in its first row)
fp16 fp16/dit_1.engine 699.7 MB 460962c69e60 (the same build: numbers in its first row)
fp16 fp16/dit_2.engine 767.3 MB 6f996bdc6fa4 (the same build: numbers in its first row)
fp16 fp16/dit_3.engine 732.8 MB cb5264903868 (the same build: numbers in its first row)
fp16 fp16/dit_4.engine 738.3 MB f533cb2a6548 (the same build: numbers in its first row)
fp16 fp16/dit_5.engine 738.3 MB 4bd7f0a2267e (the same build: numbers in its first row)
fp16 fp16/dit_6.engine 738.3 MB 6bb839bf13f0 (the same build: numbers in its first row)
fp16 fp16/dit_7.engine 738.3 MB 9a20d85f5dc6 (the same build: numbers in its first row)
fp16 fp16/dit_8.engine 738.3 MB dbc88a897170 (the same build: numbers in its first row)
fp16 fp16/dit_9.engine 181.6 MB 5175f88681ed (the same build: numbers in its first row)
fp16 fp16/dit_split.json 5.1 kB 16fc6873af38 (the same build: numbers in its first row)
fp16 fp16/geo.engine 73.1 MB 72c6d36253a9 (the same build: numbers in its first row)
fp16 fp16/pipeline.py 8.0 kB c67147d8fa9d (the same build: numbers in its first row)
fp16 fp16/pipeline_trt.py 3.3 kB 36053950b0bf (the same build: numbers in its first row)
fp16 fp16/trt_runner.py 4.4 kB cbc9abb1f59c (the same build: numbers in its first row)
fp16 fp16/vae.engine 490.5 MB 8a7d4845666a (the same build: numbers in its first row)

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 TensorRT engines built from this model's fp16 ONNX graphs, plus pipeline_trt.py. The pipeline is the ONNX build's pipeline.py (the official Hunyuan3DDiTFlowMatchingPipeline ported to numpy) with every graph run as engines. 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 the 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).

import sys
from PIL import Image
sys.path.insert(0, "fp16")
import trimesh
from pipeline_trt import Hunyuan3DShapeTrt
hy = Hunyuan3DShapeTrt("fp16")
v, f = hy(Image.open("object_rgba.png"), seed=1234)
trimesh.Trimesh(v, f).export("object.glb")

Or python fp16/pipeline_trt.py object_rgba.png object.glb --seed 1234. It needs numpy, opencv-python, scikit-image, Pillow, TensorRT 10.13 (tensorrt-cu12 or tensorrt-lean-cu12) and Polygraphy; trimesh saves the mesh. No PyTorch and no ONNX Runtime. The input is an RGBA picture with the object matted (or RGB, used whole), as for the ONNX build. The engines are version-compatible and built for Ampere or newer GPUs (RTX 30-series and up).

The engines.

  • cond.engine: DINOv2-L, image [1, 3, 512, 512] in [-1, 1] -> cond [1, 1370, 1024].
  • dit_0..9.engine: the DiT (dit_split.json), latents [2, 4096, 64], t [2], cond [2, 1370, 1024] -> velocity: the guidance pair (the condition and an all-zero one) in one batch. Cut into pieces of at most 0.7 GB of weights, so that each engine builds within the build machine's memory; the tensors between pieces stay on the GPU. The MoE layers run every expert weighted by the gate (zero outside the top 2), as in the ONNX graph.
  • vae.engine: latents [1, 4096, 64] -> decoded [1, 4096, 1024], once per mesh.
  • geo.engine: queries [1, N, 3] (N <= 16,384), latents (decoded) -> occupancy logits [1, N]. The 385^3 grid is queried in chunks of 16,384 points (the ONNX pipeline: 8,000; each point is computed on its own).

Each graph's engines are loaded for its stage and released after it, as the ONNX build does with its sessions.

Changes from the ONNX graphs. The attention, exported as ONNX Runtime's com.microsoft MultiHeadAttention, is written as standard ops (MatMul, Softmax, MatMul), which TensorRT fuses into its own attention kernels. Everything else is strongly typed: every tensor keeps the precision the ONNX graph gives it (fp16, as the original runs). No int8: TensorRT's int8 needs calibrated activations, and the ONNX int8/ build is weight-only MatMulNBits, which TensorRT doesn't take.

Running it. On an RTX 3080 Laptop GPU a mesh takes about 160 s: about 87 s for the 100 DiT evaluations and 67 s for the 385^3 occupancy grid (the ONNX fp16 build: about 290 s, 110 s + 170 s; the original PyTorch pipeline about 145 s). It needs more memory than the ONNX build: the benchmark's process peaked at 11.5-11.7 GB of system memory on Windows, GPU memory included (the ONNX fp16 build: 7-9 GB), as the DiT's engines (6.7 GB) are all loaded during sampling. The engines hold 8.0 GB.

Benchmark.

  • Setup: the ONNX build's benchmark. The repository's demo picture and two of its example pictures (052, 1008), 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). Also the latents' SNR against the original's and, from the original's latents, the VAE and occupancy engines alone.
  • Pass mark (set before the first run), per picture against the ONNX fp16 build: condition cosine within 0.0001, latent SNR at most 3 dB lower, the VAE + occupancy F-score at most 0.01 lower, the end-to-end F-score at most 0.03 lower, and grid IoU from the original's latents at most 0.005 lower. The original's own grids were no longer kept when the engines were benchmarked, so that IoU is against the ONNX fp16 build's grid instead (at least 0.995).
F-score: demo / 052 / 1008 latent SNR (dB) VAE + occupancy alone: F-score seconds per mesh
original in bf16 (PyTorch, CUDA) 0.836 / 0.896 / 0.968 - - -
ONNX fp16/ (ONNX Runtime CUDA) 0.999 / 0.950 / 0.995 20.7 / 12.5 / 14.9 0.9999 / 0.985 / 0.9999 ~290
TensorRT fp16/ 0.9998 / 0.940 / 0.997 21.0 / 12.4 / 15.2 0.9999 / 0.985 / 0.9999 ~160

From the original's latents the TensorRT engines' grid matches the ONNX fp16 build's at IoU 0.9999 / 0.9997 / 0.9998. The latent SNR is low for every build because 50 guided steps amplify small differences; the original's own bf16 run is further from its fp16 run, by F-score, than either build.

How these were made

From Hunyuan3D-2.1 at revision 0b94677654: each engine was built with TensorRT's builder from Moonbox's published ONNX graph of the same model and precision. The network is strongly typed: every tensor keeps the precision the ONNX graph gives it, so an fp16 engine computes what the fp16 ONNX build computes. Built on an RTX 3080 Laptop GPU, it was benchmarked against the original before upload, 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

Star History Chart
Downloads last month
-
Inference Providers NEW
This model isn't deployed by any Inference Provider. πŸ™‹ Ask for provider support

Model tree for moonbox-dev/Hunyuan3D-2.1-TensorRT

Quantized
(5)
this model

Papers for moonbox-dev/Hunyuan3D-2.1-TensorRT