For example setting up the ts client, get your api key here
client.ts
Copy
Ask AI
import { ComfyDeploy } from "comfydeploy";export const cd = new ComfyDeploy({ bearer: "<api-key>",});
Running any workflow as API, for more types definitions see here
When using queue run, an run id is returned immediately, which you can later use to check the status of the run or get the output.
Webhook callback is suggested making sure you have a way to receive the response.
Copy
Ask AI
const run = await cd.run.deployment.queue({ deploymentId: "<deployment-id>", inputs: { prompt: "A beautiful landscape", }, webhook: "<your domain>/webhook"})// run.runId