Get your ComfyUI workflow deployed as a serverless API and make your first inference call. This guide walks you step-by-step through deploying a pre-built community workflow, RunComfy/FLUX, into a scalable, ready-to-use API endpoint.
Note: You can deploy your own custom workflows as APIs too, check out the Custom Workflows section for details.

Step 1: Prepare the Workflow

First, visit the RunComfy/FLUX workflow page and click Run Workflow to load it into a machine instance. This action launches a ComfyUI session, which may take up to 5 minutes to initialize. Once the interface loads, queue the workflow to verify it runs successfully. Then, from the Workflow menu in the top-left, select Export (API) to download the workflow_api.json file, a streamlined version optimized for API use, including node types, inputs, and connections. The exported file will be similar to flux_workflow_api.json. Here you can learn more about workflow_api.json Alt Export API in ComfyUI After exporting the workflow_api.json, start by reviewing it to identify which inputs you want to make dynamic, such as prompt text or noise seed. Since the file uses Node IDs as keys to reference nodes, you’ll need to match these IDs with the corresponding nodes in the ComfyUI interface. To make this easier, open the Settings panel (bottom-left), navigate to Lite Graph, and set Node ID Badge Mode to Show All to display the IDs directly on the UI. Alt Enable Node ID display in ComfyUI Alt Node ID in ComfyUI For API requests, RunComfy automatically uses the workflow_api.json as the base, so you only need to send an overrides object to customize specific inputs, keeping requests lightweight. Overrides use node IDs from the workflow_api.json to target and update inputs, formatted with node IDs as keys and {"inputs": {key: value}}. For this workflow, begin with the example below. For details, please see Submitting a Request. Alt Example API Overrides JSON
{
  "overrides": {
    "6": {
      "inputs": {
        "text": "Your custom prompt here"
      }
    },
    "25": {
      "inputs": {
        "noise_seed": 123456789
      }
    }
  }
}

Step 2: Deploy Workflow as API

Go to the Deployments page and select Deploy workflow as API. Search for the workflow by its name (RunComfy/FLUX) or ID (00000000-0000-0000-0000-000000001111). For a quick setup, choose Instant Deploy, which uses default settings like 48GB hardware (A6000) and autoscaling. These settings can be adjusted later if needed. After the deployment is complete, copy the deployment_id — you’ll need it when making API calls.

Step 3: Authenticate

Click your profile icon (upper-right corner of the RunComfy page) to access the Profile page and find your API key. Include it in every request via the Authorization: Bearer <your-api-key> header. This secures your calls and helps track usage.

Step 4: Submit a Request

Now it’s time to run your deployed workflow. Send a POST request to the inference endpoint, replacing {deployment_id} with your actual deployment ID. In the request body, include the overrides you prepared in Step 1 under the overrides field. RunComfy will automatically load the stored workflow_api.json for the deployment and apply your overrides on top, customizing specific inputs while using defaults for the rest.
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": {
      "6": {
        "inputs": {
          "text": "Your custom prompt here"
        }
      },
      "25": {
        "inputs": {
          "noise_seed": 123456789
        }
      }
    }
  }'
Expected response:
{
  "request_id": "{request_id}",
  "status_url": "https://api.runcomfy.net/prod/v1/deployments/{deployment_id}/requests/{request_id}/status",
  "result_url": "https://api.runcomfy.net/prod/v1/deployments/{deployment_id}/requests/{request_id}/result",
  "cancel_url": "https://api.runcomfy.net/prod/v1/deployments/{deployment_id}/requests/{request_id}/cancel"
}

Image/Video Upload

If your workflow’s inputs include an image or video that needs to be uploaded, you can include the media in the overrides object by specifying either a public URL or a Base64 data URI. Refer to the example below (adjust the node ID to match your workflow’s API JSON).

Using Public 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"
        }
      }
    }
  }'

Using 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..."
        }
      }
    }
  }'
For complete formatting details, see the Async Queue Endpoints - Image/Video Upload section.

Step 5: Monitor and Retrieve Results

After submitting a request, you can track its progress and fetch the outputs once it’s ready. To monitor the job, poll the status_url at regular intervals until the status changes to "completed". When the job is complete, use the result_url to retrieve the final outputs. Check Request Status:
curl --request GET \
  --url https://api.runcomfy.net/prod/v1/deployments/{deployment_id}/requests/{request_id}/status \
  --header "Authorization: Bearer <token>"
Example response:
{
  "status": "in_queue",
  "queue_position": 0,
  "result_url": "https://api.runcomfy.net/prod/v1/deployments/{deployment_id}/requests/{request_id}/result"
}
Retrieve Request Results:
curl --request GET \
  --url https://api.runcomfy.net/prod/v1/deployments/{deployment_id}/requests/{request_id}/result \
  --header "Authorization: Bearer <token>"
Example response:
{
  "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"
}
🎉 Congratulations! You’ve successfully deployed and called your first API. Your ComfyUI workflow is now live and ready to power real applications!