Nodes/ComfyUI-Hunyuan3d-2-1/Hunyuan 3D 2.1 Bake MultiViews With MetaData
ComfyUI Node

Hunyuan 3D 2.1 Bake MultiViews With MetaData

The bake node that remembers — it'll even notice when you upscaled your views

By visualbruno·Created about a year ago·Updated 5 days ago· 375
Hunyuan 3D 2.1 Bake MultiViews With MetaData
  • pipeline
  • albedo
  • mr
  • metadata
  • albedo
  • mr
  • trimesh
  • output_glb_path

Hy3DBakeMultiViews bakes your views into a texture and leaves them in RAM. Hy3DBakeMultiViewsWithMetaData bakes, inpaints, writes the textured mesh to disk, and saves a meta_data.json alongside it so the whole job is resumable - plus it has a genuinely clever trick: it detects whether you upscaled your views and saves the upscaled versions for the next stage. If you're doing anything beyond a one-shot texture job, this is the bake node you want.

It takes the pipeline, albedo, and mr from a metadata generator (Hy3D21MultiViewsGeneratorWithMetaData), plus that node's metadata (HY3D21METADATA), and returns the baked albedo/mr images, the final trimesh, and the output_glb_path string.

How it works

First the upscale detection: it checks the width of the incoming albedo views against the pipeline's configured resolution. Wider than expected? Then someone upscaled them - so it saves them as Albedo_Upscaled_*.png / MR_Upscaled_*.png in the same output folder and records the new file names in the metadata (that's how the "Use from MetaData" node knows to prefer them). Then the standard dance: pipeline.bake_from_multiview(...) with the camera config from metadata, pipeline.inpaint(...) to kill the seams, set the textures, save the mesh as <name>.glb in output/3D/<name>/, and finally dump meta_data.json.

The outputs

  • albedo / mr - the final baked-and-inpainted textures as previewable IMAGEs.
  • trimesh - the textured mesh, loaded straight back off disk.
  • output_glb_path - where it landed. This node is the "make the file" step of the metadata pipeline.

Where it sits in the flow

Hy3D21MultiViewsGeneratorWithMetaDataHy3DBakeMultiViewsWithMetaData is the canonical metadata pair. Insert an upscaler between them and you get the Mesh_Texturing_With_MetaData_Upscaled_With_Model workflow, where the bake automatically detects and uses the sharper views. After this node, the UseMultiViewsFromMetaData and HighPolyToLowPoly... nodes can reload the saved state.

Installing and troubleshooting

Same heavy install as every paint-pipeline node - it needs the differentiable renderer for the inpaint step:

cd ComfyUI/custom_nodes
git clone https://github.com/visualbruno/ComfyUI-Hunyuan3d-2-1
cd ComfyUI-Hunyuan3d-2-1
pip install -r requirements.txt
# + the C++ wheels (custom_rasterizer, mesh_inpaint_processor)

The common failure is a missing or stale meta_data.json - if you generated views with the plain generator and feed that output here, there's no metadata and the node can't find the mesh name or camera config. Always pair the metadata generator with this node. And if the upscaled views look worse than the originals, the detection isn't the problem - your upscaler is; the node just prefers the bigger images.

CategoryHunyuan3D21Wrapper

Inputs (4)

NameTypeDefaultDescription
pipelineHY3DPIPELINE
albedoIMAGE
mrIMAGE
metadataHY3D21METADATA

Outputs (4)

NameTypeDescription
albedoIMAGE
mrIMAGE
trimeshTRIMESH
output_glb_pathSTRING