Sapiens2 Normal Advanced
Surface Normals for a Person, With a Mask Strap Attached
- model
- image
- mask
- normal_map
- preview
- foreground_mask
- result
Feed this node a photo of a person and it hands back a surface normal map - that purple-blue image where every pixel encodes which way the surface at that point faces. Normals aren't depth: a depth map tells you how far things are, a normal map tells you their orientation. In the SD ecosystem that distinction matters because normals are what give a flat render the illusion of sculpted detail, and they're exactly the thing you feed into a renderer, a relight pass, or a 3D pipeline.
Sapiens2 Normal Advanced is the "bring your own masking" sibling of the easy Sapiens2 Normal node. It runs Meta's Sapiens2 normal model on a human subject and gives you four knobs the easy version hides: a preview mode, background preservation, an optional mask input, and the raw result underneath.
How it works
The Sapiens2 normal model (the metasim_render_people config, at 1024x768) predicts a per-pixel normal for the person in your image. The mask input is the interesting one - wire it a merged_mask from Sapiens2 Segmentation and the node restricts normal estimation to the subject, which keeps the background from polluting the map. And preserve_background is what happens to the area outside that mask: off (the default) means it goes black, on means the original photo shows through there. The easy way to think about it: mask first, worry about the background second.
The inputs that matter
preview_mode-result,overlay,side_by_side, orsource. Purely cosmetic; pickresultto see the clean map,overlayto check alignment against the original.preserve_background- off by default. Turn it on if you want the normal map to cover the whole frame rather than just the subject.mask- the one worth wiring. A foreground mask from the segmentation node is the difference between a clean subject normal and a map full of background noise.
The outputs
Four sockets, and honestly you'll use two:
normal_map- the map itself. This is the one you feed somewhere: into this pack'sSapiens2 Pointmap Mesh Advancedas itsnormal_mapinput for better mesh shading, or into any downstream node that consumes normals.preview- the formatted view per yourpreview_mode.foreground_mask- the mask the node computed/used, handy if you want to chain it further.result- aSAPIENS2_RESULTwith the raw tensors (normal,masked_normal). Only useful if you're building a graph that inspects internals.
Installing it
It ships in the Bogyie/ComfyUI-Sapiens2-Easy pack:
cd ComfyUI/custom_nodes
git clone https://github.com/Bogyie/ComfyUI-Sapiens2-Easy.git
cd ComfyUI-Sapiens2-Easy
python install.py
Restart ComfyUI, or grab it via ComfyUI Manager (search "ComfyUI-Sapiens2-Easy"). You also need a Sapiens2 Model Loader (or the manual variant) set to task = normal feeding this node - the loader auto-downloads facebook/sapiens2-normal-{size} into ComfyUI/models/sapiens2/<task>/ on first use, which is a big download, so budget for it.
Where people get burned
The normal map is only as good as your mask. Feed in a person with a cluttered background and no mask, and you'll get a normal map that's honestly mostly background. Start with Sapiens2 Segmentation → this node, the way the README's recommended first workflow does. And if you're on MPS (Apple Silicon), the pack's own guidance is that auto device selection avoids MPS entirely - some PyTorch/MPS builds produce wrong Sapiens2 outputs, so pick cuda or cpu unless you've tested yours.
Inputs (5)
| Name | Type | Default | Description |
|---|---|---|---|
| model | SAPIENS2_MODEL | — | |
| image | IMAGE | — | |
| preview_mode | COMBO | result | 4 options: result, overlay, side_by_side, source |
| preserve_background | BOOLEAN | false | — |
| maskopt | MASK | — |
Outputs (4)
| Name | Type | Description |
|---|---|---|
| normal_map | IMAGE | — |
| preview | IMAGE | — |
| foreground_mask | MASK | — |
| result | SAPIENS2_RESULT | — |