Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
967845d
feat: rename Cloud & Partner APIs group to ComfyUI APIs, add Server A…
lin-bot23 Jun 2, 2026
ecaba20
Add image
comfyui-wiki Jun 2, 2026
2ee989d
Add export workflow API format image to quick-start pages
lin-bot23 Jun 2, 2026
b1afa71
Rename quick-start to api-examples for clarity
lin-bot23 Jun 2, 2026
bf19136
Add Workflow API Format page, link from Cloud overview and API examples
lin-bot23 Jun 2, 2026
738bbd2
Reorder sidebar: move utility pages after API groups
lin-bot23 Jun 2, 2026
150ab5e
Fix Server API base URL: use generic description instead of hardcoded…
lin-bot23 Jun 2, 2026
a28897b
Link API format to workflow-api-format page in overview
lin-bot23 Jun 2, 2026
770091a
Update API format workflow example
comfyui-wiki Jun 2, 2026
a3934a3
Remove verbose structure explanation from workflow-api-format pages
lin-bot23 Jun 2, 2026
3e8eaf5
Fix titles: quick-start → API Examples (EN/ZH/JA)
lin-bot23 Jun 2, 2026
74d6095
Merge server-guide into comms_overview, remove redundant page
lin-bot23 Jun 2, 2026
615c7f2
Fix remaining server-guide link in development/overview
lin-bot23 Jun 2, 2026
5f7baa0
Add source links to GitHub for each API example (EN/ZH/JA)
lin-bot23 Jun 2, 2026
0460b9e
Remove irrelevant 'Login with API Key' card from api-key-integration
lin-bot23 Jun 2, 2026
2e6f20d
Update icons: ComfyUI APIs → computer, ComfyUI Server API → server
lin-bot23 Jun 2, 2026
7f0ea4b
Simplify Cloud API overview: replace GetApiKey snippet with link to c…
lin-bot23 Jun 2, 2026
37db1b9
Add cloud icon to Cloud API group (EN/ZH/JA)
lin-bot23 Jun 2, 2026
68da0d9
Add icons to all ComfyUI APIs pages in frontmatter (EN/ZH/JA)
lin-bot23 Jun 2, 2026
5a34b10
Replace non-standard icons with FontAwesome verified ones
lin-bot23 Jun 2, 2026
75cefd4
fix: update development overview link to api-examples page
comfyui-wiki Jun 3, 2026
99dce4f
Remove Comfy Cloud account requirement from API prerequisites in Engl…
comfyui-wiki Jun 4, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions development/api-development/getting-an-api-key.mdx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
title: 'Getting an API Key'
description: 'Learn how to create and manage your Comfy Platform API Key for accessing Cloud APIs, Partner Nodes, and more.'
icon: 'key'
---

import GetApiKey from '/snippets/get-api-key.mdx'
Expand Down
48 changes: 48 additions & 0 deletions development/api-development/overview.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
---
title: "APIs Overview"
description: "An overview of the different ways to interact with ComfyUI programmatically"
icon: "list"
---

ComfyUI offers several API options depending on where you want to run your workflows and how much infrastructure you want to manage. This page helps you choose the right approach.

---

## Which API Should I Use?

| | Cloud API | ComfyUI Server API |
|---|---|---|
| **Where it runs** | Comfy Cloud (managed GPUs) | Your own machine |

Check warning on line 15 in development/api-development/overview.mdx

View check run for this annotation

Mintlify / Mintlify Validation (dripart) - vale-spellcheck

development/api-development/overview.mdx#L15

Did you really mean 'GPUs'?
| **GPU management** | Handled for you | You manage your own hardware |
| **Models** | Pre-installed and managed by Comfy | You download and manage locally |
| **Authentication** | `X-API-Key` header (Comfy Cloud account) | None (local) or API key for Partner Nodes |
| **Base URL** | `https://cloud.comfy.org` | Your server URL (e.g. `http://localhost:8188`) |
| **Protocol** | REST + WebSocket | REST + WebSocket |
| **Pricing** | Subscription-based (Creator/Pro tiers) | Free (your own compute) |
| **Best for** | Quick integration, no infrastructure | Full control, custom hardware & models |

