Nodes/Pixel3DMM ComfyUI Nodes/πŸ—ΊοΈ UV Coordinate Predictor
ComfyUI Node

πŸ—ΊοΈ UV Coordinate Predictor

UV coordinates β€” how your texture actually wraps around the face mesh

By A043-studiosΒ·Created about a year agoΒ·Updated about a year agoΒ· 10
πŸ—ΊοΈ UV Coordinate Predictor
  • model
  • image
  • uv_map
  • uv_coordinates
  • status
β—„output_resolution512β–Ί
β—„uv_smoothing0.0β–Ί
β—„confidence_threshold0.50β–Ί

A bare 3D face mesh is just a shape - a gray surface with no skin. To make it look like a person you need to map the photograph onto the geometry, and that's what UV coordinates are for: they tell the renderer which pixel of the texture goes on which part of the mesh. This node predicts exactly that. UVPredictor takes the face image and the loaded model and produces a UV map plus the raw UV_COORDS data, which is the piece that makes textured export possible further down the pipeline.

How it works

The node runs the image through a UV-prediction network at your chosen resolution, then post-processes the coordinates. confidence_threshold (0–1, default 0.5) is the honest one: UV predictions come with a per-pixel confidence, and anything below the threshold gets discarded rather than trusting garbage. If your map looks patchy, that's the threshold cutting things out - lower it. If it looks like a confident lie, raise it. uv_smoothing (0–1) blurs the coordinates afterward, which evens out jittery predictions at the cost of sharpness at feature boundaries like the eyes and mouth.

The inputs and outputs

  • model - the PIXEL3DMM_MODEL container from Pixel3DMMLoader. Required.
  • image - the face image. Required.
  • output_resolution - 256, 512, or 1024 (default 512). 512 is the practical default; 1024 only if you're exporting a high-res texture.

Optional: uv_smoothing (default 0) and confidence_threshold (default 0.5).

Outputs are uv_map (an IMAGE - the visualization you preview to check the mapping), uv_coordinates (the raw UV_COORDS), and status.

Where the outputs go

Two places, both worth knowing:

  • Into FLAMEOptimizer - uv_coordinates plugs into its uv_coordinates input as a constraint, so the optimizer can pull the mesh into alignment with where the texture actually maps. This is the standard "geometry and texture should agree" trick.
  • Into the export - MeshExporter's include_textures option only does anything if the mesh carries UV data. So the chain is UVPredictor β†’ (FLAMEOptimizer) β†’ MeshExporter, and without the UV predictor doing its job, your OBJ exports as a textureless shell no matter what you toggle.

The honest caveat

You know the refrain by now, but it applies harder here than anywhere else. UV prediction on a face is a genuinely hard task - it requires the model to understand facial topology well enough to know the cheek maps to the "cheek" region of a canonical UV layout. The placeholder network this pack ships will produce coordinates, and they will be wrong, and the confidence threshold will merrily discard half of them. The node and its parameters are real and well-designed; the intelligence behind them is not, until you load a real checkpoint. Also note: this pipeline predicts UVs from a single image, which is the research-y part - most production face textures come from multi-view capture, not one photo.

Installing it

With the pack: ComfyUI Manager (search "Pixel3DMM"), or clone https://github.com/A043-studios/comfyui-pixel3dmm into ComfyUI/custom_nodes, pip install -r requirements.txt, restart. Run it after FaceReconstructor3D, and remember the uv_map IMAGE output is your visual check - if it doesn't look like a coherent face layout, don't bother exporting.

CategoryPixel3DMM

Inputs (5)

NameTypeDefaultDescription
modelPIXEL3DMM_MODELβ€”
imageIMAGEβ€”
output_resolutionCOMBO5123 options: 256, 512, 1024
uv_smoothingoptFLOAT0.00–1β€”
confidence_thresholdoptFLOAT0.500–1β€”

Outputs (3)

NameTypeDescription
uv_mapIMAGEβ€”
uv_coordinatesUV_COORDSβ€”
statusSTRINGβ€”