Inpaint image
inpaint_imageChange only the masked area of an image—edit, remove, replace, or add content there—while preserving every pixel outside the mask.
Instructions
Change only the masked area of an image (mask: white = change, black = keep): edit it, remove what is there, replace it, or add something inside it. The model is shown the area marked on a copy of the image; pixels outside the mask are preserved exactly.
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_path": "<image_path>",
"mask_path": "<mask_path>"
},
"name": "inpaint_image"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| seed | No | Seed for reproducible results; omit or -1 for random. Never reuse the seed the source image was generated with: use a different one or omit it | |
| action | No | edit: change the area as the prompt says; remove: erase what is there and fill with background (prompt optional, e.g. 'the bin'); replace: put the prompt's subject in its place; add: add the prompt's subject inside the area | edit |
| prompt | No | The change, or the subject to add/replace with; optional for remove | |
| quality | No | All run Qwen-Image 2.1 Turbo (8 steps): fast = ~1 MP (the default, fastest); balanced = ~1.5K; quality = native 2K (slowest; edits share 2K with their references) | |
| mask_path | Yes | Mask image: white = area to change, black = keep (or opaque strokes on a transparent layer) | |
| image_path | Yes | ||
| output_path | No | Optional destination (absolute, or relative to the project). Must be inside the project or the app output folder. Existing files are never overwritten; a numbered name is used instead. | |
| include_preview | No | Also return a small JPEG preview in the tool result. Default false: images stay local and are not sent to the model. |