> ## Documentation Index
> Fetch the complete documentation index at: https://docs.comfy.org/llms.txt
> Use this file to discover all available pages before exploring further.

# MediaPipeFaceMask - ComfyUI Built-in Node Documentation

> Complete documentation for the MediaPipeFaceMask node in ComfyUI. Learn its inputs, outputs, parameters and usage.

## ## 概述

此节点基于 MediaPipe 检测到的面部特征点创建二值掩码（黑白图像）。它会为每个检测到的面部区域绘制填充多边形，在批次中为每一帧生成一个掩码。当同一帧中检测到多张人脸时，这些掩码会被合并为单个掩码。

## ## 输入

| 参数               | 描述                                                                                       | 数据类型            | 是否必需 | 取值范围                    |
| ---------------- | ---------------------------------------------------------------------------------------- | --------------- | ---- | ----------------------- |
| `face_landmarks` | 来自 MediaPipe 面部检测节点的面部特征点数据。                                                             | FACE\_LANDMARKS | 是    | -                       |
| `regions`        | 选择要包含在掩码中的面部区域。`"all"` 会从所有面部区域（面部轮廓、嘴唇、眼睛、虹膜）的并集创建掩码。`"custom"` 允许您单独切换每个区域。默认值：`"all"` | COMBO           | 是    | `"all"`<br />`"custom"` |

当 `regions` 设置为 `"custom"` 时，以下额外的布尔参数将变为可用：

| 参数          | 描述                    | 数据类型    | 是否必需 | 取值范围       |
| ----------- | --------------------- | ------- | ---- | ---------- |
| `face_oval` | 在掩码中包含面部轮廓区域。默认值：True | BOOLEAN | 否    | True/False |
| `lips`      | 在掩码中包含嘴唇区域。默认值：True   | BOOLEAN | 否    | True/False |
| `eyes`      | 在掩码中包含眼睛区域。默认值：True   | BOOLEAN | 否    | True/False |
| `irises`    | 在掩码中包含虹膜区域。默认值：True   | BOOLEAN | 否    | True/False |

**注意：** 使用 `"all"` 模式时，掩码包含所有区域的组合。由于面部轮廓区域包含其他区域，选择 `"all"` 实际上会产生与仅选择面部轮廓相同的结果。

## ## 输出

| 输出名称   | 描述                                                                     | 数据类型 |
| ------ | ---------------------------------------------------------------------- | ---- |
| `MASK` | 一个二值掩码张量，其中面部区域为白色（值 1.0），背景为黑色（值 0.0）。该掩码具有与输入图像相同的尺寸，并且批次中每一帧对应一个掩码。 | MASK |

> 本文档由 AI 生成。如果您发现任何错误或有改进建议，欢迎贡献！ [在 GitHub 上编辑](https://github.com/Comfy-Org/embedded-docs/blob/main/comfyui_embedded_docs/docs/MediaPipeFaceMask/zh.md)

***

**Source fingerprint (SHA-256):** `92270002a42ed59bc75e676a6881e1899186d3c8a1bb4dd4c0d39b3762b5bb66`
