Edit Image
edit_imageEdit images using text prompts and optional masks. Supports data URLs, base64, or HTTPS URLs for input.
Instructions
Edit an image with a prompt and optional mask. Pass images as data URLs/base64/https URLs.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| n | No | Count of images to generate; provider limits apply. | |
| mask | No | Optional mask image (same encoding forms as items in 'images'). | |
| size | No | Unified size class: 'S' | 'M' | 'L'. | |
| model | Yes | Model id to use for editing. | |
| images | Yes | One or more image sources; most edit-capable models use only images[0]. Accepted forms: (1) http(s) URL, (2) local file path or file:// URL (the server will read and inline it), (3) data URL 'data:image/<type>;base64,<payload>', or (4) bare base64 string. Recommended: pass a data URL or base64 for best reliability. Supported types: PNG, JPEG, WEBP, GIF. Invalid or tiny placeholder images may be rejected by providers. | |
| prompt | Yes | Text instruction describing the edit to perform. | |
| quality | No | Quality preference: 'draft' | 'standard' | 'high'. | |
| provider | Yes | Provider: 'openai' | 'openrouter' | 'azure' | 'vertex' | 'gemini'. | |
| directory | No | Optional directory path to save edited images. If not provided, images will be saved to a temporary directory. | |
| background | No | Optional background alpha for AR engines supporting transparency. | |
| orientation | No | Orientation preference: 'square' | 'portrait' | 'landscape'. | |
| negative_prompt | No | Optional negative prompt honored by supporting providers. |