创建
开发中
POST
https://duomiapi.com/v1/images/generations
请求参数
Query 参数
string
可选
Header 参数
Authorization
string
可选
示例值:
Bh3oi26r1FPFCMrJ59RKngSXB2
string
可选
Body 参数application/json
model
enum<string>
模型
枚举值:
stabilityai/stable-diffusion-2-1stabilityai/stable-diffusion-xl-base-1.0stabilityai/stable-diffusion-3-mediumblack-forest-labs/FLUX.1-schnellblack-forest-labs/FLUX.1-devstabilityai/stable-diffusion-3-5-large
prompt
string
描述词
negative_prompt
string
负向描述词 不想出现的内容
image_size
enum<string>
尺寸
枚举值:
1024x1024512x1024768x512768x10241024x576576x1024
默认值:
1024x1024
batch_size
integer
图片张数
默认值:
1
seed
integer
随机种子
num_inference_steps
integer
推理步数
默认值:
20
guidance_scale
number
权重
默认值:
7.5
示例
{
"model": "black-forest-labs/FLUX.1-schnell",
"prompt": " an island near sea, with seagulls, moon shining over the sea, light house, boats int he background, fish flying over the sea",
"negative_prompt": "",
"image_size": "1024x1024",
"batch_size": 1,
"seed": 51515151,
"num_inference_steps": 20,
"guidance_scale": 7.5
}
示例代码
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://duomiapi.com/v1/images/generations' \
--header 'Authorization: Bh3oi26r1FPFCMrJ59RKngSXB2' \
--header 'Content-Type: application/json' \
--data-raw '{
"model": "black-forest-labs/FLUX.1-schnell",
"prompt":" an island near sea, with seagulls, moon shining over the sea, light house, boats int he background, fish flying over the sea",
"negative_prompt":"",
"image_size":"1024x1024",
"batch_size":1,
"seed":51515151,
"num_inference_steps":20,
"guidance_scale":7.5
}'
返回响应
🟢200成功
application/json
Body
string
可选
示例
{
"images": [
{
"url": "https://sf-maas-uat-prod.oss-cn-shanghai.aliyuncs.com/outputs/b5e4b0ae-fe0c-451a-9cf5-657234887520_0.jpeg"
}
],
"timings": {
"inference": 14.772
},
"seed": 51515151,
"shared_id": "0",
"data": [
{
"url": "https://sf-maas-uat-prod.oss-cn-shanghai.aliyuncs.com/outputs/b5e4b0ae-fe0c-451a-9cf5-657234887520_0.jpeg"
}
],
"created": 1730173193
}
🟠404失败
修改于 2024-10-30 02:38:20