跳到主要内容

发起「婚纱照精修」任务

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

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

Body
application/json
workflowIdStringRequired

「婚纱照精修」应用对应的工作流ID为wedding_photo_retouching。不同的AI应用对应不同的工作流ID,具体可参考支持的模型

paramsobjectRequired

一个用于动态注入参数的对象(Map)。其中键(Key)是工作流中节点的标题,值(Value)是一个包含字段和新值的对象。

params.22objectRequired

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

params.22.promptStringRequired

文本提示词。

params.113objectRequired

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

params.113.urlStringRequired

婚纱照。

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-O1a2aJXfqpZQNRrAqiy*****' \
--header 'Content-Type: application/json' \
--data-raw '{
    "params": {
        "113": {
            "url": "https://s1.llamafactory.online/baicai-infer/users/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"
}'

{
    "code": 0,
    "message": "任务提交成功",
    "data": {
        "taskId": "bbececd781b2447bb86f597bacb*****"
    },
    "ts": "2025-12-31T10:17:45.485838+08:00[Asia/Shanghai]"
}