Edit images from text - GPT Image 2
Edit or recompose one or more input images from a text prompt using OpenAI's GPT Image 2.5 model.
Key Features:
- Accepts 1-16 input images, used together as the visual context
- Restyle a single image, or compose a new one from several
- Same output controls as text-to-image (resolution, aspect ratio, format, compression, quality)
Best for:
- Product and scene variations from an existing shot
- Combining a subject, a background and a style reference in one call
- Adding or correcting text on an existing image
Output: one edited image per num_images (up to 10), delivered as CDN URLs in the task's generated array. The input images are never modified.
Credits: editing sends your images to the model and their input tokens dominate the cost, so it is priced differently from generation: flat units per output image by quality (low x1, medium x4, high x6), with resolution not affecting the price.
The request is processed asynchronously: the endpoint returns a task id immediately. Retrieve the result by polling the task endpoint or by providing an optional webhook_url.
Request
- Base URL: https://api.magnific.com
- URL: https://api.magnific.com/v1/ai/text-to-image/gpt-image-2-5-edit
- Auth: API key in header x-magnific-api-key
Request body
Example request
{
"prompt": "Put the product on a marble surface",
"reference_images": [
"https://example.com/product.jpg"
],
"webhook_url": "https://www.example.com/webhook",
"num_images": 1,
"variant": "flare",
"resolution": "1k",
"aspect_ratio": "auto",
"quality": "medium",
"output_format": "png",
"background": "auto",
"output_compression": 80,
"moderation": "auto"
}Response
OK - The request has succeeded and the GPT Image 2.5 Edit process has started.
Example response
{
"data": {
"generated": [
"https://openapi-generator.tech",
"https://openapi-generator.tech"
],
"task_id": "046b6c7f-0b8a-43b9-b35d-6489e6daee91",
"status": "CREATED"
}
}Changes
No recorded changes to this operation across all 1 revision of this API.