Render Mutiple SMPL Mesh
Multi-Subject SMPL to Image, Depth, and Mask
- smpl_multi_subjects
- IMAGE
- DEPTH_MAP
- MASK
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). Withremove_backgroundon (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.
Inputs (14)
| Name | Type | Default | Description |
|---|---|---|---|
| smpl_multi_subjects | SMPL_MULTIPLE_SUBJECTS | — | |
| draw_platform | BOOLEAN | false | — |
| depth_only | BOOLEAN | false | — |
| fx_offset | FLOAT | 0.000–10000 | — |
| fy_offset | FLOAT | 0.000–10000 | — |
| move_x | FLOAT | 0.00-500–500 | — |
| move_y | FLOAT | 0.00-500–500 | — |
| move_z | FLOAT | 0.00-500–500 | — |
| rotate_x | FLOAT | 0.0-180–180 | — |
| rotate_y | FLOAT | 0.0-180–180 | — |
| rotate_z | FLOAT | 0.0-180–180 | — |
| background_hex_color | STRING | #000000 | — |
| normalsopt | BOOLEAN | false | — |
| remove_backgroundopt | BOOLEAN | true | — |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| IMAGE | IMAGE | — |
| DEPTH_MAP | IMAGE | — |
| MASK | MASK | — |