Nodes/ComfyUI-UniversalToolkit/Separate Masks (UTK)
ComfyUI Node

Separate Masks (UTK)

Separates a mask into multiple masks based on connected components. The node identifies connected components (continuous regions) in the input mask and creates separate masks for each component that meets the size thresholds. Components are sorted by their horizontal position (left to right). Modes: - **area**: Preserves the exact shape of each component - **box**: Creates rectangular bounding boxes around each component - **convex_polygons**: Creates simplified convex polygon approximations Size thresholds filter out small noise or unwanted components. Components smaller than the specified width/height are ignored. Useful for: - Separating multiple objects in a single mask - Filtering components by size - Creating individual masks for batch processing - Object isolation and analysis

By whmc76·Created about a year ago·Updated 24 days ago· 70
Separate Masks (UTK)
  • mask
  • masks
size_threshold_width256
size_threshold_height256
modearea
max_poly_points8
CategoryUniversalToolkit/Mask

Inputs (5)

NameTypeDefaultDescription
maskMASKInput mask to separate into components
size_threshold_widthINT2560–4096Minimum width for components to be included
size_threshold_heightINT2560–4096Minimum height for components to be included
modeCOMBOareaMethod for creating separated masks
max_poly_pointsINT83–32Maximum points for polygon approximation (convex_polygons mode)

Outputs (1)

NameTypeDescription
masksMASK