A comprehensive ComfyUI custom node package that provides multiple approaches to 3D generation using Hunyuan3D models. This package offers both simplified interfaces and advanced workflows for creating 3D models from images.
- π₯ Real Hunyuan3D Pipeline Implementation - Direct integration with official Hunyuan3D library
- π― Simplified Wrapper - Easy-to-use interface wrapping existing ComfyUI nodes
- βοΈ Native ComfyUI Workflow - Using built-in ComfyUI Hunyuan3D nodes directly
- π Hybrid Approach - Combines custom functionality with existing infrastructure
- Open ComfyUI Manager
- Search for "HunyuanWorld"
- Click Install
- Restart ComfyUI
# Navigate to ComfyUI custom_nodes directory
cd ComfyUI/custom_nodes
# Clone the repository
git clone https://github.com/A043-studios/ComfyUI_HunyuanWorldnode.git
# Navigate to the cloned directory
cd ComfyUI_HunyuanWorldnode
# Run the installation script
python install.py
# Or install manually
pip install -r requirements.txt- Download the latest release
- Extract to
ComfyUI/custom_nodes/ComfyUI_HunyuanWorldnode - Run
python install.pyorpip install -r requirements.txt - Restart ComfyUI
pip install torch>=2.0.0 transformers>=4.30.0 diffusers>=0.21.0
pip install trimesh>=3.15.0 numpy>=1.21.0 Pillow>=9.0.0# For enhanced functionality
pip install accelerate>=0.20.0 opencv-python>=4.5.0
pip install fastapi>=0.68.0 uvicorn>=0.15.0 gradio>=3.0.0git clone https://github.com/tencent/hunyuan3d-2.git
cd hunyuan3d-2
pip install -e .# Pull the Docker image
docker pull a043studios/comfyui-hunyuanworld:latest
# Run with GPU support
docker run --gpus all -p 8188:8188 a043studios/comfyui-hunyuanworld:latest# 1. Load the model
model_loader = HunyuanWorldModelLoader()
pipeline = model_loader.load_model(
model_name="tencent/Hunyuan3D-2mini", # Faster, less VRAM
precision="fp16",
enable_texture=True,
low_vram_mode=True
)
# 2. Generate 3D from image
generator = HunyuanWorldImageTo3D()
mesh_path, info, preview = generator.generate_3d(
pipeline=pipeline,
image=your_image,
apply_texture=True,
save_mesh=True,
filename_prefix="my_3d_model"
)# One-click 3D generation
simple_wrapper = HunyuanWorldSimplifiedWrapper()
result_info, preview = simple_wrapper.simple_generate(
image=your_image,
model_variant="mini", # or "standard", "multiview"
resolution=1024,
enable_texture=True,
filename_prefix="simple_3d"
)Purpose: Load Hunyuan3D models with proper memory management
Inputs:
model_name: Choose from "tencent/Hunyuan3D-2", "tencent/Hunyuan3D-2mini", "tencent/Hunyuan3D-2mv"precision: "fp16" (recommended) or "fp32"enable_texture: Enable texture synthesis pipelinelow_vram_mode: Optimize for low VRAM systems
Outputs:
pipeline: Loaded Hunyuan3D pipeline ready for generation
Purpose: Generate 3D meshes from input images
Inputs:
pipeline: Output from HunyuanWorldModelLoaderimage: Input image (ComfyUI IMAGE format)apply_texture: Whether to apply texture to the meshsave_mesh: Save mesh as GLB filefilename_prefix: Prefix for saved filesseed(optional): Random seed for reproducible results
Outputs:
mesh_path: Path to saved GLB fileinfo: Generation informationpreview_image: Rendered preview of the 3D mesh
Purpose: One-click 3D generation for beginners
Inputs:
image: Input imagemodel_variant: "standard", "mini", or "multiview"resolution: Output resolution (512-2048)enable_texture: Apply texturefilename_prefix: File naming prefix
Outputs:
result_info: Generation status and informationpreview: Preview image of the result
Purpose: Flexible generation with multiple backend options
Inputs:
mode: "direct_pipeline" or "comfyui_workflow"image: Input imagemodel_name: Hunyuan3D model to useuse_texture: Enable texture synthesisfilename_prefix: File namingexisting_latent(optional): Use existing latent from ComfyUI workflowexisting_conditioning(optional): Use existing conditioning
Outputs:
mesh_path: Path to generated meshpreview: Preview imagemethod_info: Information about the method used
ComfyUI already includes powerful Hunyuan3D nodes. Here's how to use them:
-
EmptyLatentHunyuan3Dv2 - Create latent space
resolution: 3072 (or 1536 for faster generation) batch_size: 1 -
CLIPVisionLoader + CLIPVisionEncode - Process input image
Load CLIP vision model β Encode your image -
Hunyuan3Dv2Conditioning - Create conditioning
Connect CLIP vision output β Get positive/negative conditioning -
Load Hunyuan3D Model + KSampler - Generate
Load model β Sample with conditioning β Get latent output -
VAEDecodeHunyuan3D - Decode to voxels
latent β voxels (with octree_resolution: 256) -
VoxelToMesh - Convert to mesh
voxels β mesh (with threshold: 0.5) -
SaveGLB - Save final result
mesh β GLB file
Use Hunyuan3Dv2ConditioningMultiView for better results:
front_image β CLIP encode β front conditioning
left_image β CLIP encode β left conditioning
back_image β CLIP encode β back conditioning
right_image β CLIP encode β right conditioning
β Combine in MultiView node β Enhanced conditioning
- Best quality but requires more VRAM
- Recommended for: High-quality final outputs
- VRAM requirement: ~8GB+
- Balanced quality and speed
- Recommended for: Most users, development, testing
- VRAM requirement: ~4GB+
- Multi-view optimized
- Recommended for: When you have multiple view images
- VRAM requirement: ~6GB+
- Use high-quality input images (512x512 or higher)
- Clear subject isolation - objects with clean backgrounds work better
- Good lighting - avoid harsh shadows or overexposure
- Single objects - works better than complex scenes
- Use fp16 precision for 2x speed improvement
- Enable low_vram_mode if you have limited GPU memory
- Start with mini model for testing, upgrade to full model for final output
- Use smaller resolutions (1536 instead of 3072) for faster iteration
- Out of memory: Enable low_vram_mode, use fp16, or use mini model
- Poor quality: Try full model, higher resolution, or better input image
- Import errors: Install requirements with
pip install -r requirements.txt
LoadImage β HunyuanWorldModelLoader β HunyuanWorldImageTo3D β Preview3D
LoadImage β CLIPVisionEncode β Hunyuan3Dv2Conditioning β
EmptyLatentHunyuan3Dv2 β KSampler β VAEDecodeHunyuan3D β
VoxelToMesh β SaveGLB
LoadImage β HunyuanWorldHybridNode (mode: direct_pipeline) β Preview
| Feature | Custom Nodes | Built-in ComfyUI Nodes |
|---|---|---|
| Ease of use | βββββ Simple | βββ Complex workflow |
| Flexibility | βββ Good | βββββ Maximum |
| Performance | ββββ Direct | βββββ Optimized |
| Memory usage | βββ Standard | βββββ Efficient |
| Customization | βββ Limited | βββββ Full control |
Recommendation:
- Beginners: Use custom simplified wrapper
- Advanced users: Use built-in ComfyUI workflow
- Developers: Use hybrid approach for maximum flexibility
-
"Hunyuan3D libraries not available"
pip install -r requirements.txt
-
CUDA out of memory
# Use these settings: low_vram_mode=True precision="fp16" model_name="tencent/Hunyuan3D-2mini"
-
Slow generation
# Optimize with: resolution=1536 # instead of 3072 model_variant="mini"
-
Poor mesh quality
# Try: model_name="tencent/Hunyuan3D-2" # full model resolution=3072 apply_texture=True
Contributions are welcome! Please feel free to submit issues, feature requests, or pull requests.
This project follows the same license as the original Hunyuan3D project. Please refer to the official repository for license details.
Made with β€οΈ for the ComfyUI community