Nodes/ComfyUI MotionDiff/Render Mutiple SMPL Mesh
ComfyUI Node

Render Mutiple SMPL Mesh

Multi-Subject SMPL to Image, Depth, and Mask

By Fannovel16·Created 3 years ago·Updated 2 years ago· 212
Render Mutiple SMPL Mesh
  • smpl_multi_subjects
  • IMAGE
  • DEPTH_MAP
  • MASK
draw_platformfalse
depth_onlyfalse
fx_offset0.00
fy_offset0.00
move_x0.00
move_y0.00
move_z0.00
rotate_x0.0
rotate_y0.0
rotate_z0.0
background_hex_color#000000
normalsfalse
remove_backgroundtrue

When you estimate bodies from video with Human4D_Img2SMPL (or faces with SpectreImg2SMPL), you get multiple meshes per frame - everyone in the shot. Render Multiple SMPL Mesh is what turns that into images you can actually use: it renders every subject per frame and hands you three outputs - the color IMAGE, a DEPTH_MAP, and a MASK of the bodies. This is the node that sits between "I extracted 3D humans from a video" and "I'm feeding silhouettes or depth into a ControlNet to restyle the shot."

The camera comes from the estimation itself - focal length, frame size, and principal point are stored in the multi-subject metadata - so the renderer reconstructs the original camera rather than inventing one. That's the key difference from the single-subject Render SMPL Mesh, where you set the camera freely.

How it works

Each frame's meshes are drawn with pyrender (an OpenGL rasterizer) using the stored camera. You get three outputs per frame: the shaded body render, a depth map (inverted and normalized so it looks like the depth maps ControlNet expects), and a mask separating bodies from background. fx_offset/fy_offset nudge the focal length in case the estimated camera feels slightly off, and move_*/rotate_* let you reposition the whole scene.

The inputs that matter

  • smpl_multi_subjects - the multi-subject object.
  • depth_only - skip color, output depth only; marginally faster when that's all you need.
  • draw_platform - draw a ground plane under the bodies; handy for depth continuity.
  • move_x/y/z, rotate_x/y/z - camera rig controls.
  • background_hex_color - background color (default #000000). With remove_background on (default), the white render background is replaced with this color.
  • normals - optional normal-map output mode.

Outputs: IMAGE, DEPTH_MAP, MASK - all batched over frames.

Installation

Part of Fannovel16/ComfyUI-MotionDiff. Install via ComfyUI Manager (search "ComfyUI MotionDiff") or clone into ComfyUI/custom_nodes, install requirements, restart. Rendering needs pyrender + OpenGL: on Linux that means sudo apt-get install libglfw3-dev libgles2-mesa-dev freeglut3-dev first, or this node (and every other render node in the pack) will fail at load.

Gotchas

Depth maps from this pack come out dark. The depth is normalized and inverted, and the community has flagged that dark depth + PNG storage = banding artifacts - brighten it before saving if you plan to use it as a ControlNet condition. And the author's own PS remains a fun warning: depth maps from SMPL renders have been known to produce "half-naked women" when fed to ControlNet, because the model apparently learned that pattern from the depth maps in its training data. If your depth-conditioned output gets weird, that's a known quirk, not a bug in your graph.

CategoryMotionDiff/smpl

Inputs (14)

NameTypeDefaultDescription
smpl_multi_subjectsSMPL_MULTIPLE_SUBJECTS
draw_platformBOOLEANfalse
depth_onlyBOOLEANfalse
fx_offsetFLOAT0.000–10000
fy_offsetFLOAT0.000–10000
move_xFLOAT0.00-500–500
move_yFLOAT0.00-500–500
move_zFLOAT0.00-500–500
rotate_xFLOAT0.0-180–180
rotate_yFLOAT0.0-180–180
rotate_zFLOAT0.0-180–180
background_hex_colorSTRING#000000
normalsoptBOOLEANfalse
remove_backgroundoptBOOLEANtrue

Outputs (3)

NameTypeDescription
IMAGEIMAGE
DEPTH_MAPIMAGE
MASKMASK