Usa POST /v1/images/edits con gpt-image-1 in CometAPI per modificare immagini tramite mask, prompt e opzioni di dimensione, in linea con il comportamento di modifica immagini di OpenAI.
curl --request POST \
--url https://api.cometapi.com/v1/images/edits \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: multipart/form-data' \
--form 'prompt=Add a small red ribbon to the paper boat.' \
--form image='@example-file' \
--form mask='@example-file'{
"created": 1773381100,
"usage": {
"input_tokens": 226,
"input_tokens_details": {
"image_tokens": 194,
"text_tokens": 32
},
"output_tokens": 4160,
"total_tokens": 4386
},
"data": [
{
"b64_json": "<base64-image-data>"
}
]
}gpt-image-1, gpt-image-1-mini e gpt-image-1.5 sono gestiti al meglio come route di modifica orientate prima di tutto a base64dall-e-3 può restituire output URL quando il percorso del provider lo supportaqwen-image-edit segue il comportamento di modifica specifico del provider dietro la stessa route CometAPIgpt-image-1 è andata a buon fine quando è stato consentito un timeout più lungo. La risposta ha restituito usage.input_tokens, usage.output_tokens, usage.total_tokens e un payload data[0].b64_json.Bearer token authentication. Use your CometAPI key.
Source image file. Start with one PNG or JPG input for the simplest flow.
Edit instruction describing the change you want.
"Add a small red ribbon to the paper boat."
The image editing model to use. Choose a current model from the Models page.
Optional PNG mask. Transparent areas indicate regions that should be edited.
Number of edited images to return.
Quality setting for models that support it.
high, medium, low Requested output format when supported by the selected model.
url, b64_json Requested output size when supported by the selected model.
curl --request POST \
--url https://api.cometapi.com/v1/images/edits \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: multipart/form-data' \
--form 'prompt=Add a small red ribbon to the paper boat.' \
--form image='@example-file' \
--form mask='@example-file'{
"created": 1773381100,
"usage": {
"input_tokens": 226,
"input_tokens_details": {
"image_tokens": 194,
"text_tokens": 32
},
"output_tokens": 4160,
"total_tokens": 4386
},
"data": [
{
"b64_json": "<base64-image-data>"
}
]
}