Generate Segmentation Mask
sdnext_maskGenerate a segmentation mask for an image, automatically creating one when none is provided. Specify mask type and model to return the desired mask.
Instructions
Generate a segmentation mask for an image (SD.Next /sdapi/v1/mask). Auto-masks when no mask is given. Mask models/types from sdnext_list_masking.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"image": "<image>",
"type": "<type>"
},
"name": "sdnext_mask"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| mask | No | Optional existing mask image (base64); omitted = auto-masking. | |
| type | Yes | Mask type to return (e.g. "original", "mask", "colormap"). | |
| image | Yes | Base64-encoded image (raw base64, data: URL, or "upload:<id>" ref). | |
| model | No | Segmentation model name (from sdnext_list_masking). | |
| params | No | Masking settings (colormap, thresholds, ...). |