Both APIs use the same workflow format ([API format](/development/api-development/workflow-api-format)), so you can develop and test workflows locally and move them to the cloud without changes.

---

## Getting Started

<CardGroup cols={3}>
<Card title="Cloud API" icon="cloud" href="/development/cloud/overview">
Run workflows on Comfy's managed infrastructure. No GPU setup required.

Check warning on line 32 in development/api-development/overview.mdx

View check run for this annotation

Mintlify / Mintlify Validation (dripart) - vale-spellcheck

development/api-development/overview.mdx#L32

Did you really mean 'Comfy's'?
</Card>
<Card title="ComfyUI Server API" icon="server" href="/development/comfyui-server/comms_overview">
Run ComfyUI as a server on your own machine and call it via API.
</Card>
<Card title="Partner Node API Integration" icon="key" href="/development/comfyui-server/api-key-integration">
Use paid Partner Nodes in headless or API-driven workflows.
</Card>
</CardGroup>

---

## Prerequisites

Before using any API, you'll need:

- An API key (see [Getting an API Key](/development/api-development/getting-an-api-key))
170 changes: 170 additions & 0 deletions development/api-development/workflow-api-format.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,170 @@
---
title: "Workflow API Format"
description: "Understanding the API format for ComfyUI workflows and how to export them"
icon: "file-code"
---

ComfyUI workflows are JSON objects that describe a graph of nodes. When calling ComfyUI programmatically — whether through the Cloud API or running your own server — the workflow must be submitted in **API format**, a specialized JSON structure that differs from the regular save format used in the browser.

This page explains the differences and how to export your workflows correctly.

---

## Save Format vs API Format

The ComfyUI frontend can save workflows in two formats:

| | Save Format | API Format |
|---|---|---|
| **File menu** | `File → Save` or `Ctrl+S` | `File → Export Workflow (API)` |
| **File extension** | `.json` | `.json` |
| **Node keys** | Node titles or labels | Numeric node IDs |
| **Widget values** | Included | Included |
| **Position/layout data** | Included (x, y, width) | **Excluded** |
| **Colors/groups** | Included | **Excluded** |
| **Usage** | Re-opening in the frontend | API submission |
| **Can be loaded in UI** | Yes | Yes, but without layout |

The key difference: **API format omits UI metadata** (positions, colors, groups, node sizes) that is only needed for visual editing in the frontend. This keeps the JSON smaller and cleaner for programmatic use.

---

## How to Export

Open your workflow in the ComfyUI frontend, then navigate to `File → Export Workflow (API)`:

<Frame caption="Export a workflow in API format from the ComfyUI frontend">
<img src="/images/development/export_workflow_api_format.png" alt="Saving a workflow in API format" />
</Frame>

This will download a `.json` file containing only the API-relevant data:

