AI绘画API
  1. 人像处理
AI绘画API
  • 使用前准备
  • 图片处理
    • 无损放大
      POST
    • 自动抠图
      POST
  • 人像处理
    • 人物换风格
      POST
    • 单人换脸
      POST
  • 线稿互转
    • 图片转线稿
      POST
  • Flux模型生图
    • 文生图
      POST
    • 图生图
      POST
  • MDJ模型生图
    • 文生图
      POST
    • 操作图片
      POST
    • 混合图片
      POST
    • 局部重绘
      POST
    • 图生文
      POST
  • 生成视频
    • 文生视频
      POST
    • 图生视频
      POST
  • 查询单个任务
    GET
  • 查询多个任务
    POST
  • 出图后续操作
    POST
  1. 人像处理

人物换风格

开发中
POST
/api/v2/face/style
上传一张”有脸“的人像,可以换成多种风格,每次出4合1的一组(张)图。
注意:【styleName】和【styleImgUrl】参数,必须传一个、无需两个同时传。
styleName参考以下:
sai-anime 动漫
sai-line art 线条艺术
mre-manga 日本漫画
mre-dynamic-illustration 动态插画
mre-undead-art 遗忘艺术家作品
mre-sumi-e-detailed 精细墨绘画
mre-dark-cyberpunk 黑暗赛博朋克
ads-corporate 企业形象
artstyle-abstract expressionism 抽象表现主义
artstyle-art deco 装饰艺术
artstyle-graffiti 涂鸦
artstyle-watercolor 水彩
game-fighting game 格斗
futuristic-biomechanical 生物机械
futuristic-sci-fi 科幻
misc-manga 漫画
Ink Dripping Drawing 滴墨绘画
MK Van Gogh 梵高

请求参数

Header 参数
Authorization
string 
管理后台获取的密钥
必需
示例值:
Bearer 1333_zrT4KITp20HcxxxxxxxxxxRD2C513FK40Pvq
Body 参数application/json
prompt
string 
必需
提示词,示例值( https://abc.com/1.jpg Cat --ar 9:16),垫图网址拼在前边,提示词支持中文(会自动翻译成英文)
faceImgUrl
string 
必需
FAST,只支持快速模式
styleImgUrl
string 
必需
风格参考图的网址,必须公网可以能访问到
styleName
string 
可选
风格名字(styleName),参考本文上方,例如:artstyle-watercolor
notifyHook
string 
可选
生成成功后的回调地址
示例
{
    "faceImgUrl": "https://reserve-clear-1256181000.cos.ap-shanghai.myqcloud.com/img/cdn/clear-20250605/871b0c2ef89ebeba34816e87987e3f62.png",
    "styleName": "artstyle-watercolor",
    "notifyHook": "https://abc.com/webhook/",
    "prompt": "Cat"
}

示例代码

Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
请求示例请求示例
Shell
JavaScript
Java
Swift
cURL
curl --location --request POST 'https://api.aihuihua.com/api/v2/face/style' \
--header 'Authorization: Bearer 1333_zrT4KITp20HcxxxxxxxxxxRD2C513FK40Pvq' \
--header 'Content-Type: application/json' \
--data-raw '{
    "faceImgUrl": "https://reserve-clear-1256181000.cos.ap-shanghai.myqcloud.com/img/cdn/clear-20250605/871b0c2ef89ebeba34816e87987e3f62.png",
    "styleName": "artstyle-watercolor",
    "notifyHook": "https://abc.com/webhook/",
    "prompt": "Cat"
}'

返回响应

🟢200成功
application/json
Body
code
string 
必需
1(提交成功), 22(排队中), 23(队列已满,请稍后尝试),24(prompt包含敏感词)
description
string 
描述
必需
result
string 
必需
任务ID,后续基于此ID获取、接收最终的生图结果
示例
{
    "code": 1,
    "description": "Submit success",
    "result": "123"
}
上一页
自动抠图
下一页
单人换脸
Built with