ComfyUI > Nodes > OcclusionMask

ComfyUI Extension: OcclusionMask

Repo Name

OcclusionMask

Author
ialhabbal (Account age: 3559 days)
Nodes
View all nodes(2)
Latest Updated
2025-06-24
Github Stars
0.03K

How to Install OcclusionMask

Install this extension via the ComfyUI Manager by searching for OcclusionMask
  • 1. Click the Manager button in the main menu
  • 2. Select Custom Nodes Manager button
  • 3. Enter OcclusionMask 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
  • 16GB VRAM to 80GB VRAM GPU machines
  • 400+ preloaded models/nodes
  • Freedom to upload custom models/nodes
  • 200+ ready-to-run workflows
  • 100% private workspace with up to 200GB storage
  • Dedicated Support

Run ComfyUI Online

OcclusionMask Description

OcclusionMask is a ComfyUI custom node designed for advanced face occlusion, segmentation, and masking. It utilizes state-of-the-art face detection with insightface buffalo models to ensure robust and accurate results.

OcclusionMask Introduction

OcclusionMask is a powerful extension designed to enhance your AI art projects by providing advanced face occlusion, segmentation, and masking capabilities. This extension leverages state-of-the-art face detection models, specifically the insightface buffalo models, to deliver robust and accurate results. Whether you're working on digital art, animations, or any project that involves facial imagery, OcclusionMask can help you achieve precise and flexible masking solutions. It addresses common challenges such as accurately detecting and processing faces in images, even when they are partially obscured or occluded.

Demo Screenshot (https://raw.githubusercontent.com/ialhabbal/OcclusionMask/main/media/Screenshot%202025-06-19%20205120.jpg)

How OcclusionMask Works

At its core, OcclusionMask uses advanced face detection technology to identify and process faces within images. Imagine it as a smart assistant that can see and understand faces in your artwork, even if they're partially hidden. Once a face is detected, the extension can apply various types of masks to it, allowing you to manipulate or highlight specific facial features. If no face is detected, the extension smartly defaults to processing the entire image, ensuring that your workflow is never interrupted. This adaptability makes it a versatile tool for AI artists who need reliable face processing capabilities.

OcclusionMask Features

OcclusionMask offers a range of features designed to give you control and flexibility over your masking tasks:

  • Automatic Face Detection: Utilizes insightface's FaceAnalysis API with buffalo models for precise face localization.
  • Automatic Fallback: Processes the whole image if no face is detected, ensuring seamless operation.
  • Multiple Mask Types: Choose from Occluder, XSeg, or Object-only masks to suit your specific needs.
  • Mask Placement: Ensures that the generated mask is accurately placed back onto the original image.
  • Fine Mask Control: Customize your masks with adjustable thresholds, feather/blur radius, directional growth/shrink options, and dilation/expansion iterations.
  • ONNX Runtime Acceleration: Enjoy fast processing with ONNX models, optimized for both CUDA and CPU.
  • Versatile Image Handling: Accepts various image formats, including PIL Images, numpy arrays, and torch tensors, converting them as needed.
  • Batch Image Loading: Efficiently load and process multiple images from a directory or video source, with support for various file types.

OcclusionMask Models

OcclusionMask relies on the insightface buffalo models for face detection. These models are known for their accuracy and reliability in identifying facial features, making them ideal for artists who require precise face processing. The extension also uses ONNX models for occlusion and XSeg tasks, ensuring fast and efficient performance.

Troubleshooting OcclusionMask

Here are some common issues you might encounter while using OcclusionMask, along with solutions:

  • Import Errors: If you encounter import errors for onnxruntime, torch, cv2, or insightface, ensure your Python environment is activated and all dependencies are installed.
  • Face Detection Failures: If face detection isn't working, verify that your buffalo models are correctly placed in the designated directory and that INSIGHTFACE_HOME is set (the extension sets this automatically).

Learn More about OcclusionMask

To further enhance your experience with OcclusionMask, consider exploring additional resources such as tutorials, documentation, and community forums. These platforms can provide valuable insights and support, helping you make the most of this powerful extension in your AI art projects.

OcclusionMask Related Nodes

RunComfy
Copyright 2025 RunComfy. All Rights Reserved.

RunComfy is the premier ComfyUI platform, offering ComfyUI online environment and services, along with ComfyUI workflows featuring stunning visuals. RunComfy also provides AI Models, enabling artists to harness the latest AI tools to create incredible art.