ComfyUI > Nodes > OcclusionMask > Image Occlusion Node

ComfyUI Node: Image Occlusion Node

Class Name

ImageOcclusion

Category
image/mynode2
Author
ialhabbal (Account age: 3559days)
Extension
OcclusionMask
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

Image Occlusion Node Description

Enhance image processing with occlusion masks for facial regions using advanced face detection techniques.

Image Occlusion Node:

The ImageOcclusion node is designed to enhance image processing by applying occlusion masks to images, particularly focusing on facial regions. This node leverages advanced face detection techniques to identify and isolate facial areas within an image, allowing for precise application of occlusion masks. The primary goal of this node is to facilitate the creation of masks that can obscure or highlight specific parts of an image, which is particularly useful in AI art and image manipulation tasks. By using models like insightface for face detection and ONNX for mask application, the node ensures high accuracy and efficiency. This capability is beneficial for artists and developers looking to automate the process of masking in images, especially when dealing with complex facial features.

Image Occlusion Node Input Parameters:

input_image

The input_image parameter is the primary image that you want to process using the ImageOcclusion node. This image serves as the base for detecting facial features and applying occlusion masks. The quality and resolution of the input image can significantly impact the accuracy of face detection and the effectiveness of the mask application.

mask_type

The mask_type parameter determines the type of mask to be applied to the image. Options include "Occluder," "XSeg," and "Object-only," each providing different masking effects. The choice of mask type affects how the image is processed and which areas are highlighted or obscured.

object_mask_threshold

The object_mask_threshold parameter sets the threshold for mask application, determining which parts of the image are included in the mask. Values range from 0 to 1, with higher values resulting in more selective masking. This parameter is crucial for fine-tuning the mask's precision.

feather_radius

The feather_radius parameter controls the amount of feathering or blurring applied to the mask edges. A higher radius results in smoother transitions between masked and unmasked areas, enhancing the visual quality of the mask. The default value is 0, meaning no feathering is applied.

grow_left, grow_right, grow_up, grow_down

These parameters allow you to expand or contract the mask in specific directions. Positive values grow the mask, while negative values shrink it. This feature is useful for adjusting the mask to better fit the desired area of the image.

dilation_radius

The dilation_radius parameter specifies the radius for mask dilation, which can help in expanding the mask uniformly in all directions. This is particularly useful when the initial mask is too tight around the object.

expansion_iterations

The expansion_iterations parameter determines how many times the mask expansion process is repeated. A higher number of iterations results in a larger mask, which can be useful for covering more of the image.

Image Occlusion Node Output Parameters:

OriginalImage

The OriginalImage output is the processed version of the input image, with the selected mask applied. This output allows you to see the effects of the mask on the original image, providing a visual representation of the occlusion process.

SelectedMask

The SelectedMask output provides the mask that was applied to the image. This mask can be used for further processing or analysis, offering a clear view of which parts of the image were affected by the occlusion.

Image Occlusion Node Usage Tips:

  • Ensure that the input image is of high quality and resolution to improve face detection accuracy.
  • Experiment with different mask_type options to achieve the desired masking effect for your project.
  • Use the feather_radius parameter to smooth out mask edges and improve the visual quality of the output.
  • Adjust the object_mask_threshold to fine-tune the selectivity of the mask, especially when dealing with complex images.

Image Occlusion Node Common Errors and Solutions:

Occluder model not loaded!

  • Explanation: This error occurs when the occluder model required for mask application is not loaded.
  • Solution: Ensure that the occluder model is correctly installed and loaded before running the node. Check the model path and configuration settings.

Cannot convert array of shape <shape> to image

  • Explanation: This error indicates that the input image array has an incompatible shape for conversion to a PIL image.
  • Solution: Verify that the input image is in the correct format and shape. Ensure that it is a 3D array with dimensions corresponding to height, width, and color channels.

Image Occlusion Node Related Nodes

Go back to the extension to check out more related nodes.
OcclusionMask
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.