Chuyển đến nội dung chính
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.

Tổng quan

API Chỉnh sửa hình ảnh của Bria cung cấp một bộ công cụ toàn diện để thao tác và nâng cao chất lượng hình ảnh.
Sau khi gọi API thành công, hãy dùng request_id được trả về để truy vấn kết quả qua endpoint Query Status.Tham số sync được cố định trên giao diện này — bạn không cần chỉ định nó.

Các thao tác được hỗ trợ

Thao tácMô tảTài liệu
eraseXóa đối tượng khỏi hình ảnhBria Erase Docs
gen_fillTô sinh nội dung cho các vùng được maskBria Gen Fill Docs
expandMở rộng khung vẽ hình ảnhBria Expand Docs
enhanceCải thiện chất lượng hình ảnhBria Enhance Docs
increase_resolutionNâng cấp độ phân giải hình ảnhBria Upscale Docs
replace_backgroundThay thế nền hình ảnhBria Background Docs
Vui lòng tham khảo tài liệu chính thức để biết danh sách tham số riêng cho từng thao tác.

Ủy quyền

Authorization
string
header
bắt buộc

Bearer token authentication. Use your CometAPI key.

Tiêu đề

Content-Type
string

Must be application/json.

Tham số đường dẫn

action
string
bắt buộc

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

Nội dung

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.

Phản hồi

200 - application/json

Success

The response is of type object.