跳转到主要内容
人物写真生成

人物写真生成 — 创建任务

提交FaceChain人物写真生成任务

POST
/services/aigc/album/gen_potrait
curl --location 'https://dashscope.aliyuncs.com/api/v1/services/aigc/album/gen_potrait' \
--header 'X-DashScope-Async: enable' \
--header 'Authorization: Bearer $DASHSCOPE_API_KEY' \
--header 'Content-Type: application/json' \
--data '{
  "model": "facechain-generation",
  "parameters": {
    "style": "f_idcard_female",
    "size": "768*1024",
    "n": 4
  },
  "resources": [
    {
      "resource_id": "women_model",
      "resource_type": "facelora"
    }
  ]
}'
{
  "request_id": "0b6a411a-56e6-9028-84eb-6852183248d8",
  "output": {
    "task_id": "7eb1032e-09a1-4df5-96ed-14091859ad57",
    "task_status": "PENDING"
  }
}

鉴权

string
header
必填

千问云 API Key。详见获取 API Key

Header 参数

enum<string>
必填

固定设置为 enable,表示使用异步方式提交任务。

enable

请求体

application/json
enum<string>
必填

模型名称。此处固定为 facechain-generation

facechain-generation
facechain-generation
object[]

人物形象 LoRA 资源列表。使用预设风格或自定义模板模式(非免训练模式)时为必填,从人物形象训练 API 获取。使用免训练模式(TrainFree)时无需填写,填写也会被忽略。

object

生成参数。

object

自定义模板模式下的输入数据。

响应

200-application/json
string

本次请求的系统唯一码。

0b6a411a-56e6-9028-84eb-6852183248d8
object