visualbruno/ComfyUI-Hunyuan3d-2-1

ComfyUI Wrapper for Hunyuan3D v2.1 - From Images to High-Fidelity 3D Assets with Production-Ready PBR Material

373

stars

72

commits

Python

primary language

Sep 8, 2026

updated

3d
3d-generation
comfyui
hunyuan3d
hunyuan3dwrapper
image-to-3d
shape
shape-generation
texture-generation
Browse cluster: 3D Generation from Images and Text β†’

README

πŸŒ€ ComfyUI Wrapper for Hunyuan3D-2.1

ComfyUI integration for Tencent's powerful Hunyuan3D-2.1 model. Supports textured 3D generation with optional high-quality UV mapping.


πŸ“¦ Repository & Models

πŸ”§ Required Checkpoints

Place the following checkpoints into the corresponding folders under your ComfyUI directory:

ComfyUI/
β”œβ”€β”€ models/
β”‚   β”œβ”€β”€ diffusion_models/
β”‚   β”‚   └── hunyuan3d-dit-v2-1.ckpt
β”‚   β”œβ”€β”€ vae/
β”‚   β”‚   └── hunyuan3d-vae-v2-1.ckpt

βš™οΈ Installation Guide

Tested on Windows 11 with Python 3.12 and Torch >= 2.6.0 + cu126. Compatible with the latest ComfyUI Portable release.

1. Install Python Dependencies

For a standard Python environment:

python -m pip install -r ComfyUI/custom_nodes/ComfyUI-Hunyuan3DWrapper/requirements.txt

For ComfyUI Portable:

python_embeded\python.exe -m pip install -r ComfyUI\custom_nodes\ComfyUI-Hunyuan3d-2-1\requirements.txt

2. Install or Compile Texture Generation Modules

Two critical C++ extensions need to be installed: the custom rasterizer and the differentiable renderer.

Custom Rasterizer

You will find precompiled wheels in hy3dpain\custom_rasterizer\dist folder

For standard Python:

Example, if you are on Python 3.12:

pip install custom_rasterizer-0.1-cp312-cp312-win_amd64.whl

For ComfyUI Portable:

python_embeded\python.exe -m pip install ComfyUI\custom_nodes\ComfyUI-Hunyuan3d-2-1\hy3dpaint\custom_rasterizer\dist\custom_rasterizer-0.1-cp312-cp312-win_amd64.whl

Differentiable Renderer

You will find precompiled wheels in hy3dpaint\DifferentiableRenderer\dist folder

For standard Python:

Example, if you are on Python 3.12:

pip install mesh_inpaint_processor-0.0.0-cp312-cp312-win_amd64.whl.whl

For ComfyUI Portable:

python_embeded\python.exe -m pip install ComfyUI\custom_nodes\ComfyUI-Hunyuan3d-2-1\hy3dpaint\DifferentiableRenderer\dist\mesh_inpaint_processor-0.0.0-cp312-cp312-win_amd64.whl.whl

Option B: Manual Compilation (for advanced users)

# Compile custom rasterizer
cd ComfyUI/custom_nodes/ComfyUI-Hunyuan3d-2-1/hy3dpaint/custom_rasterizer
python setup.py install

# Compile differentiable renderer
cd ../DifferentiableRenderer
python setup.py install

🩻 Optional: Fix UV Wrapping for High Poly Meshes (Patched Xatlas)

This upgrade improves UV unwrapping stability for complex meshes.

# Step 1: Uninstall existing xatlas
python_embeded\python.exe -m pip uninstall xatlas

# Step 2: Clone updated xatlas-python wrapper
cd ComfyUI_windows_portable
git clone --recursive https://github.com/mworchel/xatlas-python.git

# Step 3: Replace internal xatlas source
cd xatlas-python\extern
del /s /q xatlas
git clone --recursive https://github.com/jpcy/xatlas

# Step 4: Patch source file
# In xatlas-python/extern/xatlas/source/xatlas/xatlas.cpp:
Line 6774: change `#if 0` β†’ `//#if 0`
Line 6778: change `#endif` β†’ `//#endif`

