ComfyUI Node
Color To Mask (UTK)
Converts chosen RGB value to a mask based on color distance. The node calculates the Euclidean distance between each pixel's color and the target RGB color. Pixels within the threshold distance are included in the mask (white), while others are excluded (black). With batch inputs, the **per_batch** parameter controls the number of images processed at once for memory efficiency. Parameters: - RGB values: Target color to match (0-255) - Threshold: Maximum color distance for inclusion (0-255) - Invert: Flip the mask (exclude matching colors instead) - Per batch: Number of images to process simultaneously
Color To Mask (UTK)
- images
- mask
◄red0►
◄green0►
◄blue0►
◄threshold10►
◄invertfalse►
◄per_batch16►
CategoryUniversalToolkit/Tools
Inputs (7)
| Name | Type | Default | Description |
|---|---|---|---|
| images | IMAGE | Input images to convert to masks | |
| red | INT | 00–255 | Red component of target color |
| green | INT | 00–255 | Green component of target color |
| blue | INT | 00–255 | Blue component of target color |
| threshold | INT | 100–255 | Maximum color distance for inclusion in mask |
| invert | BOOLEAN | false | Invert the mask (exclude matching colors) |
| per_batch | INT | 161–4096 | Number of images to process simultaneously |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| mask | MASK | — |