POST
/
run
/
workflow
/
stream
import { ComfyDeploy } from "comfydeploy";

const comfyDeploy = new ComfyDeploy({
  bearer: "<YOUR_BEARER_TOKEN_HERE>",
});

async function run() {
  const result = await comfyDeploy.run.workflow.stream({
    inputs: {
      "num_inference_steps": 30,
      "prompt": "A beautiful landscape",
      "seed": 42,
    },
    webhook: "https://myapp.com/webhook",
    workflowId: "12345678-1234-5678-1234-567812345678",
    workflowApiJson: {},
  });

  for await (const event of result) {
    // Handle the event
    console.log(event);
  }
}

run();
{
  "event": "log_update",
  "data": {
    "logs": "<string>",
    "timestamp": "2023-11-07T05:31:56Z"
  }
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json
workflow_id
string
required
workflow_api_json
object
required
inputs
object

The inputs to the workflow

Example:
{
  "prompt": "A beautiful landscape",
  "seed": 42
}
webhook
string
webhook_intermediate_status
boolean
default:false
Example:

true

gpu
enum<string>

The GPU to override the machine's default GPU

Available options:
T4,
L4,
A10G,
A100,
A100-80GB,
H100
workflow
object
machine_id
string

Response

200
text/event-stream
Stream of workflow run events
data
object
required
event
enum<string>
default:log_update
Available options:
log_update