Nodes/Pixel3DMM ComfyUI Nodes/🎭 3D Face Reconstructor
ComfyUI Node

🎭 3D Face Reconstructor

Image in, mesh out β€” the centerpiece node of this pack

By A043-studiosΒ·Created about a year agoΒ·Updated about a year agoΒ· 10
🎭 3D Face Reconstructor
  • model
  • image
  • rendered_face
  • flame_parameters
  • mesh_data
  • status
β—„reconstruction_qualitybalancedβ–Ί
β—„optimize_flametrueβ–Ί
β—„optimization_steps100β–Ί
β—„learning_rate0.010β–Ί

This is the node the whole pack is built around. You feed it a face photo plus the PIXEL3DMM_MODEL container from the loader, and it tries to give you three things: the FLAME parameters that describe the face, an actual 3D mesh, and a rendered preview so you can see what it thinks it found. If you're coming from the 2D side of ComfyUI, this is the point where you leave flat pixels behind - the output isn't another image you upscale, it's geometry.

How it works

The reconstruction follows the shape of the real academic tools (DECA, EMOCA, that family): preprocess the image, run it through the model's vision backbone to extract features, predict a set of FLAME parameters from those features, then let FLAME's parametric model turn those parameters into vertices and faces. optimize_flame adds a refinement step on top - a short gradient-descent loop that nudges the predicted parameters until the rendered face better matches the input photo. FLAME, if you haven't met it, is the industry-standard parametric face model from the Max Planck Institute: a small vector of shape, expression, and pose coefficients that can generate thousands of face meshes from a single set of numbers. That's the "3DMM" in the pack's name - 3D Morphable Model.

The inputs that matter

  • model - the PIXEL3DMM_MODEL container from Pixel3DMMLoader. Required, obviously.
  • image - your input face photo, from Load Image.
  • reconstruction_quality - fast, balanced, or high. Balanced is the sensible default; fast if you're iterating, high if you're doing a final export.
  • optimize_flame - boolean, on by default. Leave it on; it's the difference between a raw prediction and a fitted one.

The optional optimization_steps (10–1000, default 100) and learning_rate (0.001–0.1, default 0.01) tune that refinement loop. 100 steps at 0.01 is a reasonable starting point - bump steps if the fit looks loose, drop the learning rate if it jitters.

The outputs and where they go

The node returns four things:

  • rendered_face (IMAGE) - a preview render of the reconstructed face. Save it or preview it to sanity-check the result.
  • flame_parameters (FLAME_PARAMS) - the parametric description. This is what you hand to FLAMEOptimizer if you want to refine further.
  • mesh_data (MESH_DATA) - the actual geometry, ready for MeshExporter.
  • status (STRING) - a summary (quality setting, vertex/face counts).

The standard flow: Load Image β†’ Pixel3DMMLoader β†’ FaceReconstructor3D β†’ MeshExporter, with the flame_parameters output optionally detouring through the FLAME optimizer first.

The honest caveat

Remember the loader's random-initialization fallback. If you haven't supplied a real checkpoint, this node runs and produces a "mesh" - but it's a random point cloud wearing a mask, not your face. The pipeline architecture is sound and mirrors the proven research methods; the weights that ship with it are placeholder. So treat the first run as a pipeline smoke test: you want to see a plausible face in rendered_face before you export anything you care about. Community signal for "3D face reconstruction in ComfyUI" is essentially nonexistent - people who want serious results get pointed at Blender or research tools, which tells you how young this corner of the ecosystem is.

Installing it

Same as the rest of the pack: ComfyUI Manager (search "Pixel3DMM"), or

cd ComfyUI/custom_nodes
git clone https://github.com/A043-studios/comfyui-pixel3dmm
pip install -r requirements.txt

then restart ComfyUI. If you hit a CUDA out-of-memory, drop to fast quality and switch the loader to fp16 or CPU.

CategoryPixel3DMM

Inputs (6)

NameTypeDefaultDescription
modelPIXEL3DMM_MODELβ€”
imageIMAGEβ€”
reconstruction_qualityCOMBObalanced3 options: fast, balanced, high
optimize_flameBOOLEANtrueβ€”
optimization_stepsoptINT10010–1000β€”
learning_rateoptFLOAT0.0100.001–0.1β€”

Outputs (4)

NameTypeDescription
rendered_faceIMAGEβ€”
flame_parametersFLAME_PARAMSβ€”
mesh_dataMESH_DATAβ€”
statusSTRINGβ€”