```json
{
"3": {
"inputs": {
"seed": 156680208700286,
"steps": 20,
"cfg": 8,
"sampler_name": "euler",
"scheduler": "normal",
"denoise": 1,
"model": [
"4",
0
],
"positive": [
"6",
0
],
"negative": [
"7",
0
],
"latent_image": [
"5",
0
]
},
"class_type": "KSampler",

Check warning on line 69 in development/api-development/workflow-api-format.mdx

View check run for this annotation

Mintlify / Mintlify Validation (dripart) - vale-spellcheck

development/api-development/workflow-api-format.mdx#L69

Did you really mean 'class_type'?

Check warning on line 69 in development/api-development/workflow-api-format.mdx

View check run for this annotation

Mintlify / Mintlify Validation (dripart) - vale-spellcheck

development/api-development/workflow-api-format.mdx#L69

Did you really mean 'KSampler'?
"_meta": {

Check warning on line 70 in development/api-development/workflow-api-format.mdx

View check run for this annotation

Mintlify / Mintlify Validation (dripart) - vale-spellcheck

development/api-development/workflow-api-format.mdx#L70

Did you really mean '_meta'?
"title": "KSampler"
}
},
"4": {
"inputs": {
"ckpt_name": "v1-5-pruned-emaonly-fp16.safetensors"
},
"class_type": "CheckpointLoaderSimple",

Check warning on line 78 in development/api-development/workflow-api-format.mdx

View check run for this annotation

Mintlify / Mintlify Validation (dripart) - vale-spellcheck

development/api-development/workflow-api-format.mdx#L78

Did you really mean 'class_type'?
"_meta": {

Check warning on line 79 in development/api-development/workflow-api-format.mdx

View check run for this annotation

Mintlify / Mintlify Validation (dripart) - vale-spellcheck

development/api-development/workflow-api-format.mdx#L79

Did you really mean '_meta'?
"title": "Load Checkpoint"
}
},
"5": {
"inputs": {
"width": 512,
"height": 512,
"batch_size": 1
},
"class_type": "EmptyLatentImage",

Check warning on line 89 in development/api-development/workflow-api-format.mdx

View check run for this annotation

Mintlify / Mintlify Validation (dripart) - vale-spellcheck

development/api-development/workflow-api-format.mdx#L89

Did you really mean 'class_type'?
"_meta": {

Check warning on line 90 in development/api-development/workflow-api-format.mdx

View check run for this annotation

Mintlify / Mintlify Validation (dripart) - vale-spellcheck

development/api-development/workflow-api-format.mdx#L90

Did you really mean '_meta'?
"title": "Empty Latent Image"
}
},
"6": {
"inputs": {
"text": "beautiful scenery nature glass bottle landscape, , purple galaxy bottle,",
"clip": [
"4",
1
]
},
"class_type": "CLIPTextEncode",

Check warning on line 102 in development/api-development/workflow-api-format.mdx

View check run for this annotation

Mintlify / Mintlify Validation (dripart) - vale-spellcheck

development/api-development/workflow-api-format.mdx#L102

Did you really mean 'class_type'?
"_meta": {

Check warning on line 103 in development/api-development/workflow-api-format.mdx

View check run for this annotation

Mintlify / Mintlify Validation (dripart) - vale-spellcheck

development/api-development/workflow-api-format.mdx#L103

Did you really mean '_meta'?
"title": "CLIP Text Encode (Prompt)"
}
},
"7": {
"inputs": {
"text": "text, watermark",
"clip": [
"4",
1
]
},
"class_type": "CLIPTextEncode",

Check warning on line 115 in development/api-development/workflow-api-format.mdx

View check run for this annotation

Mintlify / Mintlify Validation (dripart) - vale-spellcheck

development/api-development/workflow-api-format.mdx#L115

Did you really mean 'class_type'?
"_meta": {

Check warning on line 116 in development/api-development/workflow-api-format.mdx

View check run for this annotation

Mintlify / Mintlify Validation (dripart) - vale-spellcheck

development/api-development/workflow-api-format.mdx#L116

Did you really mean '_meta'?
"title": "CLIP Text Encode (Prompt)"
}
},
"8": {
"inputs": {
"samples": [
"3",
0
],
"vae": [
"4",
2
]
},
"class_type": "VAEDecode",

Check warning on line 131 in development/api-development/workflow-api-format.mdx

View check run for this annotation

Mintlify / Mintlify Validation (dripart) - vale-spellcheck

development/api-development/workflow-api-format.mdx#L131

Did you really mean 'class_type'?

Check warning on line 131 in development/api-development/workflow-api-format.mdx

View check run for this annotation

Mintlify / Mintlify Validation (dripart) - vale-spellcheck

development/api-development/workflow-api-format.mdx#L131

Did you really mean 'VAEDecode'?
"_meta": {

Check warning on line 132 in development/api-development/workflow-api-format.mdx

View check run for this annotation

Mintlify / Mintlify Validation (dripart) - vale-spellcheck

development/api-development/workflow-api-format.mdx#L132

Did you really mean '_meta'?
"title": "VAE Decode"
}
},
"9": {
"inputs": {
"filename_prefix": "ComfyUI",
"images": [
"8",
0
]
},
"class_type": "SaveImage",

Check warning on line 144 in development/api-development/workflow-api-format.mdx

View check run for this annotation

Mintlify / Mintlify Validation (dripart) - vale-spellcheck

development/api-development/workflow-api-format.mdx#L144

Did you really mean 'class_type'?
"_meta": {

Check warning on line 145 in development/api-development/workflow-api-format.mdx

View check run for this annotation

Mintlify / Mintlify Validation (dripart) - vale-spellcheck

development/api-development/workflow-api-format.mdx#L145

Did you really mean '_meta'?
"title": "Save Image"
}
}
}
```

