adtestbench Higgsfield
EN

Run a ComfyUI workflow as an API on Runpod Serverless

By Alexandre S. Published Last checked

Runpod Serverless runs a ComfyUI workflow as an API and bills each worker by the second, from start to stop. On our own account, on 3 December 2026, a warm 1024 by 1024 FLUX.1-dev image took 12.7 seconds. At the Serverless rate of $1.34 an hour, that is about $0.005 an image.

An API here is a web address for a ComfyUI workflow. A script sends the workflow, a rented graphics card runs it, and the image comes back. A warm batch of 100 costs about $0.47.

Six steps from a ComfyUI workflow to a Runpod Serverless API, with the settings on our endpoint
Step What you do Our setting
1. Deploy Create an endpoint from the ComfyUI worker on the Runpod Hub Worker 5.11.0 with FLUX.1-dev fp8
2. Export Save the workflow in API format Workflow, then Export (API)
3. Send Post the workflow with your API key /run, then /status
4. Read Decode the image from the reply base64 under output.images
5. Extend Add your own models or custom nodes The shipped FLUX model only
6. Cut cost Set workers and idle time 0 active, 1 max, 5-second idle, FlashBoot on

Scroll sideways for all 3 columns

Visit Runpod $0.01 per image at list price · checked

What Runpod Serverless runs, in plain words

Runpod Serverless rents graphics cards that start when a job arrives and stop when the queue is empty. The endpoint is the web address your jobs go to; a worker is one card running ComfyUI behind it. A cold start is a fresh worker booting and loading the model. It bills too.

ComfyUI already takes API calls on your own computer: its server queues any workflow posted to /prompt (ComfyUI server routes). Runpod’s worker-comfyui project puts that server behind Runpod’s queue.

A creator turns a ComfyUI workflow into a Runpod Serverless API that scales to zero when idle Video: How to Scale ComfyUI with $0 Idle Cost, Renato Dinis | Build With AI on YouTube, .

How to run a ComfyUI workflow as an API, step by step

  1. Deploy the ComfyUI worker from the Runpod Hub. Open Hub in the Runpod console, pick the ComfyUI worker and click Deploy. Runpod’s tutorial says this listing comes with FLUX.1-dev fp8 installed. Then set the GPU class, worker counts, idle timeout and FlashBoot in the endpoint’s settings. Ours ran on the 24 GB 4090 PRO class.
Runpod Hub page for the ComfyUI worker showing the FLUX.1-dev fp8 description, a Deploy button and repository details
The Runpod Hub listing for the ComfyUI worker (FLUX.1-dev fp8) with its Deploy button, 3 December 2026 Runpod Hub listing for worker-comfyui, captured
  1. Export the workflow in API format. Run the workflow once in ComfyUI, on a pod or your own computer, then choose Workflow, then Export (API). The workflow.json file it saves numbers every node. In the tutorial’s FLUX workflow, node 6 holds the prompt in its text field: the field a script changes for each new image.

  2. Send the workflow with your API key. Create a key in the console’s settings, under API Keys. Save the exported nodes inside an input object, as {"input": {"workflow": {...}}}, in a file such as request.json, then post it:

curl -X POST "https://api.runpod.ai/v2/ENDPOINT_ID/run" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d @request.json

/run answers at once with a job ID; poll /status/JOB_ID until it reads COMPLETED. /runsync waits and returns the image itself. Runpod keeps a /run result for 30 minutes and a /runsync result for 1 minute (endpoint settings).

Deploy ComfyUI on Serverless

Goal Learn how to deploy a Serverless endpoint running ComfyUI from the Runpod Hub and use it to generate images with FLUX Dev.

Model The ComfyUI Hub listing comes with the FLUX.1-dev-fp8 model pre-installed

Status Continue polling the status endpoint until the status changes to COMPLETED.

Runpod’s tutorial says what the Hub listing ships with and how to read a finished job, read 3 December 2026. Runpod, Runpod docs: deploy ComfyUI on Serverless,
  1. Read the result. A finished job returns a list under output.images, each item with a type and data. By default the type is base64, the image written out as text that you decode into a PNG file. With an S3 storage bucket set in the worker’s settings, it is s3_url and a link (worker README). Runpod’s tutorial still shows the older output.message field from before version 5.0.0. The reply also gives delayTime, the queue wait, and executionTime, the run, in milliseconds.

worker-comfyui

What it is This project allows you to run ComfyUI workflows as a serverless API endpoint on the RunPod platform.

/runsync Use the /runsync endpoint for synchronous requests that wait for the job to complete and return the result directly.

Output By default, images are returned as base64 strings.

Your workflow In ComfyUI, select Workflow > Export (API).

