Nodes/ComfyUI/Convert MoGe Point Map to Mesh
ComfyUI Node Runs on cloud

Convert MoGe Point Map to Mesh

Turning MoGe geometry into a textured GLB

By Comfy-Org·Created 4 years ago·Updated about 10 hours ago· 130,663
Convert MoGe Point Map to Mesh
  • moge_geometry
  • MESH
batch_index0
decimation1
discontinuity_threshold0.04
texturetrue

MoGe gives you a point map; this node gives you something you can actually put in Blender. MoGePointMapToMesh triangulates a MoGe point map into a MESH - vertices, faces, UVs, and your source image carried through as the base color texture. One node between "photo in" and "mesh out," and it's the whole reason to reach for MoGe over a plain depth estimator.

How it works

It takes the moge_geometry packet from MoGeInference (or MoGePanoramaInference) and builds a grid mesh: each pixel becomes a vertex, adjacent pixels become triangles, and the source image becomes the UV texture. Then it handles the coordinate surgery that makes the mesh usable outside ComfyUI - perspective MoGe output is OpenCV space (Y down, Z forward), and it's flipped into glTF convention (Y up, Z back), with the winding fixed so faces stay front-facing. Feed the MESH into a Save 3D Model node and you get a .glb in your output folder.

The dials that matter

  • batch_index (default 0) - which image of a batched geometry to convert. Per-image vertex counts differ, so batches can't be stacked into one mesh; pick one.
  • decimation (1–8, default 1) - the vertex stride. 1 is full resolution and can be millions of triangles; 2 or 3 is usually plenty for a game asset and dramatically smaller.
  • discontinuity_threshold (0–1, default 0.04) - drops triangles whose 3×3 depth span exceeds this fraction. This is the anti-tearing control: occlusion edges are sharp depth jumps, and without some threshold the mesh grows "bridges" across them. 0 turns it off.
  • texture (default on) - carries the source image through as baseColor.

Where people get burned

The classic error: "MoGe produced an empty mesh." It happens when the mask culls too much - typically heavy sky or a scene with little recoverable geometry. The node's own suggestion is the fix: try discontinuity_threshold=0 or apply_mask=False back upstream in MoGeInference. On the quality side, remember this is a height-field-style grid from one viewpoint - flat surfaces that face away from the camera come out fragmented, and there are no backsides. It's quick scene prototyping and reference geometry, not a replacement for multi-view reconstruction. And if you push decimation to 8 expecting a clean low-poly, you get a sparse holey grid instead; for real retopology you want the full-res mesh and a separate tool.

Categoryimage/geometry estimation

Inputs (5)

NameTypeDefaultDescription
moge_geometryMOGE_GEOMETRY
batch_indexINT00–4096Which image of a batched MoGe geometry to mesh. Per-image vertex counts differ, so batches can't be stacked into a single MESH.
decimationINT11–8Vertex stride; 1 = full resolution.
discontinuity_thresholdFLOAT0.040–1Drop pixels whose 3x3 depth span exceeds this fraction. 0 = off.
textureBOOLEANtrueCarry the source image through as the baseColor texture.

Outputs (1)

NameTypeDescription
MESHMESH