Skip to main content
The ComfyUI Cloud Developer API provides a clean, SDK-friendly interface for running ComfyUI workflows programmatically. Use it to build applications, batch processing pipelines, or integrate AI image generation into your products.

Why Use the Developer API?

Clean REST Semantics

Designed for developers, not constrained by ComfyUI frontend compatibility

Official SDKs

Type-safe clients for Python, JavaScript, and Go

Real-time Events

WebSocket streaming for live progress updates

Webhooks

Push notifications when jobs complete

Core Concepts

Resources

ResourceDescription
InputsFiles you upload for use in workflows (images, masks, etc.)
ModelsCustom models you bring (BYOM - Bring Your Own Model)
JobsWorkflow executions
OutputsGenerated files from completed jobs
ArchivesBulk ZIP downloads of multiple job outputs
WebhooksEvent notifications to your server

Async Patterns

Many operations are asynchronous:
  1. Create - Returns 202 Accepted with resource in pending state
  2. Poll - Check status until ready or failed
  3. Use - Access the resource once ready
# Example: Upload from URL (async operation)
input = client.inputs.from_url("https://example.com/image.png")
# Status is "downloading"

# Poll for completion
while input.status == "downloading":
    time.sleep(1)
    input = client.inputs.get(input.id)

# Now ready to use
print(input.name)  # Use this in your workflow
Or use WebSockets for real-time updates without polling.

Quick Example

from comfy_cloud import ComfyCloudClient

client = ComfyCloudClient(api_key="comfyui-...")

with client:
    # Run a workflow
    job = client.jobs.create(
        workflow={
            "3": {
                "class_type": "KSampler",
                "inputs": {"seed": 42, "steps": 20, ...}
            },
            # ... rest of workflow
        },
        tags=["my-app", "batch-1"],
    )
    
    # Wait for completion
    while job.status == "pending":
        job = client.jobs.get(job.id)
    
    # Get outputs
    outputs = client.outputs.list(job_id=job.id)
    for output in outputs.outputs:
        print(f"Download: {output.download_url}")

Next Steps