发起作画
POST
/ai/instant/create发起作画
请求参数
Body 参数application/json
face_image_url
string <string>
必需
输入人脸参考图的url
示例值:
www.isidro-stehr.com
pose_image_key
string <string>
可选
姿势key(使用自定义姿势图时,该字段可为空)
可通过获取资源选项(ai/instant/resource)
接口查询,获取返回信息列表中的pose
-key
示例值:
1047
pose_image_url
string <string>
可选
姿势图片url(注意,选择平台提供的姿势图时也要携带改字段)
可通过获取资源选项(ai/instant/resource)
接口查询,获取返回信息列表中的pose
-url
示例值:
https://cdn.wujiebantu.com/ai_decoration/texiezhenglian.jpeg
style_key
string <string>
可选
画面风格
可通过获取资源选项(ai/instant/resource)
接口查询,获取返回信息列表中的image_type_option
-key
示例值:
it-复古时尚
use_control_net
boolean
可选
是否启用ControlNet,取值:true、false
当启用controlnet时需要传入in_pose_img_url作为人脸方向的参考,若不启用则无需传入in_pose_img_url
true:启用,需要传入poseImageUrl作为人脸方向的参考
false:不启用,无需传入poseImageUrl
示例值:
true
prompt
string <string>
正向提示词
示例值:
漂亮
uc_prompt
string <string>
反向提示词
示例值:
变形
seed
number <int64>
随机种子
示例值:
-1
steps
integer <int32>
可选
推理步数,取值范围[1,50]
示例值:
20
cfg
number <float>
可选
CFG强度, 提示词相关性
取值范围[0-30],表示AI对描述参数的倾向程度
示例值:
4.0
sampler
string <string>
可选
采样器,可通过获取资源选项(ai/instant/resource)
接口查询,获取返回信息列表中的sampler
示例值:
dpmpp_2m_sde
stop_at_clip_layer
integer <int32>
clip停止层数
示例值:
-2
strength
integer <int32>
可选
去噪强度, 取值范围[0,100]
示例值:
1
instant_id_weight
number <float>
可选
instantId权重,越大脸部与原图越相似,但画面质量可能会下降,也会出现崩图
示例值:
0.55
num
integer <int32>
生成数量
示例值:
2
payment_type
integer <int32>
可选
支付类型, 默认值: 1
1: 积分
2: 时长
示例值:
1
示例
{
"face_image_url": "www.isidro-stehr.com",
"pose_image_key": "1047",
"pose_image_url": "https://cdn.wujiebantu.com/ai_decoration/texiezhenglian.jpeg",
"style_key": "it-复古时尚",
"use_control_net": true,
"prompt": "漂亮",
"uc_prompt": "变形",
"seed": -1,
"steps": 20,
"cfg": 4,
"sampler": "dpmpp_2m_sde",
"stop_at_clip_layer": -2,
"strength": 1,
"instant_id_weight": 0.55,
"num": 2,
"payment_type": 1
}
示例代码
返回响应
成功(200)
HTTP 状态码: 200
内容格式: JSON*/*
OK
数据结构
code
string <string>
响应code
示例值:
200
message
string <string>
失败信息
示例值:
success
data
object (CameraArtworkKeysVo_response)
可选
返回数据(object)
keys
array[string]
作画结果Key列表
示例值:
[3E46BF62A51256A96EEFB73079BD55E2, 66FB4071D5647F5F8CD702AC1910AA5D]
expected_duration_cost
integer <int32>
可选
预计总消耗时长数,以实际消耗为准,单位: second
示例值:
20
expected_point_cost
integer <int32>
可选
预计积分消耗数,以实际消耗为准
示例值:
20
示例test data
{
"code": "200",
"message": "success",
"data": {
"keys": [
"3E46BF62A51256A96EEFB73079BD55E2",
"66FB4071D5647F5F8CD702AC1910AA5D"
],
"expected_duration_cost": 20,
"expected_point_cost": 20
}
}
最后修改时间: 18 天前