1- [ 中文阅读] ( README_zh_cn.md )
2- [ 日本語で読む] ( README_ja_jp.md )
1+ # tencent/Hunyuan3D-2 Cog model
32
4- <p align =" center " >
5- <img src =" ./assets/images/teaser.jpg " >
3+ This is an implementation of [ tencent/Hunyuan3D-2] ( https://huggingface.co/spaces/tencent/Hunyuan3D-2 ) as a Cog model. [ Cog packages machine learning models as standard containers.] ( https://github.com/replicate/cog )
64
7- </p >
5+ Run a prediction:
6+
7+ cog predict -i image=@assets/demo.png
8+
9+ ![ demo] ( /assets/demo.png )
810
911<div align =" center " >
1012 <a href=https://3d.hunyuan.tencent.com target="_ blank"><img src=https://img.shields.io/badge/Official%20Site-333399.svg?logo=homepage height=22px></a >
2628<br >
2729
2830
29- > Join our ** [ Wechat] ( # ) ** and ** [ Discord] ( https://discord.gg/dNBrdrGGMa ) ** group to discuss and find help from us.
30-
31- | Wechat Group | Xiaohongshu | X | Discord |
32- | --------------------------------------------------| -------------------------------------------------------| ---------------------------------------------| ---------------------------------------------------|
33- | <img src =" assets/qrcode/wechat.png " height =140 > | <img src =" assets/qrcode/xiaohongshu.png " height =140 > | <img src =" assets/qrcode/x.png " height =140 > | <img src =" assets/qrcode/discord.png " height =140 > |
31+ > Join our ** [ Discord] ( https://discord.gg/GuaWYwzKbX ) ** group to discuss and find help from us.
3432
3533---
3634
@@ -73,11 +71,6 @@ including the open-source models and closed-source models in geometry details, c
7371e.t.c.
7472
7573
76-
77- <p align =" center " >
78- <img src =" assets/images/system.jpg " >
79- </p >
80-
8174## ☯️ ** Hunyuan3D 2.0**
8275
8376### Architecture
@@ -86,10 +79,6 @@ Hunyuan3D 2.0 features a two-stage generation pipeline, starting with the creati
8679synthesis of a texture map for that mesh. This strategy is effective for decoupling the difficulties of shape and
8780texture generation and also provides flexibility for texturing either generated or handcrafted meshes.
8881
89- <p align =" left " >
90- <img src =" assets/images/arch.jpg " >
91- </p >
92-
9382### Performance
9483
9584We have evaluated Hunyuan3D 2.0 with other open-source as well as close-source 3d-generation methods.
@@ -104,12 +93,6 @@ and the condition following ability.
10493| Top Close-source Model3 | 3.218 | 51.574 | 295.691 | 0.799 |
10594| Hunyuan3D 2.0 | ** 3.193** | ** 49.165** | ** 282.429** | ** 0.809** |
10695
107- Generation results of Hunyuan3D 2.0:
108- <p align =" left " >
109- <img src =" assets/images/e2e-1.gif " height =250 >
110- <img src =" assets/images/e2e-2.gif " height =250 >
111- </p >
112-
11396## 🎁 Models Zoo
11497
11598It takes 11.5 GB VRAM for shape generation and 24.5 GB for shape and texture generation in total.
@@ -121,112 +104,11 @@ It takes 11.5 GB VRAM for shape generation and 24.5 GB for shape and texture gen
121104| Hunyuan3D-Paint-v2-0 | Texture Generation Model | 2025-01-21 | 1.3B | [ Download] ( https://huggingface.co/tencent/Hunyuan3D-2/tree/main/hunyuan3d-paint-v2-0 ) |
122105| Hunyuan3D-Delight-v2-0 | Image Delight Model | 2025-01-21 | 1.3B | [ Download] ( https://huggingface.co/tencent/Hunyuan3D-2/tree/main/hunyuan3d-delight-v2-0 ) |
123106
124- ## 🤗 Get Started with Hunyuan3D 2.0
125-
126- You may follow the next steps to use Hunyuan3D 2.0 via:
127-
128- - [ Code] ( #code-usage )
129- - [ Gradio App] ( #gradio-app )
130- - [ API Server] ( #api-server )
131- - [ Blender Addon] ( #blender-addon )
132- - [ Official Site] ( #official-site )
133-
134- ### Install Requirements
135-
136- Please install Pytorch via the [ official] ( https://pytorch.org/ ) site. Then install the other requirements via
137-
138- ``` bash
139- pip install -r requirements.txt
140- # for texture
141- cd hy3dgen/texgen/custom_rasterizer
142- python3 setup.py install
143- cd ../../..
144- cd hy3dgen/texgen/differentiable_renderer
145- python3 setup.py install
146- ```
147-
148- ### Code Usage
149-
150- We designed a diffusers-like API to use our shape generation model - Hunyuan3D-DiT and texture synthesis model -
151- Hunyuan3D-Paint.
152-
153- You could assess ** Hunyuan3D-DiT** via:
154-
155- ``` python
156- from hy3dgen.shapegen import Hunyuan3DDiTFlowMatchingPipeline
157-
158- pipeline = Hunyuan3DDiTFlowMatchingPipeline.from_pretrained(' tencent/Hunyuan3D-2' )
159- mesh = pipeline(image = ' assets/demo.png' )[0 ]
160- ```
161-
162- The output mesh is a [ trimesh object] ( https://trimesh.org/trimesh.html ) , which you could save to glb/obj (or other
163- format) file.
164-
165- For ** Hunyuan3D-Paint** , do the following:
166-
167- ``` python
168- from hy3dgen.texgen import Hunyuan3DPaintPipeline
169- from hy3dgen.shapegen import Hunyuan3DDiTFlowMatchingPipeline
170-
171- # let's generate a mesh first
172- pipeline = Hunyuan3DDiTFlowMatchingPipeline.from_pretrained(' tencent/Hunyuan3D-2' )
173- mesh = pipeline(image = ' assets/demo.png' )[0 ]
174-
175- pipeline = Hunyuan3DPaintPipeline.from_pretrained(' tencent/Hunyuan3D-2' )
176- mesh = pipeline(mesh, image = ' assets/demo.png' )
177- ```
178-
179- Please visit [ minimal_demo.py] ( minimal_demo.py ) for more advanced usage, such as ** text to 3D** and ** texture generation
180- for handcrafted mesh** .
181-
182- ### Gradio App
183-
184- You could also host a [ Gradio] ( https://www.gradio.app/ ) App in your own computer via:
185-
186- ``` bash
187- python3 gradio_app.py
188- ```
189-
190- ### API Server
191-
192- You could launch an API server locally, which you could post web request for Image/Text to 3D, Texturing existing mesh,
193- and e.t.c.
194-
195- ``` bash
196- python api_server.py --host 0.0.0.0 --port 8080
197- ```
198-
199- A demo post request for image to 3D without texture.
200-
201- ``` bash
202- img_b64_str=$( base64 -i assets/demo.png)
203- curl -X POST " http://localhost:8080/generate" \
204- -H " Content-Type: application/json" \
205- -d ' {
206- "image": "' " $img_b64_str " ' ",
207- }' \
208- -o test2.glb
209- ```
210-
211- ### Blender Addon
212-
213- With an API server launched, you could also directly use Hunyuan3D 2.0 in your blender with
214- our [ Blender Addon] ( blender_addon.py ) . Please follow our tutorial to install and use.
215-
216- https://github.com/user-attachments/assets/8230bfb5-32b1-4e48-91f4-a977c54a4f3e
217107
218108### Official Site
219109
220110Don't forget to visit [ Hunyuan3D] ( https://3d.hunyuan.tencent.com ) for quick use, if you don't want to host yourself.
221111
222- ## 📑 Open-Source Plan
223-
224- - [x] Inference Code
225- - [x] Model Checkpoints
226- - [x] Technical Report
227- - [ ] ComfyUI
228- - [ ] TensorRT Version
229-
230112## 🔗 BibTeX
231113
232114If you found this repository helpful, please cite our reports:
@@ -251,17 +133,6 @@ If you found this repository helpful, please cite our reports:
251133}
252134```
253135
254- ## Community Resources
255-
256- Thanks for the contributions of community members, here we have these great extensions of Hunyuan3D 2.0:
257-
258- - [ ComfyUI-3D-Pack] ( https://github.com/MrForExample/ComfyUI-3D-Pack )
259- - [ ComfyUI-Hunyuan3DWrapper] ( https://github.com/kijai/ComfyUI-Hunyuan3DWrapper )
260- - [ Hunyuan3D-2-for-windows] ( https://github.com/sdbds/Hunyuan3D-2-for-windows )
261- - [ 📦 A bundle for running on Windows | 整合包] ( https://github.com/YanWenKun/Hunyuan3D-2-WinPortable )
262- - [ Hunyuan3D-2GP] ( https://github.com/deepbeepmeep/Hunyuan3D-2GP )
263- - [ Kaggle Notebook] ( https://github.com/darkon12/Hunyuan3D-2GP_Kaggle )
264-
265136## Acknowledgements
266137
267138We would like to thank the contributors to
0 commit comments