> ## 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](https://docs.comfy.org/development/api-development/workflow-api-format.md) saved as `workflow_api.json` are ready.

**1. Initialize**

```bash theme={null}
comfy build init --name "my-comfy-build" --models-dir ./models --custom-nodes-dir ./custom_nodes
```

**2. 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
```

**3. 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
```

**4. 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
```

## Other ways to start

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

> **[Comfy Desktop snapshot](https://docs.comfy.org/development/serverless/build-sources.md#comfy-desktop-snapshot)**
>
> Export a snapshot from Desktop, then import it into the Build Wizard.

> **[Import workflow JSON](https://docs.comfy.org/development/serverless/build-sources.md#workflow-json)**
>
> Start a Build by importing a saved workflow into the Build Wizard.

## Next steps

> **[Comfy Workflows](https://comfy.org/models?type=workflows)**
>
> Browse ComfyUI workflows shared by the community.

> **[Apps](https://comfy.org/models?type=apps)**
>
> Explore community apps built with ComfyUI.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.