Runpod’s worker-comfyui project states what it does and how results come back, read 3 December 2026. Runpod, worker-comfyui README on GitHub,
  1. Add your own models or custom nodes. Models can sit on a network volume, a separate rented disk the worker reads under /runpod-volume/models/. Custom nodes need your own image: a Dockerfile that starts from the worker’s base image (worker customisation guide). A network volume ties the endpoint to the volume’s data centre, which leaves fewer free cards.

  2. Cut the cost. Four settings decide the bill (Serverless pricing):

  • Active workers run around the clock and bill with or without jobs. At 0, the endpoint costs nothing between jobs.
  • The idle timeout keeps a worker up, and billing, after a job in case another arrives: 5 seconds by default.
  • Max workers caps how many cards run at once, “a cost safety limit” in Runpod’s words.
  • FlashBoot, on by default in the console, restarts a stopped worker faster, so fewer start seconds bill: 1.1 seconds against 10.5 on our endpoint.
Watch out An endpoint with no requests for 3 days drops to 2 max workers, and after 7 days to 0. At 0, no job runs until you raise max workers again in the console (endpoint settings).

What one image costs on Runpod Serverless, computed from our timings

These jobs ran on our own endpoint on 3 December 2026, each making one 1024 by 1024 FLUX.1-dev fp8 image at 20 steps. Each cost in the table applies the published rate to the timed seconds.

Runpod’s bill for that endpoint, posted later the same day, matches the rate. It counts 104.3 seconds of GPU time for the five images we sent and charges $0.039. That is about $0.008 an image with one cold start included.

Runpod bills a worker from start until it fully stops, “rounded up to the nearest second”, cold start and idle timeout included (Serverless pricing). The warm row and the batch row leave out the 5-second idle, which bills once at the end of a run of jobs.

Cost of one FLUX.1-dev image on Runpod Serverless, 24 GB 4090 PRO worker, 3 Dec 2026
Job Seconds counted Cost
First image on a cold endpoint: 10.5 s start, 26.1 s run with model loading, 5 s idle 41.6 $0.015
Each next image while the worker is up 12.7 $0.005
First image after a minute idle, back through FlashBoot: 1.1 s start, 12.7 s run, 5 s idle 18.8 $0.007
100 images in one warm batch 1,270 $0.473

Scroll sideways for all 3 columns

Method Cost = seconds counted, divided by 3,600, times the published flex rate of $1.34 an hour (Runpod pricing). Seconds counted = the timed start and run, plus the 5-second idle where a job ends a run. Runpod’s rounding up to the next second adds under a tenth of a cent a run.
Runpod GPU Cloud pricing page, Serverless flex worker rates per hour: 5090 PRO 32 GB at 1.89 US dollars, 4090 PRO 24 GB at 1.34, L4 and 3090 class 24 GB at 0.75, H100 PRO at 5.89
Runpod’s Serverless worker rates per hour by GPU class, 3 December 2026 Runpod Serverless flex worker pricing, captured

The first image of a session costs about three times a warm one, because it pays for the start and the model load. After a minute idle, FlashBoot had the worker back in 1.1 seconds, against 10.5 for the first start.

Runpod’s ready-made FLUX.1 [dev] Public Endpoint charges $0.02 a megapixel, about $0.021 for a 1024 by 1024 image, with nothing to deploy. That suits a plain prompt.

A warm image on our worker costs under a quarter of that. The worker also runs your own nodes and LoRAs, small add-on files that teach a model a face or a style.

Serverless or a pod: which costs less?

A Secure Cloud RTX 4090 pod lists at $0.89 an hour, against $1.34 for the Serverless worker (Runpod pricing). The pod bills every second it is switched on, idle time included.

At the same speed per image, the pod costs less once it is busy more than two-thirds of the time it is on. That line is 0.89 divided by 1.34, or 0.66. Left on for an eight-hour working day, it costs $7.12 whether it makes ten images or two thousand.

Serverless wins on bursts. Spread 200 images across a day so that each one wakes the worker through FlashBoot, and they cost about $1.40.

A pod wins on steady all-day load, and on editing: an endpoint takes finished workflows and shows no ComfyUI canvas. Build and test on a pod first, as our ComfyUI on Runpod guide shows.

Every rate sits on our Runpod pricing page. For a monthly plan with no setup, Comfy Cloud vs Runpod sets Comfy Cloud’s plans against Runpod’s per-second bill.

Batch 100 product backgrounds from a spreadsheet

Say you need 100 backgrounds for one product shot, one prompt per row of a sheet. A short script reads each row, writes the prompt into node 6’s text field and posts one job to /run.

Sent back to back, the 100 jobs keep the worker warm and cost about $0.47 at our timings. Starting cold adds about a cent. One worker takes about 21 minutes. More workers finish sooner, and each pays its own cold start.

