Vai al contenuto principale
POST
/
bria
/
image
/
edit
/
{action}
curl --request POST \ --url https://api.cometapi.com/bria/image/edit/{action} \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data ' { "image": "https://raw.githubusercontent.com/cometapi-dev/.github/refs/heads/main/assets/img/original_image.png", "mask": "https://raw.githubusercontent.com/cometapi-dev/.github/refs/heads/main/assets/img/mask_image.png" } '
{}

Panoramica

L’API di modifica immagini di Bria offre una suite completa di strumenti per manipolare e migliorare le immagini.
Dopo una chiamata API riuscita, usa il request_id restituito per interrogare i risultati tramite l’endpoint Query Status.Il parametro sync è fisso in questa interfaccia — non è necessario specificarlo.

Operazioni supportate

OperationDescriptionDocumentation
eraseRimuove oggetti dalle immaginiDocumentazione Bria Erase
gen_fillRiempimento generativo per aree mascherateDocumentazione Bria Gen Fill
expandEspande la tela dell’immagineDocumentazione Bria Expand
enhanceMigliora la qualità dell’immagineDocumentazione Bria Enhance
increase_resolutionAumenta la risoluzione dell’immagineDocumentazione Bria Upscale
replace_backgroundSostituisce lo sfondo dell’immagineDocumentazione Bria Background
Fai riferimento alla documentazione ufficiale per l’elenco dei parametri specifici di ogni operazione.

Autorizzazioni

Authorization
string
header
obbligatorio

Bearer token authentication. Use your CometAPI key.

Intestazioni

Content-Type
string

Must be application/json.

Parametri del percorso

action
string
obbligatorio

Editing action to perform. Supported values: erase, gen_fill, expand, enhance, increase_resolution, replace_background.

Corpo

application/json
image
string

Source image as a public URL or base64-encoded data URI. Accepted formats: JPEG, PNG, WebP. Maximum 12 MB.

mask
string

Mask image as a public URL or base64. White areas mark the region to edit; black areas are preserved. Required for erase, gen_fill, and expand actions.

prompt
string

Text description of the desired edit. Required for gen_fill and replace_background actions.

num_results
integer

Number of result variants to generate. Default: 1.

sync
boolean

When true, the response blocks until results are ready. When false (default), returns immediately with placeholder URLs that can be polled.

Risposta

200 - application/json

Success

The response is of type object.