[Inference.Core] MeshGraphormer Hand Refiner
The fix for AI-generated hands
- image
- IMAGE
- INPAINTING_MASK
Every diffusion model has the same tell: hands. Too many fingers, fused knuckles, a thumb growing out of nowhere. MeshGraphormer is the ComfyUI answer to that specific problem - it estimates an actual 3D mesh of the hand from your image, renders that mesh as a depth map, and hands you a matching inpainting mask, all in one node. Wire the depth output into a depth ControlNet and the mask into an inpaint sampler pointed only at the hand region, and you get a targeted hand-fix pass instead of regenerating the whole image and hoping.
How it works
Under the hood this is a hand-pose-estimation model (MeshGraphormer) that predicts 3D hand mesh vertices from a 2D image, categorized in this pack alongside depth/normal tools because that's exactly what it outputs: a depth-style render of the estimated hand geometry, correctly shaded and shaped rather than a flat skeleton. Paired with an inpainting mask scoped to just the hand region, this becomes the classic "depth-conditioned regeneration plus targeted inpaint" combo - one of the more reliable ways to fix bad hands rather than rerolling the whole seed and crossing your fingers (so to speak).
The inputs and outputs that matter
image- required, your source image with the problem hand(s).mask_bbox_padding(default 30) - how much extra space around the detected hand the mask includes. Too tight and the inpaint edges show; too loose and you're regenerating more than the hand.mask_type-based_on_depth(default, follows the estimated mesh shape),tight_bboxes(a rectangle around the hand), ororiginal.based_on_depthgives the cleanest blend in most cases.mask_expand(default 5) - grows or shrinks the mask further, independent of the padding above.rand_seed(default 88) - the mesh estimator's own seed, separate from your sampler's.
Two outputs: IMAGE, the rendered hand depth map for a depth ControlNet, and INPAINTING_MASK, ready to feed straight into your inpaint/mask nodes so only the hand region gets touched.
How to install it
ComfyUI Manager: search ComfyUI-Inference-Core-Nodes, install, restart. By hand:
cd ComfyUI/custom_nodes
git clone https://github.com/LykosAI/ComfyUI-Inference-Core-Nodes
then run install.py, or pip install -e .[cuda12] (swap for .[cuda], .[rocm], .[directml], or .[cpu] to match your hardware). Restart ComfyUI. The MeshGraphormer model weights download automatically from Hugging Face the first time you run the node.
Common issues & troubleshooting
The most common disappointment is expecting this to be a one-click miracle fixer - it isn't. It works best when a hand is at least partly visible and roughly in the right place already; it can't invent a hand from nothing, and on a badly mangled or nearly-absent hand the mesh estimate itself gets shaky, which passes a shaky depth map into your ControlNet. If results look worse than the original, try loosening mask_bbox_padding and mask_expand so the inpaint has more surrounding context to blend into, or crop closer to the hand before feeding it in so the estimator has less of the frame to search.
Also worth knowing: this node produces the conditioning and the mask, not the fix itself. You still need a depth ControlNet loaded and an actual inpainting pass (KSampler with the mask, or your inpainting node of choice) downstream - skip either half and nothing changes in your output.
Inputs (6)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | — | |
| mask_bbox_paddingopt | INT | 300–100 | — |
| resolutionopt | INT | 51264–2048 | — |
| mask_typeopt | COMBO | based_on_depth | 3 options: based_on_depth, tight_bboxes, original |
| mask_expandopt | INT | 5-2048–2048 | — |
| rand_seedopt | INT | 880–18446744073709550000 | — |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| IMAGE | IMAGE | — |
| INPAINTING_MASK | MASK | — |