Flux AI 文生图模型,效果堪比 Midjourney,碾压 StableDiffusion;生成图片接口
请求参数
Header 参数
Authorization
string
可选
示例值:
Bearer {{YOUR_API_KEY}}
Body 参数application/json
prompt
string
必需
所需图像的文本描述。最大长度为 1000 个字符。
n
integer
可选
要生成的图像数。必须介于 1 和 10 之间。
size
string
可选
生成图像的大小。必须是256x256、512x512或 1024x1024之一。
示例
{"model":"flux.1.1-pro","prompt":"a beautiful landscape with a river and mountains","size":"1024x1024"}
示例代码
Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
请求示例请求示例
Shell
JavaScript
Java
Swift
curl--location--request POST 'https://api2.aigcbest.top/v1/images/generations' \
--header'Authorization: Bearer ' \
--header'Content-Type: application/json' \
--data-raw'{
"model": "flux.1.1-pro",
"prompt": "a beautiful landscape with a river and mountains",
"size": "1024x1024"
}'