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

# Comfy API Quickstart

> Use an AI coding agent and comfy-cli to build, release, and deploy a local ComfyUI environment as a managed endpoint.

## Start with an agent (recommended)

Start your coding agent in the folder for the local ComfyUI install you want to deploy. Paste this prompt:

```text theme={null}
Install or update comfy-cli, then read its Build and Deploy skills:

pip install -U comfy-cli
comfy skills show comfy-build
comfy skills show comfy-deploy

Use comfy-build to inspect this local ComfyUI install and package its models, custom nodes, and pinned dependencies into a Comfy API Build. Show me what will be included and create a Linux/NVIDIA release. Then use comfy-deploy to show the available GPU and region options, worker bounds, and current rates. Wait for my approval before creating a deployment. After approval, deploy it and explain how to run a workflow.
```

## Quick start

Use these commands when the local install and an [API-format workflow](/development/api-development/workflow-api-format) saved as `workflow_api.json` are ready.

<Steps>
  <Step title="Initialize">
    ```bash theme={null}
    comfy build init --name "my-comfy-build" --models-dir ./models --custom-nodes-dir ./custom_nodes
    ```
  </Step>

  <Step title="Push and create a release">
    Push the Build and its assets, check the available targets, then wait for the Linux/NVIDIA release to finish:

    ```bash theme={null}
    comfy build push
    comfy build refs build-targets
    comfy build release create --target linux/nvidia --watch
    ```
  </Step>

  <Step title="Start a deployment">
    Check the catalog for available GPU and region pairs, then replace the GPU, region, and worker-bound placeholders with your settings:

    ```bash theme={null}
    comfy deploy refs compute
    comfy deploy up --gpu <gpu> --region <region> --min <min-workers> --max <max-workers> --watch
    ```
  </Step>

  <Step title="Run the workflow">
    Use the deployment ID printed by `comfy deploy up` with `--deployment`:

    ```bash theme={null}
    comfy deploy run \
      --workflow workflow_api.json \
      --deployment <deployment-id> \
      --output-dir ./results
    ```
  </Step>
</Steps>

## Other ways to start

Use these paths if your environment or workflow already exists in Comfy Desktop, ComfyUI, or a workflow file.

<CardGroup cols={3}>
  <Card title="Comfy Desktop snapshot" icon="camera" href="/development/serverless/build-sources#comfy-desktop-snapshot">
    Export a snapshot from Desktop, then import it into the Build Wizard.
  </Card>

  <Card title="From ComfyUI" icon="diagram-project" href="/development/serverless/build-sources#comfyui-graph-menu">
    Send the open workflow from ComfyUI to the Build Wizard or to your agent.
  </Card>

  <Card title="Import workflow JSON" icon="file-import" href="/development/serverless/build-sources#workflow-json">
    Start a Build by importing a saved workflow into the Build Wizard.
  </Card>
</CardGroup>

<Note>
  The **Deploy to Comfy API** graph-menu action may not be available in every ComfyUI account yet. If you do not see it, open the [Comfy API Build Wizard](https://platform.comfy.org/?onboarding=comfyapi) directly.
</Note>

## Next steps

<CardGroup cols={2}>
  <Card title="Browse models" icon="magnifying-glass" href="https://comfy.org/models">
    Find models to use in your ComfyUI workflows.
  </Card>

  <Card title="Examples" icon="book" href="/development/examples">
    Explore Comfy API and Comfy Router examples.
  </Card>
</CardGroup>
