> ## Documentation Index
> Fetch the complete documentation index at: https://dripart-comfy-docs-comfyapi-search.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# ComfyUI for Developers: SDKs, Server API, and Cloud

> Build on ComfyUI with official Python and TypeScript SDKs, run it as a server, call Cloud APIs, or connect AI agents via MCP.

ComfyUI is a modular GenAI inference engine that can be run as a server, accessed via API, extended with custom nodes, and managed from the command line. Most API work follows two steps: get ComfyUI running somewhere, then run workflows against it from your application.

## Use cases

<CardGroup cols={2}>
  <Card title="Call a hosted model" icon="rocket" href="/development/comfy-router/quickstart">
    Generate with hosted models through Comfy Router.
  </Card>

  <Card title="Deploy ComfyUI" icon="map" href="/development/deploy/overview">
    Deploy ComfyUI on the Developer Platform or your own infrastructure.
  </Card>

  <Card title="Run workflows" icon="play" href="/development/run-workflows/overview">
    Run workflows from your application with an SDK or the HTTP API.
  </Card>

  <Card title="Connect AI agents" icon="robot" href="/agent-tools">
    Connect AI agents to ComfyUI with MCP and Comfy CLI.
  </Card>
</CardGroup>

## Quick Start

The fastest way to try the workflow API is to run a workflow against Comfy Cloud. The SDKs point at Comfy Cloud by default. You'll need a workflow, an [API key](/development/api-development/getting-an-api-key), and a [paid Comfy Cloud subscription](/development/deploy/cloud).

<Steps>
  <Step title="Get a workflow">
    Browse [ComfyUI Workflows](https://comfy.org/workflows) for community workflows, or build your own in the editor. Save it in [API format](/development/api-development/workflow-api-format) as `workflow_api.json`.
  </Step>

  <Step title="Install an SDK">
    <CodeGroup>
      ```bash Python theme={null}
      pip install comfy-sdk
      ```

      ```bash TypeScript theme={null}
      npm i @comfyorg/sdk
      ```
    </CodeGroup>
  </Step>

  <Step title="Run it">
    <CodeGroup>
      ```python Python theme={null}
      from comfy_sdk import Comfy

      client = Comfy(api_key="comfyui-...")  # Comfy Cloud is the default target

      wf = client.workflows.from_file("workflow_api.json")

      job = client.run(wf)
      for output in job.get_outputs("9"):
          output.to_file(output.name)
      ```

      ```typescript TypeScript theme={null}
      import { Comfy } from "@comfyorg/sdk";

      const client = new Comfy({ apiKey: "comfyui-..." }); // Comfy Cloud is the default target

      const wf = await client.workflows.fromFile("workflow_api.json");

      const job = await client.run(wf);
      await job.getOutputs("9")[0].toFile("out.png");
      ```
    </CodeGroup>

    `"9"` is the ID of the output node in your workflow file. See the [SDK guide](/development/api-development/sdks) for inputs, progress events, and error handling.
  </Step>

  <Step title="Deploy your own ComfyUI">
    When you need your own models and custom nodes behind the endpoint, create a [Comfy API deployment](/development/serverless/overview), a serverless endpoint managed through the Developer Platform. The same SDK code works against it; only the base URL changes.
  </Step>
</Steps>
