Run ComfyUI Easily with InstaSD

Skip the complex setup. InstaSD helps creative professionals build workflows and deploy them to the world:

  • One-click deployment
  • Any model, any node
  • Powerful GPUs for rapid iteration
Get Started

FaceSegment

FaceSegment Node Documentation

Overview

The FaceSegment node is a custom component in the ComfyUI framework designed for detailed facial feature parsing and segmentation. Utilizing advanced segmentation models, the node can detect and separate various facial features, providing highly precise segmentation outputs for use in image processing workflows. The node leverages the Segformer model for face parsing, allowing users to specifically extract multiple facial features in a single process.

Functionality

The primary function of the FaceSegment node is to perform face parsing and segmentation based on selected facial features. It supports segmenting up to 19 different facial feature categories such as skin, nose, eyes, lips, and more. This makes it a versatile tool for tasks that require detailed facial analysis or customization, such as enhancing portrait images or creating masks for facial features.

Input Configuration

Required Input

  • Images: This is the primary input for the node. It accepts images that you wish to parse and segment. The images are expected to be in a compatible image format that ComfyUI supports.

Optional Parameters

  • Feature Selection: Choose which facial features to segment from options such as Skin, Nose, Eyeglasses, Eyes, Eyebrows, Ears, Mouth, Lips, Hair, and Neck. Each feature is selectable through a boolean interface.
  • Processing Resolution: Determines the resolution at which the image is processed, ranging from 128 to 2048 pixels. Higher resolutions can improve detail at the cost of increased memory usage.
  • Mask Blur: Applies a blur effect to mask edges, aiding in reducing jaggedness. Adjustable between 0 and 64.
  • Mask Offset: Alters the boundaries of masks by expanding or shrinking them, adjustable from -64 to 64.
  • Invert Output: Inverts the final image and mask outputs if enabled.
  • Background Options:
    • Type: Choose between 'Alpha' for transparent outputs or 'Color' to specify a custom background color.
    • Background Color: Select a custom color using a color picker if 'Color' background is selected.

Output

The FaceSegment node produces three outputs:

  1. Image: The processed image with the specified background and segmented features. If 'Alpha' is selected, the background is transparent.
  2. Mask: A binary mask highlighting the segmented facial features.
  3. Mask Image: Visual representation of the mask for easier visualization and analysis.

Usage in ComfyUI Workflows

The FaceSegment node is versatile in its applications within ComfyUI workflows. Here are some of its common uses:

  • Facial Feature Enhancement: Enhance or modify specific facial features by applying transformations selectively to features like eyes or lips.
  • Portrait Editing: Automate processes for retouching and editing portraits, such as skin smoothing or eye brightening, by using masks for precise control.
  • Advanced Compositing: Generate masks for creating complex composite images in which only certain facial features are combined with other images or backgrounds.
  • Custom Background Application: Automatically replace or modify backgrounds behind specific facial features while maintaining original feature details.

Special Features and Considerations

  • Model Management: The node checks for required model files and downloads them if necessary, ensuring users always have access to the latest segmentation capabilities without manual updates.
  • Comprehensive Feature Coverage: The node supports multiple feature selections simultaneously, allowing for complex segment configurations.
  • Performance Tuning: Users can tweak processing details like resolution and mask effects to balance between quality and computational efficiency.

By integrating the FaceSegment node into your ComfyUI workflows, you can achieve precise and customizable facial feature manipulation, enhancing both the quality and versatility of your image processing projects.