Skip to main content
Experimental API: This API is experimental and subject to change. Endpoints, request/response formats, and behavior may be modified without notice.

Comfy Cloud API

The Comfy Cloud API provides programmatic access to run workflows on Comfy Cloud infrastructure. The API is compatible with local ComfyUI’s API, making it easy to migrate existing integrations.
Subscription required: API access is available on the Standard, Creator and Pro tiers. The Free tier does not include API access. See pricing plans for details.

Credits and Usage

API requests draw from the same monthly credit allocation as the Comfy Cloud web UI — there is no separate API credit pool. Each tier’s included credits, top-up options, and per-workflow runtime caps apply to API jobs in exactly the same way as UI jobs. See the pricing page for the monthly credit amounts on the Standard, Creator and Pro tiers. If you run out of credits mid-month, top-ups can be purchased from your account dashboard.

Base URL

Authentication

All API requests require an API key passed via the X-API-Key header.

Getting an API Key

See Getting an API Key for instructions on creating and managing your Cloud API key.

Using the API Key

Pass your API key in the X-API-Key header with every request:

Core Concepts

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 “Export Workflow (API)” option.

Jobs

When you submit a workflow, a job is created. Jobs are executed asynchronously:
  1. Submit workflow via POST /api/prompt
  2. Receive a prompt_id (job ID)
  3. Monitor progress via WebSocket or poll for status
  4. Retrieve outputs when complete

Parallel Execution (Concurrent Jobs)

API users can submit multiple workflows concurrently without waiting for previous jobs to complete. Simply send multiple POST /api/prompt requests — no special headers or parameters are needed. The dispatcher will run them in parallel up to your subscription tier’s limit.
Subscription TierConcurrent Jobs
Standard1
Creator3
Pro5
Jobs submitted beyond your concurrency limit will queue normally and execute automatically as slots free up.
Parallel execution is currently available via the API only. See pricing plans for subscription details.

Example: Submitting Multiple Jobs in Parallel

Outputs

Generated content (images, videos, audio) is stored in cloud storage. Output files can be downloaded via the /api/view endpoint, which returns a 302 redirect to a temporary signed URL.

Quick Start

Here’s a complete example showing how to submit a workflow, monitor its progress, and retrieve outputs:

Step 1: Submit a Workflow

Step 2: Monitor Job Progress

You can monitor job completion using either polling or WebSocket for real-time updates.

Option A: Polling (Simple)

Job Status Values: The API returns one of the following status values:
StatusDescription
pendingJob is queued and waiting to start
in_progressJob is currently executing
completedJob finished successfully
failedJob encountered an error
cancelledJob was cancelled by user

Option B: WebSocket (Real-time Progress)

For real-time progress updates and to collect output metadata:
See WebSocket Reference for detailed message types and handling binary preview images.

Step 3: Download Outputs

Once the job completes, download the generated files. The outputs object returned from WebSocket (or available via the history endpoint) contains output data organized by node ID. Each node’s output may contain images, video, or audio arrays with file metadata. Example outputs structure:
The node ID ("9" in this example) corresponds to the SaveImage or other output nodes in your workflow. You can find these IDs by opening your workflow JSON file and looking for nodes with class_type like SaveImage, VHS_VideoCombine, etc.
The /api/view endpoint returns a 302 redirect to a temporary signed URL. Your HTTP client must follow redirects to download the file.

Complete Example

Here’s a full end-to-end example combining all three steps:

Available Endpoints

CategoryDescription
WorkflowsSubmit workflows, check status
JobsMonitor job status and queue
InputsUpload images, masks, and other inputs
OutputsDownload generated content
WebSocketReal-time progress updates
Object InfoAvailable nodes and their definitions

Next Steps

The quick start above covers the basics of submitting workflows and retrieving results. For more advanced use cases, refer to the Cloud API Reference:
  • Uploading Input Files - Upload images, masks, or other user-provided content for workflows that require external inputs
  • Modifying Workflow Inputs - Dynamically change workflow parameters like prompts, seeds, or node settings before submission
  • Using Partner Nodes - Call external AI services (Flux Pro, Ideogram, etc.) that require additional API key configuration
  • Queue Management - Monitor queue status, cancel jobs, or interrupt running executions
  • Error Handling - Handle HTTP errors, execution failures, and understand exception types
Additional resources: