Remesh MMG (backend)
Remesh MMG — the size-map adaptive remesher for engineering-grade control
- trimesh
- remeshed_mesh
- info
MMG is a mesh-adaptation library with serious engineering pedigree - it's built for finite-element simulation meshing, where you need control over the exact size and quality of every element. This backend runs MMG's adaptive remeshing, which is a different philosophy from most of the pack's other remeshers: instead of "make everything roughly this size," it works from a size map with explicit minimum and maximum edge lengths and a rule for how fast sizes can change. That's the control engineers want and the freedom hobbyists rarely miss.
It's the mmg_adaptive backend of the main Remesh dispatcher, dev-only like all the backends. You'll pick it from the dropdown.
How it works
MMG analyzes your mesh and rebuilds it to satisfy a sizing specification: a minimum edge length hmin, a maximum hmax, and a gradation hgrad that caps how fast element size can change from one triangle to its neighbor (so you don't get a tiny triangle suddenly abutting a huge one). Everything stays within a Hausdorff distance hausd of the original surface - that's your fidelity budget, the max the remesh is allowed to drift from the source. It's the most "spec-driven" remesh in the pack: you're not setting a target count, you're setting bounds, and MMG figures out the mesh in between.
Inputs and outputs
- trimesh (TRIMESH) - the mesh to remesh.
- hausd (default 0.01) - maximum deviation from the original surface. The fidelity knob. Tighter (smaller) = closer to the original; looser = freer, cheaper.
- hmin (default 0) - minimum edge length. 0 = auto, which is usually right.
- hmax (default 0) - maximum edge length. 0 = auto. Set hmin and hmax explicitly if you want a guaranteed size range for analysis meshing.
- hgrad (default 1.3) - how fast element sizes transition. 1.3 is the smooth default; higher allows abrupt size changes (cheaper, uglier), lower forces gradual ones (more triangles).
Outputs: remeshed_mesh (TRIMESH) and info (STRING) with the report.
Installing
ComfyUI Manager → GeometryPack, or:
cd ComfyUI/custom_nodes
git clone https://github.com/PozzettiAndrea/ComfyUI-GeometryPack.git
cd ComfyUI-GeometryPack
pip install -r requirements.txt --upgrade
python install.py
Restart after. MMG runs inside the pack's isolated comfy-env environment built by install.py.
When to reach for it
MMG earns its keep when you're doing simulation-prep or when you want a controlled density band rather than a uniform target: coarse on flat areas, fine near features, no jarring transitions. For most casual remesh jobs it's overkill - a uniform remesher (PyMeshLab, GeogramSmooth) gives you 90% of the value with one knob. But if you've ever cursed a remesh that put a 1mm triangle next to a 10cm one, MMG's hgrad is exactly the control you were missing.
Troubleshooting
- "MMG failed" on tiny meshes - MMG needs a reasonable starting triangulation; heavily degenerate inputs can make it bail. Clean the mesh first (the pack's repair nodes exist for this).
- Mesh ignores your intent - check
hausd; if it's too loose, MMG will happily take the cheap route. Tighten it. - Unexpected size jumps - that's
hgraddoing its thing; raise it to permit, lower it to forbid. - Stale-workflow validation errors are the pack-wide gotcha - if the Remesh node throws on a saved graph, delete and re-add it, re-pick
mmg_adaptive.
Inputs (5)
| Name | Type | Default | Description |
|---|---|---|---|
| trimesh | TRIMESH | — | |
| hausd | FLOAT | 0.0100.0001–10 | Hausdorff distance: maximum geometric deviation from original surface. |
| hmin | FLOAT | 0.0000–10 | Minimum edge length. 0 = auto. |
| hmax | FLOAT | 0.000–100 | Maximum edge length. 0 = auto. |
| hgrad | FLOAT | 1.31–5 | Gradation: controls how fast element sizes change. 1.3 = smooth transitions. |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| remeshed_mesh | TRIMESH | — |
| info | STRING | — |