ComfyUI  >  Nodes  >  a-person-mask-generator >  A Person Mask Generator

ComfyUI Node: A Person Mask Generator

Class Name


A Person Mask Generator - David Bielejeski
djbielejeski (Account age: 4285 days)
Latest Updated
Github Stars

How to Install a-person-mask-generator

Install this extension via the ComfyUI Manager by searching for  a-person-mask-generator
  • 1. Click the Manager button in the main menu
  • 2. Select Custom Nodes Manager button
  • 3. Enter a-person-mask-generator in the search bar
After installation, click the  Restart button to restart ComfyUI. Then, manually refresh your browser to clear the cache and access the updated list of nodes.

Visit ComfyUI Online for ready-to-use ComfyUI environment

  • Free trial available
  • High-speed GPU machines
  • 200+ preloaded models/nodes
  • Freedom to upload custom models/nodes
  • 50+ ready-to-run workflows
  • 100% private workspace with up to 200GB storage
  • Dedicated Support

Run ComfyUI Online

A Person Mask Generator Description

Generate precise image masks for person's hair, body, face, and clothes using advanced segmentation techniques for targeted editing.

A Person Mask Generator:

The APersonMaskGenerator is a powerful tool designed to create precise masks for various parts of a person's image, such as hair, body, face, and clothes. This node leverages advanced image segmentation techniques to identify and isolate specific regions within an image, making it an invaluable asset for AI artists looking to perform tasks like inpainting, background replacement, or targeted image editing. By generating accurate masks, it allows for greater control and precision in your creative projects, ensuring that modifications are applied only to the desired areas without affecting the rest of the image.

A Person Mask Generator Input Parameters:


This parameter takes an image as input, which serves as the base for mask generation. The image should be in a format that the node can process, typically a standard image file like JPEG or PNG. The quality and resolution of the input image can significantly impact the accuracy of the generated masks.


This parameter is a list of strings specifying the parts of the image you want to mask. The available options include "hair", "body", "face", and "clothes". Each target corresponds to a specific region in the image, and the node will generate masks for these regions based on the provided list. The more specific your targets, the more precise the mask generation will be.


This integer parameter controls the dilation or erosion of the generated masks. Positive values will dilate (expand) the mask, making the masked area larger, while negative values will erode (shrink) the mask, making the masked area smaller. The default value is 0, which means no dilation or erosion is applied. Adjusting this parameter can help refine the edges of the mask to better fit the desired regions.

A Person Mask Generator Output Parameters:


The output is an image where the specified regions are masked. This mask image can be used for various purposes, such as inpainting, background replacement, or any other image editing tasks that require precise region isolation. The mask image will have the same dimensions as the input image, with the masked areas clearly defined.

A Person Mask Generator Usage Tips:

  • Ensure your input image is of high quality and resolution to achieve the best results with mask generation.
  • Use specific and relevant mask targets to get precise masks for the desired regions.
  • Adjust the mask_dilation parameter to fine-tune the edges of your masks, especially if you need to blend the masked area smoothly with the surrounding regions.
  • Experiment with different combinations of mask targets to see how they interact and affect the final mask image.

A Person Mask Generator Common Errors and Solutions:

"Input image is None"

  • Explanation: This error occurs when the input image parameter is not provided or is invalid.
  • Solution: Ensure that you provide a valid image file as input to the node.

"Mask targets list is empty"

  • Explanation: This error happens when no mask targets are specified.
  • Solution: Provide at least one valid mask target in the mask_targets parameter to generate a mask.

"Invalid mask target specified"

  • Explanation: This error occurs when an unrecognized mask target is included in the mask_targets list.
  • Solution: Ensure that all mask targets are valid options such as "hair", "body", "face", or "clothes".

"Mask dilation value out of range"

  • Explanation: This error happens when the mask_dilation parameter is set to an excessively high or low value.
  • Solution: Use reasonable values for mask_dilation, typically within the range of -10 to 10, to avoid extreme dilation or erosion effects.

A Person Mask Generator Related Nodes

Go back to the extension to check out more related nodes.

© Copyright 2024 RunComfy. All Rights Reserved.

RunComfy is the premier ComfyUI platform, offering ComfyUI online environment and services, along with ComfyUI workflows featuring stunning visuals.