Files
comfy-deploy-python/docs/sdks/run
bennykok 6ea0b09d80 init
2024-07-16 14:45:28 -07:00
..
2024-07-16 14:45:28 -07:00

Run

(run)

Available Operations

  • get - Get workflow run output
  • create - Run a workflow via deployment_id

get

Call this to get a run's output, usually in conjunction with polling method

Example Usage

import comfydeploy

s = comfydeploy.ComfyDeploy(
    bearer_auth="<YOUR_BEARER_TOKEN_HERE>",
)


res = s.run.get(run_id='<value>')

if res.object is not None:
    # handle response
    pass

Parameters

Parameter Type Required Description
run_id str ✔️ N/A

Response

operations.GetRunResponse

Errors

Error Object Status Code Content Type
errors.GetRunResponseBody 400 application/json
errors.GetRunRunResponseBody 500 application/json
errors.SDKError 4xx-5xx /

create

Run a workflow via deployment_id

Example Usage

import comfydeploy
from comfydeploy.models import operations

s = comfydeploy.ComfyDeploy(
    bearer_auth="<YOUR_BEARER_TOKEN_HERE>",
)


res = s.run.create(request=operations.PostRunRequestBody(
    deployment_id='d290f1ee-6c54-4b01-90e6-d701748f0851',
    workflow_id='f47ac10b-58cc-4372-a567-0e02b2c3d479',
    inputs={
        'input_text': 'value1',
        'input_url': 'https://example.png',
    },
    webhook='https://example.com/webhook',
))

if res.object is not None:
    # handle response
    pass

Parameters

Parameter Type Required Description
request operations.PostRunRequestBody ✔️ The request object to use for the request.

Response

operations.PostRunResponse

Errors

Error Object Status Code Content Type
errors.PostRunResponseBody 500 application/json
errors.SDKError 4xx-5xx /