layer_mask
Destructive
A real layer mask (it moves with the layer). create from a saved selection channel (e.g. from select or select_with_ai) or from white, black, the layer's transparency or grayscale; delete; apply (bake the mask into the layer's transparency: a cut-out); invert. For a cut-out composite: place the photo as a layer, select on that layer, then create its mask from the channel.
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>",
"op": "<op>"
},
"name": "layer_mask"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| op | Yes | create replaces any existing mask. apply bakes the mask into the layer's alpha. | |
| image | Yes | Image id, as returned by open_photo. | |
| layer | No | Layer name. Defaults to the selected layer, or the topmost layer if none is selected. | |
| invert | No | create: invert the new mask. | |
| source | No | create: where the mask comes from. | channel |
| channel | No | source=channel: the saved selection to use. | |
| layer_id | No | Layer id, as inspect (and any tool that creates a layer) reports it. Takes priority over `layer`, and is the only way to address one of two layers that share a name. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| op | No | ||
| layer | No | ||
| has_mask | No | ||
| layer_id | No | ||
| mindset_notes | No |