Flux · 图片
文生图NEW暂时下线
⏸ 该模型暂时下线,文档仅供参考,暂不可调用。恢复时间请关注公告。
📌 这是什么:用 FLUX Kontext 模型根据文字描述生成图片。
💡 什么时候用:想要 FLUX 风格的高质量图片时用。
接口地址
| 用途 | 方法 | 路径 |
|---|---|---|
| 提交任务 | POST | /api/cqt/generator/flux |
| 查询结果 | GET | /api/cqt/info/flux?id={taskId} |
⏱ 建议轮询时间:建议每 5 秒轮询一次,直到 status = succeeded / failed。
请求参数
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
| model | string | 必填 | flux-kontext-pro / flux-kontext-max |
| prompt | string | 必填 | 图片描述 |
| aspectRatio | string | — | 输出比例:1:1 / 9:16 / 16:9 / 4:3 / 3:4 / 21:9 / 3:2 / 2:3 |
| outputFormat | string | — | 输出格式 jpeg / png,默认 jpeg |
| safetyTolerance | integer | — | 安全容忍度,默认 2 |
| enhancePrompt | boolean | — | 是否增强提示词,默认 true |
| webhookUrl | string | — | 完成回调地址 |
请求示例
curl -X POST https://api.cqtai.com/api/cqt/generator/flux \
-H 'Authorization: Bearer <API_KEY>' \
-H 'Content-Type: application/json' \
-d '{
"model": "flux-kontext-pro",
"prompt": "a futuristic city skyline at sunset, cinematic",
"aspectRatio": "16:9",
"outputFormat": "png"
}'
# -> { "code":200, "data":"<taskId>" }响应示例
{
"code": 200,
"msg": "success",
"data": {
"id": "<taskId>",
"status": "succeeded",
"resultUrl": "https://.../result.png",
"createTime": "2026-06-15 10:00:00",
"completeTime": "2026-06-15 10:00:20"
}
}计费与积分
flux-kontext-pro:12 积分/张;flux-kontext-max:24 积分/张(× 你的用户费率)。任务失败自动退回。