我们增加了sync参数,支持同步返回结果,方便调试,选择 true时即为同步返回
| 参数名 | 参数说明 |
|---|---|
| safety_tolerance | 输入和输出内容审核的容忍度等级,等级越高,审核限制越宽松 |
| webhook_url | 接收 Webhook 通知的 URL,用于异步获取生成结果 |
| webhook_secret | 用于 Webhook 签名验证的可选密钥,提升请求安全性 |
| steps | 生成图像的迭代步数,步数越多,图像细节越丰富,但生成速度越慢 |
| prompt_upsampling | 是否对提示词进行升采样优化,提升提示词理解精度 |
| guidance | 引导强度,控制生成结果与提示词的契合度;值越高,契合度越高,创意性越低 |
| interval | 生成过程中的中间结果输出间隔,用于查看生成进度 |
| 计费项 | 费率 |
|---|---|
| 输入(参考图像) | 0.03PTC / 百万像素 (MP) |
| 输出图像 | 首个百万像素 0.07PTC,后续每百万像素 0.03PTC |
(宽度 × 高度) ÷ 1,048,576;| 分辨率 | 实际计算 MP | 计费取整后 MP |
|---|---|---|
| 512×512 | 0.26 | 1 |
| 1280×720 (720p) | 0.92 | 1 |
| 1024×1024 | 1 | 1 |
| 1920×1080 (1080p) | 2.07 | 3 |
curl --location --request POST 'https://api.302.ai/flux/v1/flux-2-max' \
--header 'Authorization: Bearer ' \
--header 'Content-Type: application/json' \
--data-raw '{
"prompt": "ein fantastisches bild",
"width": 1024,
"height": 768,
"steps": 40,
"prompt_upsampling": false,
"seed": 42,
"guidance": 2.5,
"safety_tolerance": 2,
"interval": 2,
"output_format": "jpeg",
"sync": false
}'{
"id": "5015d102-09e0-44e9-8ede-ab8c74b16ed6",
"polling_url": "https://api.us3.bfl.ai/v1/get_result?id=5015d102-09e0-44e9-8ede-ab8c74b16ed6",
"cost": 6.0,
"input_mp": 0.0,
"output_mp": 0.75
}