> ## 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 クイックスタート

> AIコーディングエージェントとcomfy-cliを使って、ローカルのComfyUI環境をビルドしてリリースし、マネージドエンドポイントとしてデプロイします。

## エージェントから始める（推奨）

デプロイしたいローカルComfyUIインストールのフォルダーでコーディングエージェントを起動します。次のプロンプトを貼り付けてください:

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

## クイックスタート

ローカルインストールと、`workflow_api.json` として保存された[APIフォーマットのワークフロー](https://docs.comfy.org/ja/development/api-development/workflow-api-format.md)が準備できている場合は、次のコマンドを使用します。

**1. 初期化**

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

**2. プッシュしてリリースを作成**

Buildとそのアセットをプッシュし、利用可能なターゲットを確認してから、Linux/NVIDIAリリースが完了するのを待ちます:

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

**3. デプロイを開始**

カタログで利用可能なGPUとリージョンの組み合わせを確認し、GPU、リージョン、ワーカー上限のプレースホルダーを自分の設定に置き換えます:

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

**4. ワークフローを実行**

`comfy deploy up` が出力したデプロイIDを `--deployment` に指定して使用します:

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

## その他の開始方法

環境またはワークフローがすでにComfyデスクトップやワークフローファイルに存在する場合は、こちらを使用します。

> [card] [Comfyデスクトップのスナップショット](https://docs.comfy.org/ja/development/serverless/build-sources#comfy-desktop-スナップショット)
>
> デスクトップからスナップショットをエクスポートし、Buildウィザードにインポートします。

> [card] [ワークフローJSONのインポート](https://docs.comfy.org/ja/development/serverless/build-sources#ワークフロー-json)
>
> 保存済みのワークフローをBuildウィザードにインポートしてBuildを開始します。

## 次のステップ

> [card] [Comfy ワークフロー](https://comfy.org/models?type=workflows)
>
> コミュニティが共有するComfyUIワークフローを閲覧できます。

> [card] [アプリ](https://comfy.org/models?type=apps)
>
> ComfyUIで作られたコミュニティアプリを探索できます。


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