---

## Converting Between Formats

If you have a save-format workflow and need it in API format, the simplest method is:

1. Open the `.json` file using `File → Load` in the frontend
2. Export it via `File → Export Workflow (API)`

For automated conversion, you can write a script that strips the `x`, `y`, `width` fields from each node and removes the `groups` and `extra` sections from the root JSON.

---

## Related Pages

- [APIs Overview](/development/api-development/overview) — Compare Cloud and Server API options
- [Cloud API Overview](/development/cloud/overview) — Submit API-format workflows to Comfy Cloud
- [API Examples](/development/comfyui-server/api-examples) — See API-format workflows in action
- [Getting an API Key](/development/api-development/getting-an-api-key) — Required for Cloud API and Partner Nodes
1 change: 1 addition & 0 deletions development/cloud/api-reference.mdx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
title: "Cloud API Reference"
description: "Complete API reference with code examples for Comfy Cloud"
icon: "book-open"
---

import PollJobCompletion from '/snippets/cloud/poll-job-completion.mdx'
Expand Down Expand Up @@ -183,7 +184,7 @@
### Upload Mask

<Note>
The `subfolder` parameter is accepted for API compatibility but ignored in cloud storage. All files are stored in a flat, content-addressed namespace.

Check warning on line 187 in development/cloud/api-reference.mdx

View check run for this annotation

Mintlify / Mintlify Validation (dripart) - vale-spellcheck

development/cloud/api-reference.mdx#L187

Did you really mean 'namespace'?
</Note>

<CodeGroup>
Expand Down Expand Up @@ -409,8 +410,8 @@
```typescript TypeScript
function setWorkflowInput(
workflow: Record<string, any>,
nodeId: string,

Check warning on line 413 in development/cloud/api-reference.mdx

View check run for this annotation

Mintlify / Mintlify Validation (dripart) - vale-spellcheck

development/cloud/api-reference.mdx#L413

Did you really mean 'nodeId'?
inputName: string,

Check warning on line 414 in development/cloud/api-reference.mdx

View check run for this annotation

Mintlify / Mintlify Validation (dripart) - vale-spellcheck

development/cloud/api-reference.mdx#L414

Did you really mean 'inputName'?
value: any
): Record<string, any> {
if (workflow[nodeId]) {
Expand Down Expand Up @@ -511,7 +512,7 @@
| Offset | Size | Field | Description |
|--------|------|-------|-------------|
| 0 | 4 bytes | `type` | `0x00000003` |
| 4 | 4 bytes | `node_id_len` | Length of node_id string |

Check warning on line 515 in development/cloud/api-reference.mdx

View check run for this annotation

Mintlify / Mintlify Validation (dripart) - vale-spellcheck

development/cloud/api-reference.mdx#L515

Did you really mean 'node_id'?
| 8 | N bytes | `node_id` | UTF-8 encoded node ID |
| 8+N | variable | `text` | UTF-8 encoded progress text |
</Tab>
Expand Down Expand Up @@ -575,7 +576,7 @@
}

async function waitForCompletion(
promptId: string,

Check warning on line 579 in development/cloud/api-reference.mdx

View check run for this annotation

Mintlify / Mintlify Validation (dripart) - vale-spellcheck

development/cloud/api-reference.mdx#L579

Did you really mean 'promptId'?
timeout: number = 300000
): Promise<Record<string, any>> {
const wsUrl = `wss://cloud.comfy.org/ws?clientId=${crypto.randomUUID()}&token=${API_KEY}`;
Expand Down Expand Up @@ -619,7 +620,7 @@

