Hunyuan 3D 2.1 InPaint
The seam-killer — this is where the texture stops looking stitched
- pipeline
- albedo
- albedo_mask
- mr
- mr_mask
- albedo
- mr
- trimesh
- output_glb_path
Baked textures have seams. Every view boundary, every missed patch, every UV island edge leaves a line where the color doesn't quite agree. Hy3DInPaint is the node that erases those lines - it runs a real inpainting pass on the texture using the differentiable renderer, the way you'd heal a scratch in Photoshop but with gradients, not a smudge brush. This is the last step of the texturing pipeline and the difference between "looks AI-generated" and "looks like a scanned asset."
It takes the outputs of Hy3DBakeMultiViews: albedo, albedo_mask, mr, and mr_mask (the baked textures plus their coverage masks), the pipeline state, and an output_mesh_name string that names the file it writes. The seams you want gone are exactly where the masks show holes.
How it works
The node runs pipeline.inpaint(...) with vertex inpainting on and the NS (nearest-seed?) method - both are hardcoded, so no knobs to turn. It then writes the fixed textures back into the pipeline, saves a mesh out to ComfyUI/temp/<name>.obj, copies it to ComfyUI/output/<name>.glb, and reloads it as a TRIMESH. The outputs: albedo and mr as previewable IMAGEs, the cleaned trimesh, and the output_glb_path string pointing at the saved .glb.
Note the mesh it saves is the textured mesh - this node is itself an output node (it's marked OUTPUT_NODE in the source), so it can be the end of your workflow, or you can keep going and re-export with Hy3D21ExportMesh.
Why this is where installs break
This node is the biggest reason people fail to get this pack running. The inpainting runs on the differentiable renderer (the mesh_inpaint_processor C++ extension), and it needs the custom rasterizer too. Both ship as precompiled wheels in the repo's dist/ folders - mostly Windows builds for Python 3.10–3.12, one Linux cp311 wheel - otherwise you're compiling them yourself:
cd ComfyUI/custom_nodes/ComfyUI-Hunyuan3d-2-1
pip install -r requirements.txt
# wheels: hy3dpaint/custom_rasterizer/dist/*.whl
# hy3dpaint/DifferentiableRenderer/dist/mesh_inpaint_processor-*.whl
Pick the wheel matching your Python version, or run python setup.py install in both hy3dpaint/custom_rasterizer and hy3dpaint/DifferentiableRenderer directories. On ComfyUI Portable, prefix every pip call with python_embeded\python.exe.
Common issues
A crash or a texture that stays full of seams usually means the C++ extensions never loaded - check your console at startup for custom_rasterizer or mesh_inpaint_processor import errors. If Hy3DInPaint errors on a missing mesh file, it's the temp folder path, not your inputs - the pack writes to ComfyUI/temp/ and expects it to exist. And if your inpainted result is fuzzy rather than seamless, you skipped the UV wrap before baking; go back and unwrap, then re-bake, then re-inpaint. The pipeline rewards doing the steps in order.
Inputs (6)
| Name | Type | Default | Description |
|---|---|---|---|
| pipeline | HY3DPIPELINE | — | |
| albedo | NPARRAY | — | |
| albedo_mask | NPARRAY | — | |
| mr | NPARRAY | — | |
| mr_mask | NPARRAY | — | |
| output_mesh_name | STRING | — |
Outputs (4)
| Name | Type | Description |
|---|---|---|
| albedo | IMAGE | — |
| mr | IMAGE | — |
| trimesh | TRIMESH | — |
| output_glb_path | STRING | — |