跳转到主要内容
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}