生成图片接口MX
POST
/api/v1/mx/images/generate
生成类接口/MX
请求参数
Body 参数application/json
args
object
必需
ratio
enum<integer>
比例
2 - 9:16
3 - 16:9
枚举值:
13456
prompt
string
关键词
>= 1 字符<= 1000 字符
model
string
模型id
upscaler
enum<integer>
画质
2-超清 2点 尺寸比例 3072 * 3072 (约 8 - 15s)
3-超高清修复 6点 尺寸比例 2688 * 2688 (约 30 s)
4-修复beta 4点 尺寸比例 2304 * 2304 (约 20 s)
枚举值:
1234
negative_prompt
string | null
反词
>= 1 字符<= 1000 字符
negative_type
enum<integer> | enum<null>
0,1,2
1- 手部优化
2- 自定义
枚举值:
012
fix_faces
boolean
人脸修复
seed
integer
种子值
>= 1<= 999999999999
init_img_url
string
垫图url
denoising_strength
number
相似强度(仅垫图生效)
>= 0<= 1
cfg_scale
integer
提示词强度|色彩丰富度|细节丰富度
>= 1<= 20
extra_model
array [object {2}]
融合模型
>= 0 items<= 3 items
audit
enum<integer>
出图是否审核
枚举值:
01
type
enum<string>
类型
枚举值:
default
callback_url
string
必需
示例
{
"args": {
"ratio": 1,
"prompt": "string",
"model": "string",
"upscaler": 1,
"negative_prompt": "string",
"negative_type": 0,
"fix_faces": true,
"seed": 1,
"init_img_url": "string",
"denoising_strength": 0,
"cfg_scale": 1,
"extra_model": [
{
"id": "string",
"weight": 0
}
],
"audit": 0
},
"type": "default",
"callback_url": "string"
}
示例代码
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://open-qr.mewx.art/api/v1/mx/images/generate' \
--header 'Content-Type: application/json' \
--data-raw '{
"args": {
"ratio": 1,
"prompt": "string",
"model": "string",
"upscaler": 1,
"negative_prompt": "string",
"negative_type": 0,
"fix_faces": true,
"seed": 1,
"init_img_url": "string",
"denoising_strength": 0,
"cfg_scale": 1,
"extra_model": [
{
"id": "string",
"weight": 0
}
],
"audit": 0
},
"type": "default",
"callback_url": "string"
}'
返回响应
🟢200成功
application/json
Body
code
integer
必需
msg
string
必需
data
object
必需
img_uuid
string
必需
示例
{
"code": 0,
"msg": "成功",
"data": {
"img_uuid": "3e6fd87b-2895-402a-adc7-303f7ae0fd71"
}
}
修改于 2024-06-19 07:42:59