
How to run MiniMax H3-Image on Runpod with ComfyUI
MiniMax H3-Image generates and edits images at around 16 megapixels from one open-weight checkpoint. Here's how to run it on a single 80 GB Runpod GPU with ComfyUI.
Blog
Measure worker wait time, model loading and request execution separately to find the bottleneck before choosing a GPU.

A slow Serverless endpoint may spend more time waiting for workers or loading weights than executing on the GPU. This guide helps developers separate those delays, benchmark cold and warm requests, tune worker settings and choose GPUs by measured latency and cost per unit before production.
A Serverless endpoint reports two timings per job. delayTime covers queueing and cold start, including model loading; executionTime covers only the handler. Measure both across at least 20 requests, force cold trials by scaling max workers to zero, then pick a GPU by cost per million output tokens rather than hourly price.
For Qwen2.5-7B-Instruct, the H100 SXM cost 4.4 times as much per hour as an RTX 4090 and generated tokens about 2.7 times faster, yet both delivered equal throughput up to 4 requests/second. In our cost model, an always-on RTX 4090 cost about $980/month, compared with $24/month for flex workers handling 20 short sessions/day with a 5-second idle timeout.
Use delayTime and executionTime to identify bottlenecks; repeat the included harness with your model and traffic. Our Serverless tests used 16 endpoints across RTX 4090, L40S, H100 SXM and fallbacks, costing $11.66 excluding network-volume storage. Pod figures come from Runpod benchmarks; every Serverless figure comes from our own tests for this post.
A request waits for a worker, loads weights if needed and then executes. GPU choice directly affects execution time, while storage affects loading time. On an RTX 4090 with the same 7B model, a network volume cut median cold start from 98 to 68 seconds.
Animated diagram: a request to a Serverless endpoint can pass through three clocks. It waits for a worker, the worker loads the model, then the GPU runs the request. delayTime covers the first two clocks and executionTime covers the third. On a cold first start all three run; on a FlashBoot resume the first two are short; on a warm worker only the third runs. Only the third depends on GPU choice. Schematic, not to scale.
To identify the largest delay, send 20 requests and record delayTime and executionTime for each.
Every completed job on a queue-based endpoint reports both values in its /status response, in milliseconds.
delayTime covers queueing behind busy workers and cold starts, including model loading. Cold starts are billed; measure both latency and cost.
executionTime is the time your handler spends on the job, so it reflects the GPU, batching and your code.
Image pulls normally happen while workers are scaled down and are outside the billed cold start. If a worker starts before its image arrives, the pull becomes part of its billed cold start. Either way, it can affect delayTime, so evaluate image size using delayTime during scale-out as well as the cold start metric.
Animated diagram of a Serverless worker's lifecycle and when it is billed. While scaled down, Runpod pulls the image and caches the model, and the worker is not billed. When a request arrives the worker starts: the cold start, processing the request and waiting through the idle timeout are billed. When the idle timeout expires the worker scales down and billing stops. A longer idle timeout adds billed waiting time. delayTime covers the cold start and executionTime covers processing. Schematic, not to scale.
Report the two kinds of cold start separately, because they can differ by a factor of 100 or more.
The mix of resumes and first starts depends on traffic and how often workers go idle.
For LLMs, measure TTFT (time to first token), TPOT (time per output token) and output tokens/second. Gateway batching makes endpoint ITL (inter-token latency) read near zero. Compute TPOT = (end-to-end time − TTFT) / (output tokens − 1). Report the median, p90, worst case and sample size. With 20 requests, you can report a median and rough p90; p99 needs hundreds.
Five rules keep results comparable from run to run:
GET https://api.runpod.ai/v2/<endpoint_id>/health until all worker counts reach zero, restore max workers, then request. In our tests, REST v2 listed removed workers as IDLE for over 20 minutes; that day's hourly billing showed no charges for those minutes. The documentation defines API IDLE as running and billed, while console Idle means scaled down and unbilled. Verify cold starts using the checks above rather than the IDLE label alone.nvidia-smi or startup logs; settings show requested configuration. Stock vLLM cold-start logs show Starting to load model, download duration and init engine ... took before Jobs in progress. Still-running containers skip these lines.The polling harness below extends the docs' delayTime and executionTime example with a warm-up, client wall time, percentiles, error handling and forced-cold helpers:
import os, time, requests
ENDPOINT = os.environ["RUNPOD_ENDPOINT_ID"]
HEADERS = {"Authorization": f"Bearer {os.environ['RUNPOD_API_KEY']}"}
BASE = f"https://api.runpod.ai/v2/{ENDPOINT}"
DONE = ("COMPLETED", "FAILED", "CANCELLED", "TIMED_OUT")
def run_once(payload, poll_s=0.5, timeout_s=1800):
start = time.monotonic()
r = requests.post(f"{BASE}/run", headers=HEADERS, json={"input": payload}, timeout=30)
r.raise_for_status()
job_id = r.json()["id"]
while time.monotonic() - start < timeout_s:
s = requests.get(f"{BASE}/status/{job_id}", headers=HEADERS, timeout=30)
s.raise_for_status()
status = s.json()
if status["status"] in DONE:
status["clientMs"] = int((time.monotonic() - start) * 1000)
return status
time.sleep(poll_s)
return {"status": "CLIENT_TIMEOUT"}
def wait_until_no_workers(timeout_s=900):
deadline = time.monotonic() + timeout_s
while time.monotonic() < deadline:
h = requests.get(f"{BASE}/health", headers=HEADERS, timeout=30)
h.raise_for_status()
if not any(h.json().get("workers", {}).values()):
return
time.sleep(5)
raise TimeoutError("endpoint still has workers")
def pct(values, p):
values = sorted(values)
return values[min(len(values) - 1, round(p / 100 * (len(values) - 1)))]
def report(label, results):
ok = [r for r in results if r["status"] == "COMPLETED"]
print(f"{label}: n={len(ok)} failed={len(results) - len(ok)}")
if not ok:
return
for key in ("delayTime", "executionTime", "clientMs"):
vals = [r[key] for r in ok]
print(f" {key}: p50={pct(vals, 50)} p90={pct(vals, 90)} max={max(vals)} ms")
# Warm: one throwaway request wakes a worker, then 20 measured requests.
run_once({"prompt": "warm-up"})
warm = [run_once({"prompt": f"Test request {i}"}) for i in range(20)]
report("warm", warm)
# Cold, once per trial: set max workers to 0, call wait_until_no_workers(),
# restore max workers, then call run_once() and keep the result.clientMs adds gateway, polling and result-retrieval time on top of delayTime plus executionTime, and half-second polling can overstate latency by up to 0.5 seconds.
For LLMs, vllm bench serve measures TTFT, TPOT and throughput through the OpenAI-compatible route, and its Poisson arrivals approximate real traffic better than sequential requests do.
Warm the endpoint through /run first. The OpenAI route and /runsync time out at the edge after about 100 seconds and return HTTP 524 if the model is still loading, so use /run and /status for cold trials.
Install vLLM on the client or on a small CPU Pod, and make sure --model matches the served model:
export OPENAI_API_KEY=$RUNPOD_API_KEY
vllm bench serve \
--backend openai-chat \
--base-url https://api.runpod.ai/v2/$RUNPOD_ENDPOINT_ID/openai \
--endpoint /v1/chat/completions \
--model Qwen/Qwen2.5-7B-Instruct \
--dataset-name random --random-input-len 128 --random-output-len 128 \
--ignore-eos --request-rate 1 --num-prompts 180Steady requests measure warm behavior. For sporadic sessions dominated by cold starts, prioritize forced-cold trials.
Cross-check client measurements against the REST v2 metrics, which report request counts, cold start durations and delay and execution times for the last 90 days.
Start with the section that matches your largest delay.
Set max workers about 20% above peak concurrency. In nine bursts of five simultaneous 16-second jobs (RTX 4090, cap 5 workers, three bursts/scaler setting), up to five workers initialized together. With queue-delay scaling, the first one to three ready workers (90- to 160-second cold starts) drained the queue. Reducing queue delay from 4 seconds to 1 second did not improve these bursts. Setting request count to 1 spread jobs across 2-4 workers and gave the shortest slowest-request times, though three bursts per setting show only a tendency. Through the REST API, queue endpoints using request-count scaling do not accept an idle timeout. For fast bursts from zero, retain an active worker or warm ahead.
If regional GPU shortages leave workers Throttled in the console or API, list up to three GPU types in priority order. With five or more workers, Runpod spreads them across the listed types, mostly onto the first. Measure each fallback because performance and per-second prices can differ.
Network volumes restrict workers to their datacenter; include that GPU-supply constraint when diagnosing queueing.
Check these in order to reduce startup work before adding active workers:
FLASHBOOT on endpoints you create through the API.For a 7B model on RTX 4090, loading weights from a network volume took 12.9 seconds (median of 10 cold starts), compared with 2.1 seconds locally. The volume still reduced the full cold start from 98 to 68 seconds by skipping an 18.7-second download and reusing vLLM's compile cache. Larger weights make loading time more significant. For custom handlers, the Python SDK's VolumeCache restores files into the container at cold start, then syncs new files back:
from runpod.serverless import VolumeCache
with VolumeCache(dirs=["/root/.cache/huggingface"]):
model = load_model() # downloads land in the cached directoryStock vLLM runs vllm serve, so VolumeCache cannot wrap model loading. First starts load weights, measure memory, allocate KV cache, compile with torch.compile and capture CUDA graphs. Durations vary by model and GPU. One RTX 4090 start took about 37 seconds for imports and engine setup, 13.8 for downloading weights, 3.1 for loading them, 19.2 for torch.compile and 6 for CUDA graph capture. Check startup logs before changing settings:
delayTime.torch.compile caches live under /runpod-volume. Volumes retain compilation results, but downloaded weights load from the mount. Benchmark first starts with cached models and pre-loaded volumes in your region. Runpod favors volumes for large or latency-sensitive models.ENFORCE_EAGER=true to skip CUDA graph capture and torch.compile. Startup gets shorter and steady-state throughput drops, so measure both before you keep it.VLLM_ENABLE_STARTUP_PLAN=1 reuses KV cache budgets for the same model/GPU. Use 1 or 0, because true fails startup. Plans persist only as long as their adjacent compile cache. Delete the plan after changing GPU_MEMORY_UTILIZATION, which is excluded from the plan key.FlashBoot accelerates resumes, not first starts on new hosts. In our stock vLLM test on RTX 4090, we used a 5-second idle timeout and sent requests 7 minutes after the previous request completed. With FlashBoot, 3 of 8 requests started within a second, compared with 0 of 8 without it. All three used containers retained beyond the idle timeout; that day's hourly billing showed no charges for the extra time. Slow starts, including each endpoint's first, took 95-122 seconds versus 85-158 with FlashBoot off.
Active workers avoid cold starts and bill every running second. At November 18, 2026 rates ($1.34/hour), an always-on RTX 4090 costs about $980/month (730 hours). Budget standard rates unless sales-agreement discounts apply. Size with:
active workers = (requests per minute × request duration in seconds) / 60At six requests per minute and a measured executionTime of 30 seconds, the formula gives 3 active workers. This average-load floor excludes peaks. For fractional results under light traffic, round up to one for fast first responses; add headroom and flex workers for bursts.
A worker whose cold start runs past 7 minutes is marked unhealthy. For longer initialization, raise RUNPOD_INIT_TIMEOUT (to 800 seconds, for example). Raising vLLM's VLLM_STARTUP_TIMEOUT alone doesn't help, because the platform timeout fires first.
Check worker concurrency and memory settings before you test a different GPU.
Queue workers handle one job unless asynchronous handlers declare concurrency_modifier. vLLM's MAX_CONCURRENCY enables continuous batching across shared forward passes. On L40S at 4 requests per second, raising concurrency from 1 to 30 (the worker default) increased throughput from 37 to 498 output tokens per second and reduced p90 TTFT among completed requests from 513 to 4.7 seconds. At concurrency 1, 500 of 720 requests returned empty after about 9.5 minutes in the queue.
The KV cache holds attention state that grows with context length. Set MAX_MODEL_LEN to the context you need. If you encounter out-of-memory errors, try lowering GPU_MEMORY_UTILIZATION before replacing the GPU.
Choose a GPU in this order:
Qwen2.5-7B-Instruct has 28 layers, 4 KV heads and head dimension 128. At 16-bit precision:
KV cache bytes per token = 2 (K and V) × layers × KV heads × head dim × bytes per value
Qwen2.5-7B-Instruct: 2 × 28 × 4 × 128 × 2 = 57,344 bytes ≈ 56 KiB per tokenAn 8,192-token request needs about 448 MiB of KV cache, while weights need about 14.2 GiB. With the Runpod vLLM worker's default GPU_MEMORY_UTILIZATION of 0.95 and an assumed 3.5 GiB of overhead, a 24 GB card leaves about 5 GiB for 11 full-length requests; an 80 GB card leaves about 58 GiB for 130. These are derived estimates, and overhead varies: RTX 4090 startup logs reported capacity for 13 full-length requests. With short Serverless chats and a 5-second p90 TTFT target, one RTX 4090 sustained ~4 requests/second; H100 SXM handled 16, our highest tested rate, without saturation.
Animated diagram comparing GPU memory on a 24 GB card and an 80 GB card serving Qwen2.5-7B-Instruct in BF16 on vLLM. Each card holds the same 14.2 GiB of weights and about 3.5 GiB of runtime overhead, and keeps 5% of memory unused. The rest holds KV cache, filled one request slot at a time. With 8,192-token requests, the 24 GB card fills at about 11 requests and the 80 GB card at about 130. With 4,096-token requests, about 23 and about 270. Derived arithmetic, not measured.
That more than tenfold difference in estimated concurrency is why cost per unit matters:
cost per unit = (price per hour / 3600) × billed seconds / units completedFor an LLM the unit is usually a million output tokens. For image generation it's images, and for a document pipeline it's documents.
Billed time includes cold starts, requests and the idle timeout after the last request: 5 seconds by default in the console and 10 through the REST API. Image pulls and cached-model downloads normally happen before startup and are unbilled, as are scaled-down workers. Measure realistic bursts and quiet periods, not just steady load.
Utilization affects unit cost as much as GPU choice. Runpod's automated benchmark service rents Pods through the customer workflow and load-tests open models. For Qwen2.5-14B-Instruct FP8 on A40, with 128-token inputs and outputs, increasing traffic from 1 to 4 requests per second raised throughput from 114 to 454 output tokens per second. At the $0.59/hour Secure Pod price, cost fell from $1.44 to $0.36 per million output tokens. That fourfold change came from utilization alone. Four requests/second was the highest meeting 1-second TTFT and 50 ms/output-token targets. Source: Runpod benchmarks, run July and August 2026, on one Secure Cloud A40 with vLLM 0.20.2rc1 (converting weights to FP8 at load) and vllm bench serve sending Poisson arrivals. Two runs, on July 25 and August 5, produced the same figures. Price as of November 18, 2026.
For Qwen3.8-27B, the service tested single-GPU Pods with real-conversation chats (replies ≤256 tokens), the same latency target and each card's best tested engine/precision. Source: Runpod benchmarks, run November 13-17, 2026, one run per setup, at Secure on-demand Pod list prices as of November 18, 2026 (the RTX PRO 4500 price is from Runpod's GPU catalog API):
| GPU | Weights | Engine | Pod price per hour | Requests per second within target | Cost per 1M output tokens |
|---|---|---|---|---|---|
| RTX PRO 4500 Blackwell | NVFP4 | vLLM 0.33 | $0.72 | 2.5 | $0.39 |
| B200 | FP8 | vLLM 0.30, multi-token prediction | $7.99 | 24 | $0.42 |
| H200 SXM | FP8 | SGLang 0.5.23 | $5.29 | 16 | $0.43 |
| RTX PRO 6000 Blackwell Server Edition | NVFP4 | vLLM 0.30 | $2.69 | 8 | $0.44 |
| RTX 5090 | NVFP4 | vLLM 0.30 | $1.39 | 4 | $0.44 |
| H100 SXM | FP8 | SGLang 0.5.23 | $4.39 | 12 | $0.47 |
B200 costs 11 times as much per hour as RTX PRO 4500, yet its per-token cost is within 10% of that card's because it handles nearly 10 times the traffic. Repeat variation is a few percent; treat these six as tied. L40S and RTX 6000 Ada sustained ≤1 request/second within target, costing ~$1.65/million, about four times the leaders.
Capacity still differs by card: about 24 requests per second on B200 versus about 4 on RTX 5090. Since Serverless scales by adding workers, a smaller card can be a good starting point if its per-request latency meets your target.
These results need a few qualifications. NVFP4 uses 4-bit weights, and these tests measure speed rather than answer quality, so check output quality on your own prompts. Performance also varies by precision: on B200, NVFP4 cost $0.61 per million output tokens versus $0.42 for FP8. Qwen3.8-27B is a reasoning model, so throughput counts generated tokens, not delivered answers.
The Pod load generators ran on the same Pod, so these results exclude network time. Serverless rates are higher: on November 18, 2026, H100 SXM cost $4.39/hour as a Pod and $5.89/hour on Serverless, which also bills cold starts and idle time. Treat the Pod unit costs as a floor. Rescaling to Serverless rates puts the six leaders within about 12%, at $0.56-0.63 per million output tokens before cold starts and idle time. These rescaled figures are derived, not measured.
The table below measures Serverless throughput directly. It's also a steady-load best case: Qwen2.5-7B-Instruct, the model used throughout this guide, served short chat requests (128 tokens in, 128 out) at 4 requests per second, one worker per card, with Serverless prices as of November 18, 2026. These are our own tests, run November 18, 2026 on Runpod's vLLM worker v2.31.0 (vLLM 0.33.0) in Secure Cloud, with the load client outside Runpod. Serverless sells GPUs in tiers, so we pinned each endpoint to the named card by excluding the tier's other GPUs. Cost per million is derived from those prices and the measured throughput. Prices change, so check the current rates on the pricing page.
| GPU | VRAM | Serverless price per hour | Output tok/s at 4 req/s | Cost per 1M output tokens |
|---|---|---|---|---|
| RTX 4090 | 24 GB | $1.34 | 499 | $0.75 |
| L40S | 48 GB | $1.89 | 498 | $1.05 |
| H100 SXM | 80 GB | $5.89 | 490 | $3.34 |
Cost per million output tokens is derived from the hourly price and measured throughput.
At 4 requests/second, traffic limited all three cards equally, so unit cost tracked hourly price. At 16 requests/second, H100 reached 1,888 tokens/second at $0.87/million, about 16% above the RTX 4090's $0.75/million at 4 requests/second, its highest rate within the 5-second p90 TTFT target. The RTX 4090 reached its limit near 900 tokens/second ($0.41/million at 8 requests/second, but with a 14-second p90 TTFT) and rejected requests at higher loads. Per token, the H100 was about 2.7 times faster: 6.6 ms per output token against 18.1 ms on the RTX 4090 at 4 requests/second.
Choose the deployment model for your traffic pattern, too. At high, steady utilization, a dedicated Pod can cost less per token, and Pods or Serverless? A decision framework for persistent inference APIs works through that break-even.
Tokenization, image decoding, PDF rendering and audio resampling can bottleneck CPUs. During warm load, low nvidia-smi utilization with queued requests suggests CPU constraints: try more vCPUs (catalog minimums) or a CPU preprocessing endpoint. Across ~7,700 Runpod benchmark Pod runs (analyzed November 2026, comparing runs of the same GPU, model, engine setup and workload), AMD/Intel single-user speed differed by no more than about 3%; throughput differences couldn't be separated from datacenter effects.
Start development on the cheapest GPU that fits the model with headroom. Follow Runpod's Pod-first workflow: iterate on a Pod, then deploy the same image to Serverless. Zero minimum workers and a short idle timeout avoid running-worker charges between sessions.
Use a lower-cost GPU to test:
Retest these on the production GPU:
Set production targets first: p90 delayTime, p90 executionTime or TTFT, the worst-case cold start you can tolerate and cost per unit.
Validate one GPU type first, then test the production fallbacks. Use Poisson arrivals at expected peak traffic and twice that rate. Test first starts on brand-new endpoints separately from resumes, and deploy and warm endpoints ahead of launches or demos.
Size active workers from measured executionTime, and choose an idle timeout that covers the gaps between requests. In our RTX 4090 cost model, with FlashBoot off as a worst case, raising the timeout from 5 to 60 seconds reduced the share of requests waiting on cold starts from about half to under 1%. For business-hours traffic with hourly bursts, that added about 1% to cost. In the same cost model, for sporadic sessions an hour or more apart, a 300-second idle timeout more than tripled monthly cost without preventing most cold starts. On RTX 4090, 300 seconds of billed idle time adds about 11 cents. Enable FlashBoot and configure fallbacks.
Use this checklist for every benchmark run:
delayTime, executionTime, client wall time and TTFT, with the sample size for each.Start with these changes to reduce avoidable latency and cost:
MAX_MODEL_LEN.These settings can reduce latency but increase billed worker time or change GPU costs:
Upgrade only when measurements on the production GPU show that execution time is the bottleneck.
Each of these gaps has a test you can run on your own endpoint:
ENFORCE_EAGER=true, but did not test throughput or outputs. Before keeping that setting or lowering GPU_MEMORY_UTILIZATION, compare both configurations with a fixed prompt set. Keep those prompts as regression tests.Results vary with datacenter, host and time of day.
A worker can be ready in about a second or take several minutes, depending on whether it resumes or starts fresh. In our tests with Qwen2.5-7B-Instruct on an RTX 4090, FlashBoot resumed 3 of 8 requests on a still-running container, and those started within about a second. Full cold starts took a median of 68 seconds with weights on a network volume and 98 seconds when the worker downloaded them. Measured at the client, first starts on brand-new endpoints took 110 to 187 seconds on RTX 4090, 450 on L40S and 591 on H100 SXM.
Set max workers to 0, poll the endpoint's /health route until every worker count reaches zero, then restore max workers and send the request. Waiting out the idle timeout isn't enough, because FlashBoot can keep a stopped worker's container. Confirm each trial in the worker's startup log: a real cold start shows the model loading before the job runs.
Start with a 24 GB card. Qwen2.5-7B-Instruct needs about 14.2 GiB for 16-bit weights, which leaves about 5 GiB on a 24 GB card for the KV cache. In our tests, one RTX 4090 sustained about 4 requests per second within a 5-second p90 time to first token (TTFT) at $0.75 per million output tokens, while an H100 SXM handled 16 requests per second at $0.87. Move up when one worker can't meet your latency target or you want fewer workers at peak.
Serverless bills each worker by the second for its cold start, its requests and the idle timeout after the last one. As of November 18, 2026, an RTX 4090 cost $1.34 an hour, the 48 GB tier (L40, L40S and RTX 6000 Ada) $1.89 and an H100 SXM $5.89. Check the pricing page for current rates.
Runpod Serverless runs your container as an autoscaling endpoint that scales to zero and bills by the second.
Blog Posts