Queue endpoints
Base URL:https://api.runcomfy.net
Endpoint | Method | Description |
---|---|---|
/prod/v1/deployments/{deployment_id}/inference | POST | Run workflow |
/prod/v1/deployments/{deployment_id}/requests/{request_id}/status | GET | Check job status |
/prod/v1/deployments/{deployment_id}/requests/{request_id}/result | GET | Get job result |
/prod/v1/deployments/{deployment_id}/requests/{request_id}/cancel | POST | Cancel job |
Common Path Parameters
-
deployment_id
: string (required)
This is the unique ID for your deployed workflow. You get it when you create a deployment. It tells the server which workflow to use. -
request_id
: string (required, except for submission)
This is the unique ID for a specific job, given back when you submit a request.
Submitting a Request
POST/prod/v1/deployments/{deployment_id}/inference
Use this endpoint to start a new inference job. When you deploy a workflow on RunComfy, the platform stores its workflow_api.json
as the base configuration for that deployment. By default, each POST to this endpoint runs that cloud-saved workflow and lets you tweak inputs via overrides
. For advanced cases, you can instead include a complete different workflow_api.json
inline and skip the cloud-saved workflow entirely.
Using Cloud-Saved Workflow
In this mode, the server uses the deployment’s cloud-saved workflow’sworkflow_api.json
and applies any per-request changes you send in overrides
. Unspecified values fall back to the saved defaults. overrides
reference the workflow_api.json
, target specific nodes (by ID) and updates only their inputs
. For guidance on valid ranges, types, and defaults, refer to the object_info.json
.
Read more about workflow_api.json
and object_info.json
here.
The following snippet shows two nodes from a sample flux_workflow_api.json
file, illustrating typical structure with inputs like text prompts and seeds. View the complete example here: runcomfy-flux-workflow-api.json.
Request Example - Basic
For example, this request overrides theseed
in KSampler
(ID "31"
) and the text
in CLIPTextEncode
(ID "6"
) from flux_kontext_workflow_api.json
.
Request Example - Image/Video
Image/Video Upload with a URL For example, this request overrides theimage
in LoadImage
(ID "189"
) from flux_kontext_workflow_api.json
with a URL.
image
in LoadImage
(ID "189"
) from flux_kontext_workflow_api.json
with a Base64 data URI.
Request Example - API Nodes
If your workflow uses ComfyUI API Nodes that require an API key, include it in the request body asextra_data.api_key_comfy_org
. The key is passed to the node at runtime, used only for the duration of the request, and discarded upon completion.
Note: extra_data
and overrides
are top-level sibling fields in the JSON payload, keep them side by side.
- overrides (object):
- Keys: Node IDs as strings (e.g.,
"31"
), matching your workflow’s API JSON exactly. - Values: Objects with an
inputs
field containing input names and updated values (e.g.,{ "inputs": { "seed": 987654321 } }
).
Input keys and formats must match your workflow’s API JSON. For media inputs, use a URL (e.g.,"image": "https://example.com/new-image.jpg"
) or Base64 data URI (e.g.,"image": "data:image/jpeg;base64,/9j/..."
) in theinputs
object.
- Keys: Node IDs as strings (e.g.,
-
Via Base64 (Data URI):
- Include a Base64 data URI in the
inputs
object (for example:"image": "data:image/jpeg;base64,/9j/..."
). - Large files may slow down requests.
- Recommended limits: images ≤256KB (around 512x512); videos ≤1MB for short clips (around 480p).
- Include a Base64 data URI in the
-
Via URL (Public file link):
- Include a public URL in the
inputs
object (for example:"image": "https://example.com/image.jpg"
). - Some hosts may block requests.
- Recommended limits: images ≤50MB (around 4K); videos ≤100MB (about 2–5 minutes at 720p).
- Include a public URL in the
Response Example
- request_id (string): Unique identifier for the job.
- status_url (string): URL to poll for job progress.
- result_url (string): URL to fetch outputs once the job completes.
- cancel_url (string): URL to cancel the job if still queued.
Using Dynamic Workflow
If you need to run a different workflow for a single request, send a complete ComfyUI Workflow API JSON under the top-levelworkflow_api_json
field and omit overrides
. In this mode, the server executes the inline workflow and ignores the cloud-saved one for this request.
Request Example
Response Example
The response format is identical to the cloud-saved workflow mode:Monitoring Request Status
GET/prod/v1/deployments/{deployment_id}/requests/{request_id}/status
Use this endpoint to check the current state of a queued or running job. Poll this endpoint periodically for updates on progress.
Request Example
Response Example
- status (string): Current state (e.g.,
"in_queue"
,"in_progress"
,"completed"
, or"canceled"
). - Additional fields based on status:
- For
"in_queue"
:- queue_position (integer): Your position in the queue.
- result_url (string): URL where results will be available.
- For
"in_progress"
,"completed"
, or"canceled"
:- result_url (string): The URL to get the final outputs (available only when
"completed"
or"canceled"
).
- result_url (string): The URL to get the final outputs (available only when
- For
Retrieving Request Results
GET/prod/v1/deployments/{deployment_id}/requests/{request_id}/result
Use this endpoint to fetch outputs once the job status is "completed"
.
Request Example
Response Example
- status (string): Outcome (e.g.,
"succeeded"
,"failed"
,"in_queue"
,"in_progress"
,"canceled"
). - Additional fields based on status:
- For
"succeeded"
:- outputs (array): Generated files, each with:
- url (string): Direct link to the output file (e.g.,
"https://example.com/outputs/ComfyUI_00001_.png"
). - filename (string): Name of the output file.
- url (string): Direct link to the output file (e.g.,
- created_at (string): When the request was created.
- finished_at (string): When the request completed.
- outputs (array): Generated files, each with:
- For
"failed"
:- error: Details on why the job failed.
- created_at (string): When the request was created.
- finished_at: When the request failed or was canceled.
- For
"in_queue"
,"in_progress"
, or"canceled"
:- created_at (string): When the request was created.
- finished_at (string, only for
"canceled"
): When the request was canceled.
- For
Cancelling a Request
POST/prod/v1/deployments/{deployment_id}/requests/{request_id}/cancel
Use this endpoint to cancel a queued or running job.
Request Example
Response Example
- status (string): Outcome (e.g.,
"cancellation_requested"
if accepted,"not_cancellable"
if the job is completed or otherwise cannot be canceled).