# Step 5: Install patched xatlas wrapper
cd ../../..
python_embeded\python.exe -m pip install .\xatlas-python\
python_embeded\python.exe -m pip uninstall -y xatlas; `
cd ComfyUI_windows_portable; `
if (Test-Path xatlas-python) { Remove-Item xatlas-python -Recurse -Force }; `
git clone --recursive https://github.com/mworchel/xatlas-python.git; `
cd xatlas-python\extern; `
if (Test-Path xatlas) { Remove-Item xatlas -Recurse -Force }; `
git clone --recursive https://github.com/jpcy/xatlas; `
(Get-Content .\xatlas\source\xatlas\xatlas.cpp) -replace '#if 0', '//#if 0' -replace '#endif', '//#endif' | Set-Content .\xatlas\source\xatlas\xatlas.cpp; `
cd ..\..\..; `
python_embeded\python.exe -m pip install .\xatlas-python\

πŸ“‚ Directory Overview

ComfyUI/
β”œβ”€β”€ custom_nodes/
β”‚   └── ComfyUI-Hunyuan3d-2-1/
β”‚       β”œβ”€β”€ hy3dpaint/
β”‚       β”‚   β”œβ”€β”€ custom_rasterizer/         # Custom rasterizer module
β”‚       β”‚   β”‚   β”œβ”€β”€ setup.py
β”‚       β”‚   β”‚   └── dist/                  # Precompiled wheels
β”‚       β”‚   β”œβ”€β”€ DifferentiableRenderer/    # Differentiable renderer
β”‚       β”‚   β”‚   β”œβ”€β”€ setup.py
β”‚       β”‚   β”‚   └── dist/                  # Precompiled wheels
β”œβ”€β”€ models/
β”‚   β”œβ”€β”€ diffusion_models/
β”‚   β”‚   └── [hunyuan3d-dit-v2-1.ckpt](https://huggingface.co/tencent/Hunyuan3D-2.1/tree/main/hunyuan3d-dit-v2-1)
β”‚   └── vae/
β”‚       └── [hunyuan3d-vae-v2-1.ckpt](https://huggingface.co/tencent/Hunyuan3D-2.1/tree/main/hunyuan3d-vae-v2-1)
β”œβ”€β”€ xatlas-python/                         # Patched UV unwrapper (optional)
β”‚   └── extern/
β”‚       └── xatlas/

πŸ™ Acknowledgements

  • kijai β€” Original wrapper developer for Hunyuan3D v2.0
  • TrueMike, Agee, Palindar, and the vibrant Discord community
  • Tencent team for the incredible Hunyuan3D-2.1 model

Contributors

visualbruno

67 commits

antoinebou12

5 commits

visualbruno/ComfyUI-Hunyuan3d-2-1

ComfyUI Wrapper for Hunyuan3D v2.1 - From Images to High-Fidelity 3D Assets with Production-Ready PBR Material

373

stars

72

commits

Python

primary language

Sep 8, 2026

updated

3d
3d-generation
comfyui
hunyuan3d
hunyuan3dwrapper
image-to-3d
shape
shape-generation
texture-generation
Browse cluster: 3D Generation from Images and Text β†’

README

πŸŒ€ ComfyUI Wrapper for Hunyuan3D-2.1

ComfyUI integration for Tencent's powerful Hunyuan3D-2.1 model. Supports textured 3D generation with optional high-quality UV mapping.


πŸ“¦ Repository & Models

πŸ”§ Required Checkpoints

Place the following checkpoints into the corresponding folders under your ComfyUI directory:

ComfyUI/
β”œβ”€β”€ models/
β”‚   β”œβ”€β”€ diffusion_models/
β”‚   β”‚   └── hunyuan3d-dit-v2-1.ckpt
β”‚   β”œβ”€β”€ vae/
β”‚   β”‚   └── hunyuan3d-vae-v2-1.ckpt

βš™οΈ Installation Guide

Tested on Windows 11 with Python 3.12 and Torch >= 2.6.0 + cu126. Compatible with the latest ComfyUI Portable release.

1. Install Python Dependencies

For a standard Python environment:

python -m pip install -r ComfyUI/custom_nodes/ComfyUI-Hunyuan3DWrapper/requirements.txt

For ComfyUI Portable:

python_embeded\python.exe -m pip install -r ComfyUI\custom_nodes\ComfyUI-Hunyuan3d-2-1\requirements.txt

2. Install or Compile Texture Generation Modules

Two critical C++ extensions need to be installed: the custom rasterizer and the differentiable renderer.

Custom Rasterizer

You will find precompiled wheels in hy3dpain\custom_rasterizer\dist folder

For standard Python:

Example, if you are on Python 3.12:

pip install custom_rasterizer-0.1-cp312-cp312-win_amd64.whl

For ComfyUI Portable:

python_embeded\python.exe -m pip install ComfyUI\custom_nodes\ComfyUI-Hunyuan3d-2-1\hy3dpaint\custom_rasterizer\dist\custom_rasterizer-0.1-cp312-cp312-win_amd64.whl

Differentiable Renderer

You will find precompiled wheels in hy3dpaint\DifferentiableRenderer\dist folder

For standard Python:

Example, if you are on Python 3.12:

pip install mesh_inpaint_processor-0.0.0-cp312-cp312-win_amd64.whl.whl

For ComfyUI Portable:

python_embeded\python.exe -m pip install ComfyUI\custom_nodes\ComfyUI-Hunyuan3d-2-1\hy3dpaint\DifferentiableRenderer\dist\mesh_inpaint_processor-0.0.0-cp312-cp312-win_amd64.whl.whl

Option B: Manual Compilation (for advanced users)

# Compile custom rasterizer
cd ComfyUI/custom_nodes/ComfyUI-Hunyuan3d-2-1/hy3dpaint/custom_rasterizer
python setup.py install

# Compile differentiable renderer
cd ../DifferentiableRenderer
python setup.py install

🩻 Optional: Fix UV Wrapping for High Poly Meshes (Patched Xatlas)

This upgrade improves UV unwrapping stability for complex meshes.

# Step 1: Uninstall existing xatlas
python_embeded\python.exe -m pip uninstall xatlas

# Step 2: Clone updated xatlas-python wrapper
cd ComfyUI_windows_portable
git clone --recursive https://github.com/mworchel/xatlas-python.git

# Step 3: Replace internal xatlas source
cd xatlas-python\extern
del /s /q xatlas
git clone --recursive https://github.com/jpcy/xatlas

# Step 4: Patch source file
# In xatlas-python/extern/xatlas/source/xatlas/xatlas.cpp:
Line 6774: change `#if 0` β†’ `//#if 0`
Line 6778: change `#endif` β†’ `//#endif`

# Step 5: Install patched xatlas wrapper
cd ../../..
python_embeded\python.exe -m pip install .\xatlas-python\
python_embeded\python.exe -m pip uninstall -y xatlas; `
cd ComfyUI_windows_portable; `
if (Test-Path xatlas-python) { Remove-Item xatlas-python -Recurse -Force }; `
git clone --recursive https://github.com/mworchel/xatlas-python.git; `
cd xatlas-python\extern; `
if (Test-Path xatlas) { Remove-Item xatlas -Recurse -Force }; `
git clone --recursive https://github.com/jpcy/xatlas; `
(Get-Content .\xatlas\source\xatlas\xatlas.cpp) -replace '#if 0', '//#if 0' -replace '#endif', '//#endif' | Set-Content .\xatlas\source\xatlas\xatlas.cpp; `
cd ..\..\..; `
python_embeded\python.exe -m pip install .\xatlas-python\

πŸ“‚ Directory Overview

ComfyUI/
β”œβ”€β”€ custom_nodes/
β”‚   └── ComfyUI-Hunyuan3d-2-1/
β”‚       β”œβ”€β”€ hy3dpaint/
β”‚       β”‚   β”œβ”€β”€ custom_rasterizer/         # Custom rasterizer module
β”‚       β”‚   β”‚   β”œβ”€β”€ setup.py
β”‚       β”‚   β”‚   └── dist/                  # Precompiled wheels
β”‚       β”‚   β”œβ”€β”€ DifferentiableRenderer/    # Differentiable renderer
β”‚       β”‚   β”‚   β”œβ”€β”€ setup.py
β”‚       β”‚   β”‚   └── dist/                  # Precompiled wheels
β”œβ”€β”€ models/
β”‚   β”œβ”€β”€ diffusion_models/
β”‚   β”‚   └── [hunyuan3d-dit-v2-1.ckpt](https://huggingface.co/tencent/Hunyuan3D-2.1/tree/main/hunyuan3d-dit-v2-1)
β”‚   └── vae/
β”‚       └── [hunyuan3d-vae-v2-1.ckpt](https://huggingface.co/tencent/Hunyuan3D-2.1/tree/main/hunyuan3d-vae-v2-1)
β”œβ”€β”€ xatlas-python/                         # Patched UV unwrapper (optional)
β”‚   └── extern/
β”‚       └── xatlas/

πŸ™ Acknowledgements

  • kijai β€” Original wrapper developer for Hunyuan3D v2.0
  • TrueMike, Agee, Palindar, and the vibrant Discord community
  • Tencent team for the incredible Hunyuan3D-2.1 model

Contributors

visualbruno

67 commits

antoinebou12

5 commits

Languages

Python

93.3%

C++

5.9%