Without code, a Zapier Zap can post each new sheet row to the endpoint through Zapier’s webhooks, which start on its Professional plan (Zapier pricing). Each post is one successful action, and Zapier bills each one as a task (Zapier task usage). A webhook address in the request tells Runpod where to send the finished job.

Video takes minutes a clip, which changes the maths: rent a GPU or pay for an AI video subscription works it through. Hosted video APIs sit on open source video model API prices.

The Runpod sign-up credit

A new account made with Google through a referral link that loads at least $10 gets a one-time credit of $5 to $500 (Runpod referral docs). Most get $5, about 96 per cent get $10 or less, and Europe a flat $5.

At our warm rate, $5 covers about a thousand FLUX images. Our Runpod referral code page has the steps, and the Runpod hub lists every Runpod guide.

Checked every hour: our link opens Runpod with the referral code wi6rwjdp still attached. Last passing check .

Visit Runpod $0.01 per image at list price · checked

Questions about the ComfyUI API on Runpod

How much does Runpod Serverless cost?

Each worker bills by the second at its card’s hourly rate: $1.34 an hour for the 24 GB 4090 PRO class. ComfyUI and its own API are free. On our endpoint, a warm FLUX.1-dev image comes to about $0.005.

What is the difference between /run and /runsync?

/run returns a job ID at once and keeps the result for 30 minutes. /runsync waits for the image and keeps it for 1 minute.

Does Runpod Serverless charge when no job is running?

Only for the idle timeout, 5 seconds by default after a job. Then the worker scales down, shows as Idle and is not billed. Active workers and network volumes keep billing.

Sources

  1. Runpod on GitHub: worker-comfyui, ComfyUI workflows as a serverless API endpoint; images back as base64 strings or S3 URLs; output list under output.images since 5.0.0; /run and /runsync; request limits 10 MB on /run and 20 MB on /runsync; Workflow > Export (API); a webhook field in the request. Checked
  2. Runpod on GitHub: worker-comfyui customization guide, Custom Dockerfile from a base image for custom nodes and models; network volume mounted at /runpod-volume with models under /runpod-volume/models/; a network volume is not suitable for installing custom nodes. Checked
  3. Runpod docs: Deploy ComfyUI on Serverless, Hub listing deploys with FLUX.1-dev-fp8 pre-installed; node 6 holds the prompt text; delayTime and executionTime in milliseconds; poll /status until COMPLETED. Checked
  4. Runpod docs: Serverless pricing, Billed from when a worker starts until it fully stops, rounded up to the nearest second; cold start billed, model loading included; idle timeout default 5 seconds; a scaled-down worker is not billed; flex workers at the standard per-second rate, active workers always running with discounts through sales. Checked
  5. Runpod docs: Endpoint settings, Console defaults: 0 active workers, 3 max workers, 5-second idle timeout, FlashBoot on; max workers a cost safety limit; results kept 30 minutes on /run and 1 minute on /runsync; an endpoint idle for 3 days drops to 2 max workers, idle for 7 days to 0; a network volume restricts the endpoint to the volume’s data centre. Checked
  6. Runpod: Runpod pricing, Serverless 24 GB 4090 PRO at 1.34 dollars an hour; RTX 4090 pod at 0.89 dollars an hour; FLUX.1 [dev] Public Endpoint at 0.02 dollars per megapixel. Checked
  7. Runpod console: Our own Runpod account, Serverless endpoint runs and billing of 3 December 2026, worker-comfyui 5.11.0 from the Runpod Hub, 24 GB 4090 PRO class, 0 active and 1 max worker, 5-second idle timeout, FlashBoot on; five FLUX.1-dev fp8 1024 x 1024 images at 20 steps: cold start 10.5 s queue and 26.1 s run, warm runs 12.7 s, FlashBoot restart 1.1 s queue and 12.7 s run; Runpod’s Serverless billing for the endpoint that day: 104.3 seconds billed, 0.0388 dollars. Checked
  8. ComfyUI docs: ComfyUI server routes, A workflow posted to /prompt is validated and added to the execution queue. Checked
  9. Zapier help centre: How is task usage measured in Zapier?, A task is any successful action that runs in Zapier; Zap triggers never use tasks; an action step uses 1 task per successful run. Checked
  10. Runpod docs: Referral, affiliate, and creator programs, A new user who signs up with Google through a referral link and loads at least 10 dollars gets a one-time credit of 5 to 500 dollars; most get 5, about 96 per cent get 10 or less, European customers a flat 5. Checked
Portrait of Alexandre S.

Alexandre S.

Alexandre S. is a creative ad strategist and copywriter with ten years' experience in digital marketing across multiple channels.