Nodes/Pixel3DMM ComfyUI Nodes/πŸ“¦ 3D Mesh Exporter
ComfyUI Node

πŸ“¦ 3D Mesh Exporter

The one node in this pack that just works β€” OBJ, PLY, STL out

By A043-studiosΒ·Created about a year agoΒ·Updated about a year agoΒ· 10
πŸ“¦ 3D Mesh Exporter
  • mesh_data
  • file_path
  • status
β—„output_formatobjβ–Ί
β—„filenameface_meshβ–Ί
β—„output_directoryoutput/meshesβ–Ί
β—„include_texturesfalseβ–Ί
β—„scale_factor1.0β–Ί
β—„center_meshtrueβ–Ί

Every 3D pipeline ends the same way: get the mesh out of the node graph and into a file you can open in Blender, Unity, or a slicer. That's this node's whole job. MeshExporter takes the mesh_data that FaceReconstructor3D (or FLAMEOptimizer) hands you and writes it to disk as OBJ, PLY, or STL. It's the unglamorous end of the pack, and - refreshingly - the one piece that's genuinely solid. The export plumbing is real: it actually writes valid mesh files, which is more than you can say for some of the model weights in this pack.

How it works

The exporter takes the mesh dictionary, applies any scaling and centering you asked for, then serializes vertices and faces to the chosen format. OBJ is written with a hand-rolled serializer that can include UV coordinates if the mesh has them and include_textures is on; PLY and STL go through the trimesh library. center_mesh (on by default) translates the mesh so its center sits at the origin, and scale_factor multiplies all vertices - handy if you're targeting a specific unit scale for a 3D printer or a game engine.

The inputs that matter

  • mesh_data - the MESH_DATA output from FaceReconstructor3D or FLAMEOptimizer. Required.
  • output_format - obj, ply, or stl. Defaults to obj, and that's usually right.
  • filename - what the file gets called (default face_mesh). The extension is added for you.

The optional output_directory (default output/meshes), include_textures (default off), scale_factor (0.1–10), and center_mesh (default on) are the fine-tuning set. Two things worth knowing:

  • Which format? OBJ is the safe general-purpose choice - Blender, Unity, and most DCC tools open it, and it's the only one of the three that carries texture coordinates when include_textures is on. PLY is the format you want if you're headed toward point-cloud or scanning workflows. STL is for 3D printing - it's solid geometry with no color or texture support, so don't expect it to look pretty, just printable.

The outputs

  • file_path (STRING) - where the file actually landed. This is the value you copy to open the mesh.
  • status (STRING) - format, vertex/face counts, scale, and whether centering was applied.

Where people get burned

Three gotchas, all avoidable:

  • The output directory is relative to where ComfyUI was launched, not to the ComfyUI folder. If you can't find output/meshes, check the working directory - or just type an absolute path.
  • include_textures silently does nothing if the mesh data has no UV coordinates. That means the UV predictor needs to have actually worked, which loops back to the pack's placeholder-weights problem. A "textured" export of a random-weight mesh is just a gray OBJ with no UVs.
  • Silly results in the file are usually the pipeline's fault, not the exporter's. Garbage in, garbage out - the exporter faithfully writes whatever geometry it's given. If the mesh looks wrong, fix the reconstruction first.

Installing it

Standard pack install: ComfyUI Manager (search "Pixel3DMM"), or clone https://github.com/A043-studios/comfyui-pixel3dmm into ComfyUI/custom_nodes, pip install -r requirements.txt, restart. The exporter leans on trimesh, which is in the requirements - if you see a trimesh import error, that dependency didn't install.

The full flow is Load Image β†’ Pixel3DMMLoader β†’ FaceReconstructor3D β†’ MeshExporter, and this is the node that finally gives you a file you can drag into Blender. For anyone who's spent time with depth maps and displacement, this is the next level up: an actual watertight-ish mesh you can rotate, light, and print.

CategoryPixel3DMM

Inputs (7)

NameTypeDefaultDescription
mesh_dataMESH_DATAβ€”
output_formatCOMBOobj3 options: obj, ply, stl
filenameSTRINGface_meshβ€”
output_directoryoptSTRINGoutput/meshesβ€”
include_texturesoptBOOLEANfalseβ€”
scale_factoroptFLOAT1.00.1–10β€”
center_meshoptBOOLEANtrueβ€”

Outputs (2)

NameTypeDescription
file_pathSTRINGβ€”
statusSTRINGβ€”