跳到主要内容

发起「马年贺卡」任务

更新时间:2026-01-31 14:45:20
该接口用于基于已有的模板自定义节点参数,发起图片生成任务。调用该接口前,您需要先通过调用「上传文件」接口获取输入的原图路径;调用该接口后,您可通过调用「查询任务生成结果」接口获取生成结果。
POST
https://cloud.baicaiinfer.com/v1/comfyui/create
Authorizations
AuthorizationsStringHeaderRequired

用户需使用已获取的API Key进行身份验证,以访问服务。

Body
application/json
workflowIdStringRequired

「马年贺卡」应用对应的工作流ID为year_of_the_horse_greeting_card。不同的AI应用对应不同的工作流ID,具体可参考支持的模型

paramsobjectRequired

一个用于动态注入参数的对象(Map)。

params.6objectRequired

键(Key),节点的标题,包含字段和值。

params.6.textStringRequired

文本提示词。

Response
状态码:application/json
codeIntRequired

表示请求处理状态的状态码。

0是成功标识,表示接口正常返回预期结果。
messageStringRequired

返回请求的处理结果,通常配合状态码使用,直观告知用户当前请求的具体情况。

dataobjectRequired

任务的核心结果数据。

data.taskIdStringRequired

任务的唯一标识ID。

tsStringRequired

响应的时间戳。

curl --location --request POST 'https://cloud.baicaiinfer.com/v1/comfyui/create' \
--header 'Authorization: Bearer sk-VStOhW7gwGTcy5lFuDg*****' \
--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 theme of the greeting card is to celebrate the New Year of 2026, and the background is filled with traditional Chinese cultural elements. 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, appearing very festive. Crucially, the horse is anatomically correct with exactly four legs visible. 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. The overall picture is brightly colored, full of festive joy and vitality, giving people a warm, energetic, and beautiful New Year greeting."
        }
    },
    "workflowId": "year_of_the_horse_greeting_card"
}'
{
    "code": 0,
    "message": "任务提交成功",
    "data": {
        "taskId": "5a29579af1e64663bb6d83c3f0d6dcc3"
    },
    "ts": "2026-01-30T18:03:35.903668047+08:00[Asia/Shanghai]"
}