POST /bria/image/edit/ を使用して、CometAPI 経由で Bria Image Editing API により erase、gen_fill、expand、enhance、upscale、または背景置換を実行します。
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"
}
'{}request_id を使用して、ステータス照会 エンドポイント経由で結果を取得してください。このインターフェースでは sync パラメータは固定されているため、指定する必要はありません。| 操作 | 説明 | ドキュメント |
|---|---|---|
erase | 画像からオブジェクトを削除 | Bria Erase Docs |
gen_fill | マスクされた領域に対する生成塗りつぶし | Bria Gen Fill Docs |
expand | 画像キャンバスを拡張 | Bria Expand Docs |
enhance | 画像品質を向上 | Bria Enhance Docs |
increase_resolution | 画像解像度をアップスケール | Bria Upscale Docs |
replace_background | 画像の背景を置き換え | Bria Background Docs |
Bearer token authentication. Use your CometAPI key.
Must be application/json.
Editing action to perform. Supported values: erase, gen_fill, expand, enhance, increase_resolution, replace_background.
Source image as a public URL or base64-encoded data URI. Accepted formats: JPEG, PNG, WebP. Maximum 12 MB.
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.
Text description of the desired edit. Required for gen_fill and replace_background actions.
Number of result variants to generate. Default: 1.
When true, the response blocks until results are ready. When false (default), returns immediately with placeholder URLs that can be polled.
Success
The response is of type object.
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"
}
'{}