The Queue API makes it easy to manage inference jobs for your deployed ComfyUI workflows. You can use it to submit new jobs, track their progress, retrieve results, and cancel them whenever necessary.

Queue endpoints

Base URL: https://api.runcomfy.net
EndpointMethodDescription
/prod/v1/deployments/{deployment_id}/inferencePOSTRun workflow
/prod/v1/deployments/{deployment_id}/requests/{request_id}/statusGETCheck job status
/prod/v1/deployments/{deployment_id}/requests/{request_id}/resultGETGet job result
/prod/v1/deployments/{deployment_id}/requests/{request_id}/cancelPOSTCancel 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

Use POST /prod/v1/deployments/{deployment_id}/inference to start a new inference job. The API automatically loads the workflow you’ve already deployed for {deployment_id}, so you only need to include overrides for the parts you want to change. Any parts you leave out will use the workflow’s default values. This makes it easy to tweak specific node inputs without having to upload the entire workflow JSON each time. When setting overrides, make sure the node IDs, input keys, and value formats match your workflow’s API JSON exactly. If they don’t, the overrides won’t work. For media inputs like images or videos, you can provide a URL or a Base64 data URI inside the inputs object. For reference, here’s a sample file you can check: runcomfy-flux-kontext-workflow-api.json

Request Example: Basic

For example, this request overrides the seed in KSampler (ID "31") and the text in CLIPTextEncode (ID "6") from runcomfy-flux-kontext-workflow-api.json.
curl --request POST \
  --url https://api.runcomfy.net/prod/v1/deployments/{deployment_id}/inference \
  --header "Content-Type: application/json" \
  --header "Authorization: Bearer <token>" \
  --data '{
    "overrides": {
      "31": {
        "inputs": {
          "seed": 987654321
        }
      },
      "6": {
        "inputs": {
          "text": "futuristic cityscape"
        }
      }
    }
  }'

Request Example: Media Upload (URL)

For example, this request overrides the image in LoadImage (ID "189") from runcomfy-flux-kontext-workflow-api.json with a URL.
curl --request POST \
  --url https://api.runcomfy.net/prod/v1/deployments/{deployment_id}/inference \
  --header "Content-Type: application/json" \
  --header "Authorization: Bearer <token>" \
  --data '{
    "overrides": {
      "189": {
        "inputs": {
          "image": "https://example.com/new-image.jpg"
        }
      }
    }
  }'

Request Example: Media Upload (Base64)

For example, this request overrides the image in LoadImage (ID "189") from runcomfy-flux-kontext-workflow-api.json with a Base64 data URI.
curl --request POST \
  --url https://api.runcomfy.net/prod/v1/deployments/{deployment_id}/inference \
  --header "Content-Type: application/json" \
  --header "Authorization: Bearer <token>" \
  --data '{
    "overrides": {
      "189": {
        "inputs": {
          "image": "data:image/jpeg;base64,/9j/4AAQSkZJRgABAQEASABIAAD..."
        }
      }
    }
  }'
Request Body Explanation A JSON object for customizing the workflow. All fields are optional.
  • 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 the inputs object.

Media Upload

Media inputs (images or videos) can be added to the inputs object as either Base64 data URIs or public URLs. 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).
Via URL (Public file link)
Include a public URL in the inputs object (for example: "image": "https://example.com/image.jpg"). Keep in mind that some hosts may block requests. Recommended limits: images ≤50MB (around 4K); videos ≤100MB (about 2–5 minutes at 720p).

Response Example

{
  "request_id": "{request_id}",
  "status_url": "https://runcomfy.com/api/v1/deployments/{deployment_id}/requests/{request_id}/status",
  "result_url": "https://runcomfy.com/api/v1/deployments/{deployment_id}/requests/{request_id}/result",
  "cancel_url": "https://runcomfy.com/api/v1/deployments/{deployment_id}/requests/{request_id}/cancel"
}
Response Explanation Successful requests return a 200 OK status with a JSON object providing job tracking details.
  • 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.

Monitoring Request Status

Use GET /prod/v1/deployments/{deployment_id}/requests/{request_id}/status to check the current state of a queued or running job. Poll this endpoint periodically for updates on progress.

Request Example

curl --request GET \
  --url https://api.runcomfy.net/prod/v1/deployments/{deployment_id}/requests/{request_id}/status \
  --header "Authorization: Bearer <token>"

Response Example

{
  "status": "in_queue",
  "queue_position": 0,
  "result_url": "https://runcomfy.com/api/v1/deployments/{deployment_id}/requests/{request_id}/result"
}
Response Explanation Successful requests return a 200 OK status with a JSON object describing the job’s state. The content varies by status:
  • 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").

Retrieving Request Results

Use GET /prod/v1/deployments/{deployment_id}/requests/{request_id}/result to fetch outputs once the job status is "completed".

Request Example

curl --request GET \
  --url https://api.runcomfy.net/prod/v1/deployments/{deployment_id}/requests/{request_id}/result \
  --header "Authorization: Bearer <token>"

Response Example

{
  "status": "succeeded",
  "outputs": {
    "136": {
      "images": [
        {
          "url": "https://example.com/ComfyUI_00001_.png",
          "filename": "ComfyUI_00001_.png",
          "subfolder": "",
          "type": "output"
        }
      ]
    }
  },
  "created_at": "2025-07-22T13:05:16.143086",
  "finished_at": "2025-07-22T13:13:03.624471"
}
Response Explanation Successful requests return a 200 OK status with a JSON object containing the job’s final details. The content varies by status:
  • 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.
      • created_at (string): When the request was created.
      • finished_at (string): When the request completed.
    • 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.

Cancelling a Request

Use POST /prod/v1/deployments/{deployment_id}/requests/{request_id}/cancel to attempt to cancel a queued or running job.

Request Example

curl --request POST \
  --url https://api.runcomfy.net/prod/v1/deployments/{deployment_id}/requests/{request_id}/cancel \
  --header "Authorization: Bearer <token>"

Response Example

{
  "status": "cancellation_requested"
}
Response Explanation Successful requests return a 202 Accepted status with a JSON object containing the cancellation outcome.
  • status (string): Outcome (e.g., "cancellation_requested"if accepted, "not_cancellable" if the job is completed or otherwise cannot be canceled).
By using these endpoints, you can fully manage the lifecycle of your ComfyUI inference jobs, from submission and monitoring to retrieving results and canceling tasks, directly through the API.