Nodes/ComfyUI-SAM3DBody/SAM 3D Body: Visualize Mesh
ComfyUI Node

SAM 3D Body: Visualize Mesh

Render your SAM3DBody mesh back over the source photo

By PozzettiAndrea·Created 9 months ago·Updated 2 months ago· 321
SAM 3D Body: Visualize Mesh
  • mesh_data
  • image
  • rendered_image
render_modeoverlay

SAM3DBodyProcess already gives you a debug_image for free, but that's a one-shot render tied to the moment inference ran. SAM3DBodyVisualize is the standalone version - hand it a mesh and an image any time later in your graph, and it renders the mesh against the photo again, with a render mode you can actually pick. Useful when you want to re-check a mesh after it's been through SAM3DBodyAddMeshToSkeleton or reloaded via SAM3DBodyLoadMesh, situations where you don't have a fresh debug_image sitting around from the original inference call.

How it works

It takes the mesh geometry and projects it back onto the 2D photo the way SAM 3D Body understood the scene - same idea as a ControlNet preprocessor preview, just for a full mesh instead of a pose skeleton or a depth map. The render_mode input controls how that projection gets drawn; the default, overlay, draws the mesh directly on top of the source image so you can eyeball alignment at a glance.

The inputs and outputs that matter

  • mesh_data (SAM3D_OUTPUT) - the mesh you want to check, from any node that produces one: SAM3DBodyProcess, SAM3DBodyProcessAdvanced, SAM3DBodyAddMeshToSkeleton, or SAM3DBodyLoadMesh.
  • image (IMAGE) - the photo to render it against. Usually the same source image the mesh was generated from, though nothing stops you from checking alignment against a different frame if that's useful for your workflow.
  • render_mode (default overlay) - how the mesh gets drawn. Leave it on the default for a straightforward alignment check.

One output: rendered_image (IMAGE) - a flat 2D render you can preview, save, or feed into anything downstream that wants an image rather than a 3D object.

How to install it

Comes bundled with the pack - install via ComfyUI Manager (search SAM3DBody) or manually:

cd ComfyUI/custom_nodes
git clone https://github.com/PozzettiAndrea/ComfyUI-SAM3DBody.git
cd ComfyUI-SAM3DBody
pip install -r requirements.txt --upgrade
python install.py

Nothing extra to fetch for this node specifically - it operates on mesh data you already have, no additional model download involved.

Common issues & troubleshooting

The overlay doesn't line up with the person in the photo. That's a signal about the mesh, not this node - if the mesh's pose or proportions were off to begin with (a common outcome from SAM 3D Body on unusual poses or crops), the misalignment will show up clearly here. Treat a bad SAM3DBodyVisualize render as your cue to go back and adjust bbox_threshold on the Process node, or try a cleaner source photo.

You're using this to check something debug_image already showed you. If you haven't touched the mesh since the original SAM3DBodyProcess call, its debug_image output is equivalent - no need to run this separately unless you specifically want a different render mode or you're checking the mesh at a later point in the graph.

Rendered image looks correct but the mesh is still nude/textureless. Expected - this node only visualizes the geometry SAM 3D Body actually produced. It won't add clothing or surface detail that isn't there; it's a check on pose and shape accuracy, not a preview of a finished, textured asset.

CategorySAM3DBody/visualization

Inputs (3)

NameTypeDefaultDescription
mesh_dataSAM3D_OUTPUTMesh data from SAM3DBodyProcess node
imageIMAGEOriginal input image to overlay mesh on
render_modeCOMBOoverlayHow to display the mesh: overlay on image, mesh only, or side-by-side comparison

Outputs (1)

NameTypeDescription
rendered_imageIMAGE