Nodes/ComfyUI-JH-PixelPro/Face: Skin Tone Tri-Region
ComfyUI Node

Face: Skin Tone Tri-Region

Skin-Only Shadows, Midtones, and Highlights

By jetthuangai·Created 5 months ago·Updated 4 months ago· 5
Face: Skin Tone Tri-Region
  • image
  • skin_mask
  • shadow_mask
  • midtone_mask
  • highlight_mask
shadow_cutoff0.33
highlight_cutoff0.66
soft_sigma1.0

JHPixelProSkinToneTriRegion is the face-pipeline version of luminosity masking: it splits the skin tones in a portrait into shadow, midtone, and highlight masks. Same idea as the color group's luminosity node, but scoped to skin - which makes it the tool you want when you're grading a face specifically. Evening out a forehead that's hotter than the rest of the face, adding a subtle golden lift to the shadow side of a cheek, or relighting the midtones without touching the jawline shadow - that's the territory.

The face group in this pack is built around MediaPipe detection and the align/edit/unwrap pipeline, and this node slots in as a mask producer after you've got a face. It computes luminance and produces three masks with Gaussian-smoothed tone boundaries. The optional skin_mask input is the interesting part: feed it a segmentation or SAM skin mask upstream, and the tone split is restricted to skin only - background highlights won't pollute your "highlight" mask. That's the difference between useful and not, in a portrait.

Inputs:

  • image - RGB IMAGE.
  • shadow_cutoff (default 0.33) - luminance below this counts as shadow tones.
  • highlight_cutoff (default 0.66) - luminance above this counts as highlight tones.
  • soft_sigma (default 1.0) - internal Gaussian sigma; higher = softer tone-region boundaries.
  • skin_mask (optional MASK) - gates which pixels count as skin.

Outputs: shadow_mask, midtone_mask, highlight_mask - three MASKs. Wire them into a grade, a beauty blend, or a relight pass.

Install is the shared pack install:

cd ComfyUI/custom_nodes
git clone https://github.com/jetthuangai/ComfyUI-JH-PixelPro.git
cd ComfyUI-JH-PixelPro
pip install -r requirements.txt

Restart and it's under ComfyUI-JH-PixelPro/face, or use ComfyUI Manager → search "ComfyUI-JH-PixelPro". The base requirements (kornia, OpenCV, SciPy) apply; you do not need the MediaPipe model download for this node - that's only triggered by the face-detect/landmarks nodes, so this one stays light even in minimal installs.

Troubleshooting: the big one is expecting it to know where a face is. Without a skin_mask, "skin tone" is really a luminance-based selection on the whole image - it will happily include a bright background as "highlight skin." Feed the skin mask in, and it becomes a genuinely skin-scoped tool. Also, keep shadow_cutoff below highlight_cutoff; crossing them produces degenerate masks rather than an error, which is more confusing than a crash would be.

CategoryComfyUI-JH-PixelPro/face

Inputs (5)

NameTypeDefaultDescription
imageIMAGE
shadow_cutoffFLOAT0.330–0.5Luminance values below this are treated as shadow tones.
highlight_cutoffFLOAT0.660.5–1Luminance values above this are treated as highlight tones.
soft_sigmaFLOAT1.00–8Internal Gaussian sigma for smoother tone-region boundaries.
skin_maskoptMASK

Outputs (3)

NameTypeDescription
shadow_maskMASK
midtone_maskMASK
highlight_maskMASK