Visit ComfyUI Online for ready-to-use ComfyUI environment
FilterZeroMasksAndCorrespondingImages: Filters out zero masks and their corresponding images to optimize processing and improve dataset quality.
The FilterZeroMasksAndCorrespondingImages
node is designed to process a set of masks and their corresponding images, filtering out masks that contain no non-zero values (i.e., masks that are entirely zero). This node is particularly useful in scenarios where you need to ensure that only relevant masks and their associated images are processed further, thereby optimizing computational resources and improving the quality of the results. By separating non-zero masks from zero masks, this node helps in maintaining a clean dataset, which is crucial for tasks such as image segmentation, object detection, and other AI-driven image processing applications.
This parameter represents the list of masks that you want to filter. Each mask is typically a binary or grayscale image where non-zero values indicate areas of interest. The function of this parameter is to provide the node with the data it needs to identify and separate non-zero masks from zero masks. There are no specific minimum, maximum, or default values for this parameter as it depends on the dataset you are working with.
This optional parameter represents the list of original images corresponding to the masks. If provided, the node will also filter and return the images associated with the non-zero masks. This ensures that the images and masks remain synchronized after filtering. If the number of original images does not match the number of masks, a warning will be issued, and the images will be ignored. There are no specific minimum, maximum, or default values for this parameter as it depends on the dataset you are working with.
This output parameter contains the stack of masks that have non-zero values. These are the masks that passed the filtering criteria and are considered relevant for further processing. The function of this parameter is to provide a clean set of masks that can be used in subsequent image processing tasks.
This output parameter contains the stack of original images corresponding to the non-zero masks. This ensures that the images remain synchronized with their respective masks after filtering. If the original_images
parameter was not provided or ignored due to a mismatch in the number of images and masks, this output will be None
.
This output parameter contains the stack of original images corresponding to the zero masks. These are the images associated with masks that were entirely zero and thus filtered out. If the original_images
parameter was not provided or ignored, this output will be None
.
This output parameter contains the indexes of the zero masks in the original list. This helps in identifying which masks were filtered out and can be useful for debugging or further analysis. If the original_images
parameter was not provided or ignored, this output will be None
.
original_images
parameter to simplify the output.{imgs_num}
) is not equal to number of masks ({masks_num}
)original_images
parameter..to(device)
to move tensors to the desired device.© Copyright 2024 RunComfy. All Rights Reserved.