Docs
Build with Comfy Router
The full reference lives on docs.comfy.org. Here is the short version.
One request, any model
Install
python -m pip install comfy-sdk==0.5.0Requires Python 3.10+from comfy_sdk import Comfy
# Reads COMFY_API_KEY from the environment.
with Comfy() as client:
result = client.models.run(
"byteplus/seedream-5-0-pro-260628",
{
"prompt": "A red fox trotting through a snowy pine forest, cinematic lighting",
"response_format": "url",
"watermark": False,
},
)
print(result)
Long video jobs go through the queue: POST /v2/models/{id}/requests, then poll for the result. See the docs.
Get a key
Create an API key in your Comfy account and send it in the X-API-Key header.
Pick a model
Every model has an id like byteplus/seedream-5-0-pro-260628. Browse them in rankings or pricing.
Send a request
Post the model’s JSON body. Short jobs return the output directly; video jobs go through the queue.
Endpoints
| Method | Path | What it does |
|---|---|---|
| GET | /v2/models | List every model your key can call, with input and output types |
| GET | /v2/models/{id}/openapi.json | Input schema and example body for one model |
| POST | /v2/models/{id} | Run a model and wait for the result (images, speech) |
| POST | /v2/models/{id}/requests | Queue a long job such as video, then poll for the result |
Base URL https://api.comfy.org. Send an Idempotency-Key header on POSTs so retries never charge twice, and honor Retry-After when polling.