跳转到主要内容
POST
/
generate
/
k
/
flux2-flex-text-to-image
Flux 2 Flex 文生图
curl --request POST \
  --url https://api.sinancode.com/v1/generate/k/flux2-flex-text-to-image \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "prompt": "A humanoid figure with a vintage television set for a head",
  "aspect_ratio": "auto",
  "resolution": "1K"
}
'
{
  "task_id": "01234567-89ab-cdef-0123-456789abcdef"
}
使用 Black Forest Labs 的 FLUX.2 Flex 模型从文本生成高质量图片。 模型特点:
  • 可调节质量-速度平衡 - 通过 steps 参数控制生成步数,灵活权衡质量与速度
  • 卓越的文字渲染 - 业界领先的文字生成能力,适合海报、产品图等场景
  • 多参考图融合 - 支持最多 10 张参考图融合,保持风格一致性
  • 高分辨率输出 - 最高支持 4MP 分辨率

Authorizations

Authorization
string
header
required

请使用您的 API Token 进行认证

Body

application/json

Task parameters

prompt
string
required

提示词(必填,3-5000字符)

Required string length: 3 - 5000
Example:

"A humanoid figure with a vintage television set for a head"

aspect_ratio
enum<string>
default:auto

宽高比(可选,默认值 auto)

可用选项:
1:1,
4:3,
3:4,
16:9,
9:16,
3:2,
2:3,
auto
Example:

"auto"

resolution
enum<string>
default:1K

分辨率(可选,默认值 1K)

可用选项:
1K,
2K
Example:

"1K"

Response

OK

task_id
string
required

Task ID

Example:

"01234567-89ab-cdef-0123-456789abcdef"