NeurCADRecon Inference
Turn the trained SDF back into a mesh you can actually use
- model
- mesh
- status
After the training grind, this is the payoff node: it walks a grid through the trained SDF, finds where the field crosses zero (i.e. where the surface is), and runs marching cubes over it to produce a triangle mesh. It's the exact moment a neural network turns back into geometry you can export, 3D-print, or drop into a renderer.
You'd reach for it at the end of every NeurCADRecon run - you train, then you extract. It takes a NEURCADRECON_MODEL from either the Train node's trained_model output or the Load Checkpoint node, so you can use it fresh or after resuming. The output TRIMESH is the same type the wider ComfyUI geometry ecosystem speaks, so it wires into export and preview nodes from packs like Geometry Pack (which the example workflow uses on the input side). If you're reconstructing CAD parts, this is where the sharp edges the Morse loss fought for become actual polygons.
The one input that matters
model is required. grid_resolution is the only optional knob, and it's the classic resolution/speed trade:
- 256 (default) - a good starting point for most shapes
- 512 (max) - noticeably more detail, noticeably slower, and heavier on VRAM as it evaluates the network across a 512³ grid
- 64–128 - quick previews to check your training actually converged before you commit
The range is 64–512 in steps of 64. Rule of thumb: preview low, final export at 256, go to 512 only if the geometry genuinely needs it. A higher grid won't fix a badly trained SDF - it'll just show you the warts in higher definition.
Outputs are mesh (TRIMESH) and status (STRING), a one-line summary of the vertex and face counts you can eyeball on a text preview node.
How it works, including a real gotcha
Internally it evaluates the SDF on the grid in batches under torch.no_grad(), then runs marching cubes. The primary path uses PyMCubes (mcubes.marching_cubes), and it has a fallback to scikit-image's Lewiner marching cubes if PyMCubes isn't importable. Here's the trap: scikit-image is not in the pack's requirements.txt. If PyMCubes fails to install cleanly on your Python (it's a C-extension, so it can), the node silently relies on a dependency that was never declared, and you find out when the fallback ImportError appears. If mesh extraction errors out, first check that mcubes actually imported - pip install PyMCubes fixes most cases.
One thing the node will refuse to do: run on an untrained model. If you wire Load Model → Inference directly it raises a clear RuntimeError telling you to train or load a checkpoint first. That's a feature, not a bug.
Installing the pack
ComfyUI Manager, search "NeurCADRecon" - or manually:
cd ComfyUI/custom_nodes
git clone https://github.com/PozzettiAndrea/ComfyUI-NeurCADRecon
pip install -r ComfyUI-NeurCADRecon/requirements.txt
restart, done. It's the same install for all four nodes in the pack: torch>=2.0, numpy, trimesh, scipy, and PyMCubes. GPL-3.0, no model downloads. One honest caveat: the README opens with "Work in Progress! This node is not finished," and the author - Andrea Pozzetti of ComfyUI-CADabra and SAM3DObjects - has publicly said he considers ML reconstruction a weaker approach than solid CAD tooling. So treat the output as a usable mesh with caveats, not a final engineering model. Expect to clean it up.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| model | NEURCADRECON_MODEL | — | |
| grid_resolutionopt | INT | 25664–512 | Resolution of the marching cubes grid. Higher = more detail but slower. |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| mesh | TRIMESH | — |
| status | STRING | — |