跳轉到主要內容
POST
/
v1
/
tasks
curl -X POST https://qingbo.dev/v1/tasks \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "flux-kontext-pro",
    "prompt": "一只橘猫趴在窗台上晒太阳,水彩画风格",
    "size": "16:9"
  }'
{
  "code": "success",
  "data": "task-wave17200000001234567890abcdef"
}
非同步處理模式 — 提交請求後回傳任務 ID,透過 查詢任務狀態 介面取得生成結果。
curl -X POST https://qingbo.dev/v1/tasks \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "flux-kontext-pro",
    "prompt": "一只橘猫趴在窗台上晒太阳,水彩画风格",
    "size": "16:9"
  }'
{
  "code": "success",
  "data": "task-wave17200000001234567890abcdef"
}

可用模型

模型 ID說明
flux-kontext-proFLUX Kontext Pro,擅長圖像編輯和風格遷移
flux-kontext-maxFLUX Kontext Max,增強版
flux-2-proFLUX 2.0 Pro,通用圖像生成
flux-2-devFLUX 2.0 Dev,開發版

通用參數

model
string
必填
模型 ID,見上方模型列表
prompt
string
必填
圖像描述文字,最多 1000 個字元
image_urls
array
參考圖片 URL 陣列

各模型差異參數

適用於 flux-kontext-proflux-kontext-max
size
string
預設值:"match_input_image"
圖像尺寸支援:match_input_imageauto1:14:33:416:99:163:22:321:99:21
response_format
string
預設值:"png"
輸出格式:pngjpg
safety_tolerance
integer
預設值:"2"
內容安全等級,範圍 0-6,值越高越寬鬆
prompt_upsampling
boolean
預設值:"false"
啟用 prompt 最佳化增強
Kontext 系列側重圖像編輯image_urls 最多傳 1 張參考圖。

回應

回傳任務 ID,使用 查詢任務狀態 取得最終圖像結果。
code
string
狀態碼,成功為 "success"
data
string
任務 ID,格式為 task-wave{timestamp}{userId}{random}