发起「马年贺卡」任务
该接口用于基于已有的模板自定义节点参数,发起图片生成任务。
POST
https://cloud.baicaiinfer.com/v1/comfyui/create
Authorizations
Body
application/json
workflowId:StringRequired
「马年贺卡」应用对应的工作流ID为year_of_the_horse_greeting_card。不同的AI应用对应不同的工作流ID,具体可参考支持的模型。
params:objectRequired
一个用于动态注入参数的对象(Map)。其中键(Key)是工作流中节点的标题,值(Value)是一个包含字段和新值的对象。
params.6:IntRequired
键(Key),节点的标题。
params.6.text:objectRequired
键对应的值(Value),包括字段名(text)和值。
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": {
"6": {
"text": "This picture is a 2026 New Year greeting card, filled with a strong Chinese New Year atmosphere. The specific details are as follows: Theme: The theme of the greeting card is to celebrate the New Year of 2026, and the background is filled with traditional Chinese cultural elements. Main elements: Cartoon Horse: In the center of the picture is a cute and energetic cartoon horse, symbolizing the Year of the Horse in the Chinese lunar calendar. The horse has a friendly expression with big bright eyes, blushing cheeks, and a spirited pose (perhaps rearing up slightly or prancing joyfully), appearing very festive. Crucially, the horse is anatomically correct with exactly four legs visible. Background: The background features a traditional Chinese architectural scene with red lanterns and fireworks, creating a lively and bustling festive atmosphere. Decoration: The greeting card is decorated with blooming red and pink peonies and cherry blossoms around the edges, adding to the celebration. Gift boxes and red paper scraps are scattered on the ground. Text: Above the greeting card, there are creatively written words that read 'Happy New Year 2026', with the font and color coordinating well with the background (gold or bright red). Overall atmosphere: The overall picture is brightly colored, full of festive joy and vitality, giving people a warm, energetic, and beautiful New Year's greeting."
}
},
"workflowId": "year_of_the_horse_greeting_card"
}'
200
400
401
404
500
{
"code": 0,
"message": "任务提交成功",
"data": {
"taskId": "5a29579af1e64663bb6d83c3f0d6dcc3"
},
"ts": "2026-01-30T18:03:35.903668047+08:00[Asia/Shanghai]"
}