发起「婚纱照精修」任务
该接口用于基于已有的工作流模板自定义节点参数,发起图片生成任务。调用该接口前,需要先调用“上传文件”接口获取图片的路径。
POST
https://cloud.baicaiinfer.com/v1/comfyui/create
Authorizations
Body
application/json
params:objectRequired
一个用于动态注入参数的对象(Map)。其中键(Key)是工作流中节点的标题,值(Value)是一个包含字段和新值的对象。
params.22:IntRequired
键1(Key),节点的标题。
params.22.prompt:objectRequired
键1对应的值(Value),包括字段名(prompt)和值。
params.113:IntRequired
键2(Key),节点的标题。
params.113.image:objectRequired
键2对应的值(Value),包括字段名(image)和值。
Response
状态码:application/json
200
code:String Required
表示请求处理状态的状态码。
0
400
500
0是成功标识,表示接口正常返回预期结果。
message:StringRequired
返回请求的处理结果,通常配合状态码使用,直观告知用户当前请求的具体情况。
data:objectRequired
任务的核心结果数据。
data.taskId:StringRequired
任务的唯一标识ID。
ts:StringRequired
响应的时间戳。
cURL
Python
JavaScript
curl --location --request POST 'https://cloud.baicaiinfer.com/v1/comfyui/create' \
--header 'Authorization: Bearer sk-O1a2aJXfqpZQNRrAqiy*****' \
--header 'Content-Type: application/json' \
--data-raw '{
"params": {
"113": {
"image": "/root/ComfyUI/input/app-default-display/wedding_photo_retouching1.png"
},
"22": {
"prompt": "Based on the original image, keep the figure clear and bright, modify the background to be illuminated by sunlight, and make the figure backlit, with interwoven light and shadow. Add a light blur to the background"
}
},
"workflowId": "wedding_photo_retouching"
}'
200
400
401
404
500
{
"code": 0,
"message": "任务提交成功",
"data": {
"taskId": "bbececd781b2447bb86f597bacb*****"
},
"ts": "2025-12-31T10:17:45.485838+08:00[Asia/Shanghai]"
}