几分钟内开始使用 Flux Kontext API。学习如何从文本生成图像和使用AI编辑现有图像。
获取您的API密钥
添加到请求头
taskId
监控进度:
0
: 生成中 - 任务正在处理1
: 成功 - 任务成功完成2
: 创建任务失败 - 创建任务失败3
: 生成失败 - 任务创建成功但生成失败内容政策违反(代码 400)
安全容忍度超出范围(代码 500)
速率限制(代码 429)
flux-kontext-pro
,对复杂场景使用 flux-kontext-max
enableTranslation: false
enableTranslation: true
进行自动翻译)参数 | 类型 | 描述 | 默认值 |
---|---|---|---|
prompt | string | 必需。生成/编辑的文本描述 | - |
aspectRatio | string | 输出图像宽高比 | 16:9 |
model | string | flux-kontext-pro 或 flux-kontext-max | flux-kontext-pro |
outputFormat | string | jpeg 或 png | jpeg |
参数 | 类型 | 描述 | 默认值 |
---|---|---|---|
inputImage | string | 图像编辑模式的URL | - |
enableTranslation | boolean | 自动翻译非英文提示词 | true |
promptUpsampling | boolean | AI提示词增强 | false |
safetyTolerance | integer | 内容审核级别 | 2 |
callBackUrl | string | Webhook通知URL | - |
uploadCn | boolean | 使用中国服务器上传 | false |
watermark | string | 水印标识符 | - |