Image Editing (gpt-image-1)
Developing
POST
https://api.comet.com/v1/images/edits
Maintainer:Not configured
Image Editing Request Parameters
Parameter | Type | Required | Description |
---|---|---|---|
image | file or file array | ✅ | The image(s) to edit. Must be a supported image file or array. • gpt-image-1: PNG, WEBP, or JPG, each <25MB. • dall-e-3: 1 square PNG <4MB. |
prompt | string | ✅ | A text description of the desired image(s). • Max length: 1000 chars for dall-e-3, 32000 chars for gpt-image-1. |
mask | file | Optional PNG mask image. Transparent areas (alpha = 0) indicate regions to edit. Must match size of image and be <4MB. Applies to first image. | |
model | string | Model to use: "dall-e-3" or "gpt-image-1" . | |
n | integer or null | Number of images to generate. Must be between 1 and 10. Default: 1. | |
quality | string or null | For gpt-image-1 only. Options: "high" , "medium" , "low" .Default: "auto" . | |
response_format | string or null | Response format. Options: "url" or "b64_json" .Only dall-e-3 supports "url" (valid for 60 minutes). | |
size | string or null | Image size: • gpt-image-1: "1024x1024" , "1536x1024" , "1024x1536" , "auto" (default)• dall-e-3: "256x256" , "512x512" , "1024x1024" |
Request
Header Params
Authorization
string
optional
Example:
Bearer {{api-key}}
Body Params multipart/form-data
image
file
required
The image(s) to edit. Must be a supported image file or array.
- gpt-image-1: PNG, WEBP, or JPG, each <25MB.
- dall-e-3: 1 square PNG <4MB.
Example:
MQ==/test.png
prompt
string
required
Example:
Put on glasses
model
string
optional
Example:
gpt-image-1
mask
file
optional
Optional PNG mask image. Transparent areas (alpha = 0) indicate regions to edit.
Must match size of image and be <4MB. Applies to first image.
n
string
optional
Default:
1
quality
enum<string>
optional
Default: "auto".
Allowed values:
highmediumlow
Default:
auto
response_format
enum<string>
optional
Only "dall-e-3" supports "url" (valid for 60 minutes).
Allowed values:
urlb64_json
size
string
optional