Submit a workflow task - comfy_prompt
API description
Submits a workflow task.
Prerequisites
You have integrated the AI Creation Workshop SDK. For more information, see SDK Reference.
Authorization
This operation uses an AccessKey pair for authorization. To obtain an AccessKey pair, see API authorization.
Endpoint
https://openai.edu-aliyun.comRequest path
/scc/comfy_promptRequest parameters
Request protocol
application/json
Headers
Name | Type | Required | Description | |
X-SP-RESOURCE-CONFIG-ID | string | Optional | The ID of the resource pool configuration. For more information about the format, see Resource pool configuration parameter format. | |
Body
Name | Type | Required | Description | |
workflow_id | string | Required | The workflow ID. This is a static value that you can copy from the workflow management page. | |
alias_id | string | Optional. Either alias_id or version_id is required. | The workflow alias. An alias acts as a pointer to a specific version. You can use aliases to easily publish or roll back versions. | |
version_id | string | Optional. You can specify either alias_id or version_id. | The workflow version number. This is an auto-incrementing value. You can also specify a version to request a specific API version, such as v1 or v2. | |
randomise_seeds | bool | Optional. Defaults to false. | Automatically changes all seed fields in the workflow to random values to avoid hitting the ComfyUI cache. | |
return_temp_files | bool | Optional. Defaults to false. | Specifies whether to return temporary images from the workflow, such as preview results. | |
inputs | object | Required | The format of the inputs object depends on the specific workflow. It corresponds to the field mapping you configure when you publish the workflow. The following is an example. | |
ref_image | string | Example fields. These depend on the specific workflow. | The reference image. If the input parameter is a file, see Image field format for format details. | |
steps | integer | The number of steps. | ||
cfg | double | Default: 1.5. | ||
denoise | double | Default: 1. Maximum: 1. | ||
negative | string | The negative prompt. | ||
prompt | string | The positive prompt. | ||
width | integer | The width. | ||
height | integer | The height. | ||
Response parameters
Name | Type | Description | |
status | integer | The gateway status code. 10: Success. 20: Failure. | |
apiInvokeId | string | The system-generated ID of the call. | |
errCode | string | The error code of the gateway. This parameter can be ignored on a successful request. | |
errMessage | string | The gateway error details have been ignored. | |
subErrCode | string | The service error code. This parameter is ignored if the call is successful. | |
subErrMessage | string | The service error was successfully ignored. | |
data | object | The result returned by the service. | |
taskId | string | The ID of the image generation task. | |
status | string | The task status. Valid values: succeeded, failed, running, and waiting. | |
estimatedDurationInSeconds | float | The estimated request processing time in seconds. | |
Example
A gateway status code of 10 indicates that the task was submitted successfully. You can then retrieve the asynchronous taskId.
{
"status": 10, // Gateway status code. 10: Success. 20: Failure.
"apiInvokeId": "i_66c587a7c6fd500028c10e78",
"data": {
"taskId": "01j5ssksqndptm3exv751bz0gj",
"status": "waiting"
},
"subErrCode": null, // Service error code
"subErrMessage": null,// Service error details
"errCode": null, // Gateway error code
"errMessage": null // Gateway error details
}Gateway error codes
Service error codes
Gateway Error Code (subErrCode) | Error message (subErrMessage) | Description |
B_COMPUTING_CanNotFindComputingGroup | No matching compute group was found. | The compute resources in the resource pool are not ready. |
B_COMPUTING_PostPaidDisabled | The pay-as-you-go feature is not enabled. Please subscribe to a pay-as-you-go plan first. | This error is triggered if you have not purchased a pay-as-you-go instance. |