async function downloadOutputs(
outputs: Record<string, any>,
outputDir: string

Check warning on line 623 in development/cloud/api-reference.mdx

View check run for this annotation

Mintlify / Mintlify Validation (dripart) - vale-spellcheck

development/cloud/api-reference.mdx#L623

Did you really mean 'outputDir'?
): Promise<void> {
for (const nodeOutputs of Object.values(outputs)) {
for (const key of ["images", "video", "audio"]) {
Expand All @@ -635,9 +636,9 @@
redirect: "manual",
});
if (response.status !== 302) throw new Error(`HTTP ${response.status}`);
const signedUrl = response.headers.get("location")!;

Check warning on line 639 in development/cloud/api-reference.mdx

View check run for this annotation

Mintlify / Mintlify Validation (dripart) - vale-spellcheck

development/cloud/api-reference.mdx#L639

Did you really mean 'signedUrl'?
// Fetch from signed URL without auth headers
const fileResponse = await fetch(signedUrl);

Check warning on line 641 in development/cloud/api-reference.mdx

View check run for this annotation

Mintlify / Mintlify Validation (dripart) - vale-spellcheck

development/cloud/api-reference.mdx#L641

Did you really mean 'fileResponse'?
if (!fileResponse.ok) throw new Error(`HTTP ${fileResponse.status}`);

const path = `${outputDir}/${fileInfo.filename}`;
Expand Down
1 change: 1 addition & 0 deletions development/cloud/openapi.mdx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
title: "OpenAPI Specification"
description: "Machine-readable OpenAPI specification for Comfy Cloud API"
icon: "file-lines"
openapi: "/openapi-cloud.yaml"
---

Expand Down Expand Up @@ -30,7 +31,7 @@

- **Generate client libraries** in any language using tools like [OpenAPI Generator](https://openapi-generator.tech/)
- **Import into API tools** like Postman, Insomnia, or Paw
- **Generate documentation** using tools like Redoc or Swagger UI

Check warning on line 34 in development/cloud/openapi.mdx

View check run for this annotation

Mintlify / Mintlify Validation (dripart) - vale-spellcheck

development/cloud/openapi.mdx#L34

Did you really mean 'Redoc'?
- **Validate requests** in your application

## Download
Expand Down
8 changes: 2 additions & 6 deletions development/cloud/overview.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,7 @@

### Getting an API Key

<GetApiKey />

<Warning>
Keep your API key secure. Never commit it to version control or share it publicly.
</Warning>
See [Getting an API Key](/development/api-development/getting-an-api-key) for instructions on creating and managing your Cloud API key.

### Using the API Key

Expand Down Expand Up @@ -80,7 +76,7 @@

### Workflows

ComfyUI workflows are JSON objects describing a graph of nodes. The API accepts workflows in the "API format" (node IDs as keys with class_type, inputs, etc.) as produced by the ComfyUI frontend's "Save (API Format)" option.
ComfyUI workflows are JSON objects describing a graph of nodes. The API accepts workflows in the [API format](/development/api-development/workflow-api-format) (node IDs as keys with class_type, inputs, etc.) as produced by the ComfyUI frontend's "Export Workflow (API)" option.

Check warning on line 79 in development/cloud/overview.mdx

View check run for this annotation

Mintlify / Mintlify Validation (dripart) - vale-spellcheck

development/cloud/overview.mdx#L79

Did you really mean 'class_type'?

Check warning on line 79 in development/cloud/overview.mdx

View check run for this annotation

Mintlify / Mintlify Validation (dripart) - vale-spellcheck

development/cloud/overview.mdx#L79

Did you really mean 'frontend's'?

### Jobs

Expand Down Expand Up @@ -118,7 +114,7 @@
API_KEY = os.environ["COMFY_CLOUD_API_KEY"]

async def submit_workflow(session, workflow):
"""Submit a single workflow and return the prompt_id."""

Check warning on line 117 in development/cloud/overview.mdx

View check run for this annotation

Mintlify / Mintlify Validation (dripart) - vale-spellcheck

development/cloud/overview.mdx#L117

Did you really mean 'prompt_id'?
async with session.post(
f"{BASE_URL}/api/prompt",
headers={"X-API-Key": API_KEY, "Content-Type": "application/json"},
Expand All @@ -129,7 +125,7 @@

async def main():
with open("workflow_api.json") as f:
base_workflow = json.load(f)

Check warning on line 128 in development/cloud/overview.mdx

View check run for this annotation

Mintlify / Mintlify Validation (dripart) - vale-spellcheck

development/cloud/overview.mdx#L128

Did you really mean 'base_workflow'?

# Create variations by changing the seed
workflows = []
Expand Down
Loading
Loading