edit_image
Modify existing images via text prompts: remove/replace backgrounds, add/remove objects, restyle, extend canvas, or combine images. Provide image links and a model; optional mask for precise edits.
Instructions
Change existing images with an instruction: remove or replace the background, add or remove things, restyle, extend the canvas (outpaint), change the framing, or combine several images. Give https links to the images (links returned by this server work). Good models: "bfl/flux-kontext-pro", "openai/gpt-image-2", "google/gemini-3-pro-image". Pass mask_url (white = area to change) for precise edits with models that take one, e.g. "bfl/flux-pro-1.0-fill".
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| n | No | Number of results (image-only models). Default 1. | |
| model | Yes | Image model id from list_models with type "image" | |
| prompt | Yes | What to change, e.g. "remove the background, keep the product" | |
| mask_url | No | https link to a mask image (white = change, black = keep) | |
| image_urls | Yes | https links to 1–4 input images | |
| estimate_only | No | Only return the estimated price from AI Gateway's list prices. Nothing is started or charged. | |
| size_or_aspect | No | Aspect ratio like "16:9" or size like "1024x1024". Support varies by model. |