跳转到内容

執行 AI 擴圖任務。

请求

查詢任務狀態請參考輪詢指南。這個 API 需要 3 個關鍵參數:輸入圖片、支點與輸出圖片。

安全
BearerAuthenticationV2
正文application/json必需
Any of:

AI 擴圖 API 需要 3 個關鍵參數才能運作:輸入圖片、支點與輸出圖片。輸出圖片的尺寸必須永遠大於輸入圖片的尺寸。

output_widthinteger, [ 1 .. 4096 ]必需

輸出圖片寬度。值範圍:[1 - 4096]

示例:960
output_heightinteger, [ 1 .. 4096 ]必需

輸出圖片高度。值範圍:[1 - 4096]

示例:1280
input_xinteger, [ 0 .. 4096 ]必需

來源照片在輸出圖片中的左側位置,索引由上到下、由左到右排序。值範圍:[0 - 4096]

示例:240
input_yinteger, [ 0 .. 4096 ]必需

來源照片在輸出圖片中的上方位置,索引由上到下、由左到右排序。值範圍:[0 - 4096]

示例:320
input_widthinteger, [ 1 .. 4096 ]必需

來源照片寬度,input_x + input_width 必須 <= output_width。值範圍:[1 - 4096]

示例:480
input_heightinteger, [ 1 .. 4096 ]必需

來源照片高度,input_y + input_height 必須 <= output_height。值範圍:[1 - 4096]

示例:640
crop_input_xinteger, [ 0 .. 4096 ]必需

從 x 開始裁切來源照片,索引由上到下、由左到右排序。值範圍:[0 - 4096]

示例:0
crop_input_yinteger, [ 0 .. 4096 ]必需

從 y 開始裁切來源照片,索引由上到下、由左到右排序。值範圍:[0 - 4096]

示例:0
crop_input_widthinteger, [ 1 .. 4096 ]必需

以 crop_input_width 寬度裁切來源照片。值範圍:[1 - 4096]

示例:480
crop_input_heightinteger, [ 1 .. 4096 ]必需

以 crop_input_height 高度裁切來源照片。值範圍:[1 - 4096]

示例:640
src_file_urlstring必需

要執行任務的檔案網址。該網址應可公開存取。

示例:"https://example.com/selfie.jpg"
curl -i -X POST \
  https://yce-api-01.makeupar.com/s2s/v2.0/task/out-paint \
  -H 'Authorization: Bearer <YOUR_TOKEN_HERE>' \
  -H 'Content-Type: application/json' \
  -d '{
    "src_file_url": "https://example.com/selfie.jpg",
    "output_width": 960,
    "output_height": 1280,
    "input_x": 240,
    "input_y": 320,
    "input_width": 480,
    "input_height": 640,
    "crop_input_x": 0,
    "crop_input_y": 0,
    "crop_input_width": 480,
    "crop_input_height": 640
  }'

响应

任務執行成功

正文application/json
statusinteger

回應狀態

示例:200
dataobject
响应
{ "status": 200, "data": { "task_id": "grH0CvsgXuAIHLUzD0V1Ol34hoet3R1tvdbtiVHrDb6_UqCLKIejAIajwxrhOAfe" } }