跳轉到主要內容
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"
}
'
{}

Documentation Index

Fetch the complete documentation index at: https://apidoc.cometapi.com/llms.txt

Use this file to discover all available pages before exploring further.

概覽

Bria 的圖片編輯 API 提供一套完整的工具,用於操作與增強圖片。
成功呼叫 API 後,請使用回傳的 request_id 透過查詢狀態端點查詢結果。此介面的 sync 參數為固定值——你不需要指定它。

支援的操作

操作說明文件
erase從圖片中移除物件Bria Erase 文件
gen_fill針對遮罩區域進行生成式填充Bria Gen Fill 文件
expand擴展圖片畫布Bria Expand 文件
enhance提升圖片品質Bria Enhance 文件
increase_resolution提高圖片解析度Bria Upscale 文件
replace_background替換圖片背景Bria Background 文件
請參閱官方文件,以取得各操作專屬的參數清單。

授權

Authorization
string
header
必填

Bearer token authentication. Use your CometAPI key.

標頭

Content-Type
string

Must be application/json.

路徑參數

action
string
必填

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

主體

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.

回應

200 - application/json

Success

The response is of type object.