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: Running workflows via the API requires an active Comfy Cloud subscription. See pricing plans for details.
Base URL
Authentication
All API requests require an API key passed via theX-API-Key header.
Getting an API Key
Visit https://platform.comfy.org/login and Log In
Please visit https://platform.comfy.org/login and log in with the corresponding account

Using the API Key
Pass your API key in theX-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 “Save (API Format)” option.Jobs
When you submit a workflow, a job is created. Jobs are executed asynchronously:- Submit workflow via
POST /api/prompt - Receive a
prompt_id(job ID) - Monitor progress via WebSocket or poll for status
- Retrieve outputs when complete
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:| Status | Description |
|---|---|
pending | Job is queued and waiting to start |
in_progress | Job is currently executing |
completed | Job finished successfully |
failed | Job encountered an error |
cancelled | Job 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. Theoutputs 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:
"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
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
- OpenAPI Specification - Machine-readable API spec for code generation


