Nodes/Skin Beauty CN|人物肤色美白/Skin Beauty | Process + Preview
ComfyUI Node

Skin Beauty | Process + Preview

Whitening skin, with a draggable before/after built in

By chen-zhang-ai·Created about a month ago·Updated about a month ago· 10
Skin Beauty | Process + Preview
  • 图像
  • 美白参数
  • 外部遮罩
  • 美白图像
  • 肤色蒙版
  • 预览图
  • 处理报告
蒙版模式自动肤色(推荐)
语义蒙版自动:已有模型则使用
批处理自动:逐张省显存
计算设备自动
生成节点预览true
实时精确预览true

This is the workhorse of the ComfyUI-SkinBeauty-CN pack. Give it an IMAGE and a Settings node, and it returns a whitened IMAGE, the skin mask it used, a full-resolution preview, and a bilingual report - all with a draggable before/after line right in the node so you can compare without alt-tabbing. It's deterministic pixel processing in pure PyTorch, not a generation model: no prompt, no seed, nothing that redraws the face. It shifts warm, yellow skin toward cool-white (冷白皮) while trying to leave background, clothing, highlights, and pores alone.

The natural home for it is after a VAE decode, upscale, or Face Detailer pass as a final color grade before saving - and, especially, on reference images before an image-to-video node, so you don't discover the skintone is off after an expensive render. Video models won't take a LATENT, so this must sit where an IMAGE already exists.

How it works

An adaptive YCbCr skin-color heuristic builds a soft probability mask - lightweight, but it can genuinely be fooled by beige walls, wood, leather, and sand-colored clothes. Optionally, a MediaPipe face/body skin segmentation multiplies into that color mask to reject false positives. The image goes sRGB → linear RGB → CIELAB, where the pack lifts L* (with shadow-aware lift and highlight protection), pulls b* cooler/less-yellow, nudges a* for a controlled rosy tone, and applies restrained chroma scaling - then masks and blends back. There's an explicit texture-preservation term so smoothing doesn't turn skin to plastic. If it OOMs on CUDA it auto-retries sequentially, then on CPU, rather than crashing.

The inputs that matter

  • 图像 (IMAGE) - your photo or frame batch.
  • 美白参数 (SKIN_BEAUTY_CONFIG) - from the Settings node. Mandatory.
  • 蒙版模式 (mask mode) - 自动肤色(推荐)/ auto skin (recommended); 外部遮罩优先 / external-mask-first; 仅外部遮罩 / external-only, which errors if no mask is connected rather than silently falling back; 全图调色 / whole-image color grade.
  • 语义蒙版 (semantic mask) - 自动:已有模型则使用 / auto (uses a local model if present, otherwise pure algorithm); 纯算法:零依赖 / pure algorithm; MediaPipe:允许首次下载 / allow first download. The first is the sensible default.
  • 外部遮罩 (MASK, optional) - the highest-accuracy path. For scenes with beige clothing or complex backgrounds, connect a human-checked skin mask and use one of the external-mask modes.
  • 批处理 and 计算设备 - leave both on 自动. The default sequential mode is the VRAM-frugal choice for 3K–5K reference images.

The preview that isn't lying to you

The two booleans 生成节点预览 and 实时精确预览 control the built-in comparer. When on, the node submits ComfyUI's official partial-execution prompt - only this node plus its IMAGE/config/MASK ancestors run, never your downstream save or video nodes - and draws a 1px draggable divider between before and after. It's debounced (650 ms) and drops stale results. Crucially, the IMAGE outputs are always full resolution: the thumbnail you see is display-only scaling, so the preview and the production output are the same result.

Outputs

  • 美白图像 (IMAGE) → PreviewImage / SaveImage or any downstream node. Full-res, original size.
  • 肤色蒙版 (MASK) → the mask it actually used; wire it to a mask viewer to audit what got selected.
  • 预览图 (IMAGE) → a full-resolution alias, not a screen thumbnail.
  • 处理报告 (STRING) → a bilingual (中/EN) report. Put it in a ShowText to confirm whether it used the MediaPipe semantic mask or the pure-algorithm fallback.

Install, and the MediaPipe caveat

Core install needs nothing beyond ComfyUI itself - the pack ships dependencies = []. Manager search skin-beauty-cn/ComfyUI-SkinBeauty-CN, or git clone https://github.com/chen-zhang-ai/ComfyUI-SkinBeauty-CN.git into custom_nodes/, restart, Ctrl+F5. Don't install MediaPipe unless you actually want semantic masks. It's mediapipe==0.10.21 pinned, and it drags in numpy<2, protobuf, and opencv-contrib-python - a real risk of stepping on other nodes' OpenCV. If you do go in, also drop selfie_multiclass_256x256.tflite (from Google's MediaPipe models, ~16 MB, SHA256 published in the README) into ComfyUI/models/mediapipe/. Skip all of that and the pack just falls back to the pure algorithm - that fallback is expected behavior, not a broken install.

Where people get burned

Beige clothes or walls getting masked → lower 肤色识别 on the Settings node, or connect an external MASK. OOM → sequential batch + CPU. And set expectations: this is tonal correction, not a beauty re-roll - smoothing is gentle, it won't erase acne, and it won't redraw a nose.

Category图像/人物美颜·中文

Inputs (9)

NameTypeDefaultDescription
图像IMAGE
美白参数SKIN_BEAUTY_CONFIG
蒙版模式COMBO自动肤色(推荐)4 options: 自动肤色(推荐), 外部遮罩优先, 仅外部遮罩, 全图调色
语义蒙版COMBO自动:已有模型则使用3 options: 自动:已有模型则使用, 纯算法:零依赖, MediaPipe:允许首次下载
批处理COMBO自动:逐张省显存3 options: 自动:逐张省显存, 逐张处理, 整批并行
计算设备COMBO自动3 options: 自动, GPU, CPU
生成节点预览BOOLEANtrue
实时精确预览BOOLEANtrue
外部遮罩optMASK

Outputs (4)

NameTypeDescription
美白图像IMAGE
肤色蒙版MASK
预览图IMAGE
处理报告STRING