ComfyUI Node

Hy3DGenerateMesh

The heart of Hunyuan3D — turning one image into a 3D latent

By kijai·Created 2 years ago·Updated 5 months ago· 1,033
Hy3DGenerateMesh
  • pipeline
  • image
  • mask
  • latents
guidance_scale5.50
steps30
seed0
scheduler
force_offloadtrue

This is the node that actually does the magic. Hy3DGenerateMesh runs Hunyuan3D's shape-diffusion model: it takes your (ideally de-lit, background-removed) image, runs the flow-matching DiT in latent space, and outputs the latent representation of the object's geometry. The name is slightly misleading - you don't get a mesh out of this node, you get HY3DLATENT. The mesh itself is created later, when Hy3DVAEDecode decodes that latent into vertices and faces.

Think of it as the sampler for 3D. Same shape as an image sampler: you give it a pipeline, an image, steps, guidance, and a seed, and it returns the latent you then decode.

Inputs that matter

  • pipeline - the HY3DMODEL from Hy3DModelLoader (the shape model, loaded from ComfyUI/models/diffusion_models/).
  • image - your input. Feed it the de-lit, background-removed result (delight + background removal) for the cleanest geometry.
  • guidance_scale (default 5.5) - CFG for the shape diffusion. 5.5 is a good middle; lower is looser/softer geometry, higher is more "opinionated" but can add artifacts.
  • steps (default 30) - diffusion steps. This is your main speed/quality tradeoff dial.
  • seed (default 0) - reproducibility and variation.
  • mask (optional) - an input mask if you want to constrain which part of the image becomes geometry.
  • scheduler (optional) - FlowMatchEulerDiscreteScheduler (default) or ConsistencyFlowMatchEulerDiscreteScheduler. The consistency variant is the few-step path: it can reach decent results in far fewer steps, at the cost of some fidelity.
  • force_offload (default true) - offloads the model to RAM/CPU when done. Leave it on; it's what lets the rest of the pipeline share your VRAM.

Output: latents (HY3DLATENT) → Hy3DVAEDecode.

The workflow shape

The single-image path is the classic one:

LoadImage → (delight) → (remove background) → Hy3DGenerateMesh → Hy3DVAEDecode → Hy3DMeshUVWrap → ...

Between the sampler and the decoder you're in latent space; Hy3DVAEDecode turns the latent into a raw triangle mesh (with octree_resolution controlling the density - 384 is the default and a reasonable memory/size compromise). After that you're in mesh-land: UV wrap, render multi-view, paint, bake, export.

Notes

The model is heavy. The shape DiT for 2.0 runs happily with the pack's offloading on a 12GB card, but the first decode of a high octree_resolution is where the VRAM bills come due. If you get OOM on the decode step, drop octree_resolution before touching anything else.

Install: this node ships with kijai's pack (ComfyUI Manager, search "Hunyuan3DWrapper", or clone into custom_nodes and pip install -r requirements.txt), and needs the converted shape model hunyuan3d-dit-v2-0.safetensors from Kijai/Hunyuan3D-2_safetensors in ComfyUI/models/diffusion_models/. A "very new version of ComfyUI" is also required for the Preview3D nodes elsewhere in the graph.

CategoryHunyuan3DWrapper

Inputs (8)

NameTypeDefaultDescription
pipelineHY3DMODEL
imageIMAGE
guidance_scaleFLOAT5.500–100
stepsINT30
seedINT00–18446744073709550000
maskoptMASK
scheduleroptCOMBO2 options: FlowMatchEulerDiscreteScheduler, ConsistencyFlowMatchEulerDiscreteScheduler
force_offloadoptBOOLEANtrueOffloads the model to the offload device once the process is done.

Outputs (1)

NameTypeDescription
latentsHY3DLATENT