Query workflow execution results - comfy_get_result

更新时间:
复制 MD 格式

API description

Queries the execution results of a workflow.

Prerequisites

You have integrated the Intelligent Production Workshop SDK. For more information, see SDK Reference.

Authorization method

An AccessKey ID and an AccessKey Secret (AK/SK). For instructions on how to obtain them, see API authorization.

Endpoint

https://openai.edu-aliyun.com

Request path

/scc/comfy_get_result

Request parameters

Request protocol

application/json

Request body

Name

Type

Required

Description

taskId

string

Required

The task ID that is returned after you submit an image generation task.

Response parameters

Name

Type

Description

status

integer

The gateway status code. A value of 10 indicates success. A value of 20 indicates failure.

apiInvokeId

string

The system-generated ID that uniquely identifies the call.

errCode

string

The gateway error code. This parameter is ignored if the call is successful.

errMessage

string

The gateway error details have been successfully ignored.

subErrCode

string

The service error code. This parameter is ignored if the call is successful.

subErrMessage

string

The service error details have been successfully ignored.

data

object

The result returned by the service.

status

string

The task status.

Task succeeded.

Task execution failed.

running: The task is in progress.

Queued

taskId

string

The ID of the image generation task.

taskDuration

long

The execution duration in milliseconds (ms).

taskBeginTime

long

The start time of the task. This is a 13-digit UNIX timestamp.

taskEndTime

long

The end time of the task. This is a 13-digit UNIX timestamp.

images

list

The default list of output images. If no output field is specified when the API is published, you can use this field to get the URLs of the generated images.

Important

The image URLs are valid for a limited time. After you get the URLs, save the images to another location.

If the workflow output does not contain files, this field is empty.

result

object

A custom output field. This field is valid only when custom output is configured during API publication.

poster

object

This field is an example.

Note

If a custom field is a file type, such as an image, audio, or video, the returned value is an object. The object contains the common url and type fields, and other fields specific to the file type.

url

string

A publicly accessible file URL.

Important

The file is valid for a limited time. To use it for a long period, save it to a private storage repository.

Example

Note

When the gateway status code is 10, the task is submitted successfully. You can then retrieve the asynchronous taskId.

{
    "status": 10,              // Gateway status code. 10: success, 20: failed
    "apiInvokeId": "i_6776089b19c46d0025fd4736",
    "data": {
        "result": {
            "poster": {
                "filename": "a153c27e31ed4e0f8c8721af0984ca5a_00000_.webp",
                "object_key": "comfy/output/a153c27e31ed4e0f8c8721af0984ca5a_00000_.webp",
                "format": "webp",
                "width": 472,
                "subfolder": "",
                "type": "output",
                "url": "https://speed-pix-beijing-prod.oss-cn-beijing.aliyuncs.com/example.png",
                "height": 1024
            }
        },
        "images": [
            "https://speed-pix-beijing-prod.oss-cn-beijing.aliyuncs.com/example.png"
        ],
        "taskDuration": 49594,
        "taskBeginTime": 1735788648813,
        "taskId": "01jgjgyaqh85f7rs23v0kbmtdb",
        "status": "succeeded",
        "taskEndTime": 1735788698407
    },
    "subErrCode": null,   // Service error code
    "subErrMessage": null,// Service error details
    "errCode": null,      // Gateway error code
    "errMessage": null   // Gateway error details
}

Gateway error codes

For more information, see Error code descriptions.

Service error codes

Gateway error codes (subErrCode)

Error message

(subErrMessage)

Description

B_COMPUTING_CanNotFindTask

Cannot find task:{0}

The provided task ID is invalid.

P_Request_ContentSafe

The content is non-compliant.

Non-compliant content was detected in the input or output.