メインコンテンツへスキップ
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"
}
'
{}

概要

Bria の Image Editing API は、画像の加工と強化のための包括的なツール群を提供します。
API 呼び出しが成功した後、返却された 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
各操作に固有のパラメータ一覧については、公式ドキュメントを参照してください。

承認

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.