Skip to main content
POST
/
flux
/
v1
/
{model}
cURL
curl https://api.deerapi.com/flux/v1/flux-pro-1.1 \
  -H "Authorization: Bearer <DEERAPI_KEY>" \
  -H "Content-Type: application/json" \
  -d '{
    "prompt": "A red paper lantern on a wooden table, studio photo",
    "width": 1024,
    "height": 1024,
    "output_format": "jpeg"
  }'
{
  "id": "a738c474-3d9e-421a-860d-c7825c547fbb",
  "polling_url": "https://api.eu2.bfl.ai/v1/get_result?id=a738c474-3d9e-421a-860d-c7825c547fbb",
  "cost": null,
  "input_mp": null,
  "output_mp": null
}
这是一条异步任务接口。调用成功后你先拿到的是 id,不是最终图片。

最稳的首个调用流程

1

先从标准文生图开始

第一次建议直接用 flux-pro-1.1flux-dev,不要一上来就试 Fill、Expand 或控制模型。
2

创建后立即保存 id

这条接口不会同步直接出图。拿到 id 后,继续去 统一查询任务
3

结果出来后尽快下载

BFL 返回的签名图片 URL 有效期通常较短,确认成功后尽快保存。
如果你要的是标准 Replicate Predictions 对象,而不是 BFL 风格短路径任务,请改看 create-task-replicatereplicate/create-task

这条短路径和官方 BFL 的关系

  • BFL 官方为每个模型提供独立路径;DeerAPI 把它们统一收敛到 POST /flux/v1/{model}
  • 官方鉴权使用 x-key 和 BFL 域名;DeerAPI 统一改成 https://api.deerapi.com + Bearer Token。
  • 官方通常让你直接轮询 polling_url;DeerAPI 额外提供了统一查询页,方便把 BFL 和 Replicate 风格任务放进同一套代码里处理。

常见参数什么时候才需要

  • width / height:标准文生图最常用。
  • aspect_ratio:Kontext 和一部分新版模型更常用。
  • input_image:只有编辑类或参考图类模型才需要。
  • mask:主要用于 flux-pro-1.0-fill 这种局部重绘。
  • control_image:用于 cannydepth 这类控制模型。
  • raw:只对部分支持 Raw 风格输出的模型有意义。

参考文档

Authorizations

Authorization
string
header
required

使用 DeerAPI Key 进行 Bearer Token 鉴权。

Path Parameters

model
enum<string>
required

DeerAPI 当前支持的 FLUX 短模型 ID。

Available options:
flux-pro-1.1,
flux-pro-1.1-ultra,
flux-pro,
flux-dev,
flux-kontext-pro,
flux-kontext-max,
flux-2-pro,
flux-2-flex,
flux-2-max,
flux-pro-1.0-fill,
flux-pro-1.0-canny,
flux-pro-1.0-depth,
flux-pro-1.0-expand

Body

application/json
prompt
string
required

文本提示词。绝大多数 FLUX 模型都需要。

width
integer

输出宽度。常用于 flux-pro-1.1flux-proflux-dev 这类标准文生图模型。

height
integer

输出高度。常用于 flux-pro-1.1flux-proflux-dev 这类标准文生图模型。

aspect_ratio
string

输出宽高比。Kontext、FLUX.2 及部分新模型更常使用该字段,例如 1:116:9match_input_image

input_image
string

参考图或待编辑图片 URL。常用于 Kontext 类模型。

input_images
string[]

多参考图输入。更适合 FLUX.2 等支持多参考图的模型。

image
string

Base64 编码的输入图。常用于 flux-pro-1.0-fillflux-pro-1.0-expand

mask
string

Base64 编码的遮罩图。白色区域表示需要重绘,黑色区域表示保留。主要用于 flux-pro-1.0-fill

control_image
string

控制图 URL 或 Base64 数据。主要用于 flux-pro-1.0-cannyflux-pro-1.0-depth

image_prompt
string

Base64 编码的视觉参考图。常用于 flux-pro-1.1-ultra

image_prompt_strength
number

视觉参考图对结果的影响强度。

Required range: 0 <= x <= 1
steps
integer

推理步数。更多见于 Fill / 控制类模型。

guidance
number

提示词引导强度。更多见于 Fill / 控制类模型。

prompt_upsampling
boolean
default:false

是否让模型自动优化提示词。

seed
integer

随机种子。固定种子有助于提升可复现性。

safety_tolerance
integer

安全阈值,数字越大限制越宽松。

Required range: 0 <= x <= 6
output_format
enum<string>

输出图片格式。

Available options:
jpeg,
png
raw
boolean

是否启用更自然、偏纪实的 Raw 风格输出。主要用于 flux-pro-1.1-ultra

webhook_url
string<uri>

异步完成回调地址。

webhook_secret
string

回调签名校验密钥。

Response

200 - application/json

任务已创建

id
string
required

任务 ID。

polling_url
string<uri>
required

上游 BFL 返回的轮询地址。DeerAPI 也支持改用 /flux/v1/get_result 查询。

cost
number | null
input_mp
number | null
output_mp
number | null