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

Hunyuan 3D 2.1 HighPoly to LowPoly Bake MultiViews With MetaData

The LOD factory — bake a whole chain of low-poly versions in one run

By visualbruno·Created about a year ago·Updated 5 days ago· 375
Hunyuan 3D 2.1 HighPoly to LowPoly Bake MultiViews With MetaData
    • output_lowpoly_path
    metadata_file
    view_size512
    texture_size1024
    target_face_nums20000,10000,5000

    Game engines don't want one 400k-triangle hero mesh - they want a ladder of LODs: a detailed version up close, cheaper versions as you pull the camera back. Hy3DHighPolyToLowPolyBakeMultiViewsWithMetaData is the node that makes the whole ladder at once. It takes a high-poly mesh and a list of target face counts, then for each count it decimates, UV-unwraps, bakes the texture from your saved views, inpaints the seams, and exports a ready-to-use glb. One run, N LODs. It's the pack's most production-oriented node, and the least beginner-friendly in name only.

    The inputs

    • metadata_file - path to a meta_data.json from the WithMetaData pipeline. It carries the camera config, the mesh file name, and the lists of albedo/MR views (upscaled ones preferred if present). Everything about "how the original was textured" comes from here.
    • target_face_nums (default 20000,10000,5000) - comma-separated list of face counts. The node parses it and produces one decimated, re-textured mesh per entry. Want 30k, 15k, 8k, 3k? Type 30000,15000,8000,3000.
    • view_size (512) / texture_size (1024) - the pipeline resolution used to re-bake each LOD.

    How it works

    It loads the high-poly mesh from the path in the metadata (stripping texture coordinates first - this is geometry-only decimation, so the original UVs go away), then loops over the target list. For each target: MeshLib decimation down to that face count, mesh_uv_wrap to build fresh UVs for the new topology, then the full bake + inpaint + save cycle writing <name>_<count>.obj into output/3D/<name>/LowPoly/<count>/. Output is a single string, output_lowpoly_path, pointing at the LowPoly folder. The example naming (20000,10000,5000) is the classic game-LOD progression and a sensible default.

    Installing it

    This is the most dependency-hungry node in the pack: it needs meshlib, the custom rasterizer, the differentiable renderer (for inpaint), and xatlas. All but the C++ extensions come from requirements.txt:

    cd ComfyUI/custom_nodes
    git clone https://github.com/visualbruno/ComfyUI-Hunyuan3d-2-1
    cd ComfyUI-Hunyuan3d-2-1
    pip install -r requirements.txt
    # + custom_rasterizer & mesh_inpaint_processor wheels, and ideally the patched xatlas
    

    Common issues

    The metadata's mesh_file must exist on disk - this node doesn't generate anything, it consumes saved state. If the mesh file path is stale, it just prints "Mesh file does not exist" and returns an empty path, which is easy to miss. Also: decimating and re-baking for each LOD is genuinely slow and memory-heavy - three LODs can feel like three texture jobs, because it basically is. Budget the time, or drop to two targets. And keep in mind each LOD gets freshly unwrapped UVs, so the texture is re-projected per LOD - that's the whole point, and it's also why a bad source bake propagates smears down the whole ladder.

    CategoryHunyuan3D21Wrapper

    Inputs (4)

    NameTypeDefaultDescription
    metadata_fileSTRING
    view_sizeINT512
    texture_sizeINT1024
    target_face_numsSTRING20000,10000,5000

    Outputs (1)

    NameTypeDescription
    output_lowpoly_pathSTRING