- 画宇宙AI绘画基础接口
- 第三方AI绘画模型接口
- 高级接口
- 其他接口
- 查询接口
- 训练模型生成头像
- 模型训练/推理
- ai玩图V2
提交人像照片转动漫任务(AI玩图)
POST
https://open.nolibox.com/prod-open-aigc/engine/img2acg
接口能力#
风格
和人像照片 URL
生成对应的动漫风格图片,而不需要指定 prompt

uid
做为参数,通过 「查询接口-查询任务结果」(/engine/status
)接口轮询获取结果积分扣除规则#
1.由于敏感图等问题提交任务成功但生成失败的,将退还积分 2.标准分辨率下图片尺寸是 512×704,面积低于该尺寸维持原价,面积大于该尺寸按比例增加消耗的积分
如,(1024×1024)/(512×704)=2.9,则生成 1024×1024 的图片会需要 3×2.9=8.7 积分3.人像照片转动漫接口支持积分模式按次调用;包月用户每 4 颗 GPU 配额 50000 次调用,超过配额则需使用等值积分按次调用;部署用户调用需消耗等值积分
请求参数
Header 参数
Content-Type
string
必需
示例值:
application/json
Authorization
string
必需
示例值:
Basic xxxxxxxxxx
Body 参数application/json
image_url
string
人像照片地址
style
enum<string>
风格
美漫 - "American_style"
可爱 - "Cute_style"
华丽 - "Gorgeous_style"
恐怖漫画 - "Horrible_style"
精灵 - "Avatar_style"
热血 - "Fighting_style"
机械复古 - "Machine_style"
赛伯未来 - "Cyberfuture_style"
JOJO - "JOJO_style"
兔耳 - "Bunny_style"
猫耳 - "CatEar_style"
枚举值:
Chinese_styleAmerican_styleCute_styleGorgeous_styleHorrible_styleAvatar_styleFighting_styleMachine_styleCyberfuture_styleJOJO_styleBunny_styleCatEar_style
示例值:
Cute_style
is_anime
boolean
是否使用漫画模型, 默认 true
默认值:
true
w
integer
生成的图片宽度,默认 512
h
integer
生成的图片高度,默认 512
fidelity
number
相似度, 默认值 0.2
默认值:
0.2
seed
integer | null
随机种子,默认值是 -1
-1 代指不指定 seed,此时我们算法内部会随机生成一个 seed
sampler
string
采样器,默认 k_euler
num_steps
integer
采样步数,默认值是 20
guidance_scale
number | null
扣题程度,默认值是 7.5
negative_prompt
string
负面词,默认值是空字符串
keep_alpha
boolean
是否保留原图的 alpha 通道
notify_url
string
回调通知地址
POST
,Content-Type
为 application/json
,数据结构可参考 查询接口
- 查询任务结果
接口返回值。示例
{
"style": "Gorgeous_style",
"image_url": "https://ailab-huawei-cdn.nolibox.com/upload/images/cf5a2778094945209b594c15f5da3924.png",
"use_seed": true,
"keep_alpha": true,
"w": 512,
"h": 512,
"fidelity": 0.3,
"use_circular": false,
"is_anime": true,
"seed": 2180138447,
"version": "v1.5",
"promptInfo": {
"lang": "zh",
"original": "a cute European young lady and a handsome European young man, big eyes, beautiful detailed eyes, smile, ((style reference J.C. Leyendecker)), portrait, illustration, masterpiece, best quality, CG, HD, 8k, 4k, highly detailed, wallpaper",
"originalNegative": "cropped, blurred, mutated, error, lowres, blurry, low quality, username, signature, watermark, text, nsfw, missing limb, fused hand, missing hand, extra limbs, malformed limbs, bad hands, extra fingers, fused fingers, missing fingers, bad breasts, deformed, mutilated, morbid, bad anatomy"
},
"timestamp": 1670569311577,
"localModels": {},
"negative_prompt": "cropped, blurred, mutated, error, lowres, blurry, low quality, username, signature, watermark, text, nsfw, missing limb, fused hand, missing hand, extra limbs, malformed limbs, bad hands, extra fingers, fused fingers, missing fingers, bad breasts, deformed, mutilated, morbid, bad anatomy",
"sampler": "k_euler",
"num_steps": 25,
"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://open.nolibox.com/prod-open-aigc/engine/img2acg' \
--header 'Authorization: Basic xxxxxxxxxx' \
--header 'Content-Type: application/json' \
--data-raw '{
"style": "Gorgeous_style",
"image_url": "https://ailab-huawei-cdn.nolibox.com/upload/images/cf5a2778094945209b594c15f5da3924.png",
"use_seed": true,
"keep_alpha": true,
"w": 512,
"h": 512,
"fidelity": 0.3,
"use_circular": false,
"is_anime": true,
"seed": 2180138447,
"version": "v1.5",
"promptInfo": {
"lang": "zh",
"original": "a cute European young lady and a handsome European young man, big eyes, beautiful detailed eyes, smile, ((style reference J.C. Leyendecker)), portrait, illustration, masterpiece, best quality, CG, HD, 8k, 4k, highly detailed, wallpaper",
"originalNegative": "cropped, blurred, mutated, error, lowres, blurry, low quality, username, signature, watermark, text, nsfw, missing limb, fused hand, missing hand, extra limbs, malformed limbs, bad hands, extra fingers, fused fingers, missing fingers, bad breasts, deformed, mutilated, morbid, bad anatomy"
},
"timestamp": 1670569311577,
"localModels": {},
"negative_prompt": "cropped, blurred, mutated, error, lowres, blurry, low quality, username, signature, watermark, text, nsfw, missing limb, fused hand, missing hand, extra limbs, malformed limbs, bad hands, extra fingers, fused fingers, missing fingers, bad breasts, deformed, mutilated, morbid, bad anatomy",
"sampler": "k_euler",
"num_steps": 25,
"guidance_scale": 7.5
}'
返回响应
🟢200成功
application/json
Body
uid
string
任务唯一ID
/engine/status
接口中查询任务结果示例
{
"uid": "23c0a69d"
}

企业解决方案
微信扫码联系您的专属经理,咨询企业解决方案


修改于 2023-05-29 09:09:05