Edit image
edit_imageEdit an existing image using a natural-language instruction while preserving its width, height and aspect ratio by default. Never overwrites the input file.
Instructions
Edit an existing image with a natural-language instruction (e.g. 'make the background nighttime, keep the foreground unchanged'). Preserves the input's width, height and aspect ratio by default. The input file is never overwritten.
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>",
"prompt": "<prompt>"
},
"name": "edit_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 | |
| prompt | Yes | The edit instruction, written by you in English and used as is (Kokon does not rewrite it): start with the operation (Change, Replace, Remove, Add, Turn...), say exactly what changes, where, and what it becomes, in 20-60 words; describe only what changes and end with 'Keep everything else in the image unchanged.' For a whole-image style or mood change, end with 'Keep the composition and the subjects unchanged.' instead. | |
| 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) | |
| image_path | Yes | Image to edit (absolute, or relative to the project) | |
| 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. | |
| preserve_dimensions | No | Keep the input's exact width/height (default true) |