ComfyUI Node
Mask Refine (Morph)
A ComfyUI node in XJNodes/segs with 7 inputs and 1 output.
Mask Refine (Morph)
- image
- mask
- refined_mask
◄grow_pixels50►
◄smooth_pixels3►
◄edge_threshold0.30►
◄use_edge_detectiontrue►
◄color_threshold0.00►
CategoryXJNodes/segs
Inputs (7)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | — | |
| mask | MASK | — | |
| grow_pixels | INT | 500–200 | Number of pixels to dilate/grow. Use with edge_threshold and color_threshold to control growth. |
| smooth_pixels | INT | 30–20 | Sigma for Gaussian smoothing. Higher values create smoother but less detailed edges. |
| edge_threshold | FLOAT | 0.300–1 | Threshold for edge-based refinement (0-1). Lower values are more sensitive to edges. Use with use_edge_detection to control growth at edges. |
| use_edge_detection | BOOLEAN | true | Whether to use edge detection to limit growth. Disable for similar colors or when edge detection is too aggressive. |
| color_threshold | FLOAT | 0.000–1 | If > 0, stop growth when pixel color differs from mask average by more than this threshold (0-1). Use instead of edge detection for similar colors. |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| refined_mask | MASK | — |