Flux Kontext
借助Flux Kontext模型实现高级图像生成与编辑
功能特性
- 文生图
- 风格迁移
- 图片编辑
- 高保真输出
定价
| Model | Credits |
|---|---|
| flux-kontext-pro | 2 (~$0.02) |
| flux-kontext-max | 4 (~$0.04) |
端点
POST
/api/v1/images/generate参数
| 参数 | 类型 | 必需 | 描述 |
|---|---|---|---|
| model | string | 必需 | "flux-kontext-pro" or "flux-kontext-max" |
| type | string | 可选 | "text-to-image" or "image-to-image" (default: text-to-image) |
| prompt | string | 必需 | Text description |
| image_urls | string[] | 可选 | Input image URLs or base64 for editing/style transfer |
| input_image | string | 可选 | Deprecated. Alias for image_urls[0] |
| image_size | string | 可选 | Output image size (e.g. 1024x1024) |
请求示例
{
"model": "flux-kontext-pro",
"type": "image-to-image",
"prompt": "Transform into a watercolor painting style",
"image_urls": ["https://tempfile.aiquickdraw.com/workers/nano/image_1772780968156_ygk0zm.png"]
}响应示例
{
"success": true,
"data": {
"task_id": "task_flux123",
"credits_used": 2,
"remaining_credits": 498
}
}代码示例
curl -X POST https://gateway.bananapro.site/api/v1/images/generate \
-H "Authorization: Bearer sk-your-api-key" \
-H "Content-Type: application/json" \
-d '{
"model": "flux-kontext-pro",
"type": "image-to-image",
"prompt": "Transform into a watercolor painting style",
"image_urls": ["https://tempfile.aiquickdraw.com/workers/nano/image_1772780968156_ygk0zm.png"]
}'