--output {pretty,json}, -q/--quiet, -v/--verbose, and all except login / logout require authentication (Authentication).
Aliases:
runcomfy requests get ≡ runcomfy status, runcomfy requests result ≡ runcomfy result, runcomfy requests cancel ≡ runcomfy cancel.
For exit-code semantics across all commands, see Troubleshooting → Exit codes.
login
Authenticate the CLI with RunComfy via the device-code OAuth flow.
-
Calls
POST {web_base}/api/cli-auth/start, receives a short user code and a verification URL. -
Prints the code in the terminal:
- Opens the verification URL in your default browser.
-
Polls
POST {web_base}/api/cli-auth/pollevery 2 seconds. -
On
Authorize, saves the access token to~/.config/runcomfy/token.json(mode 0600). -
Ctrl-Caborts the wait cleanly.
In CI or any non-interactive environment, set
RUNCOMFY_TOKEN=<token> and skip runcomfy login entirely.
logout
whoami
Show the currently authenticated user.
--output json mode the same data goes to stdout as a single line, useful for scripts:
GET https://www.runcomfy.com/api/auth/me.
balance
Show the account’s remaining balance. One wallet funds every product — Model API requests, Serverless deployments, and training jobs all draw it down.
--output json returns the raw record, including balance_microdollars for exact threshold checks:
GET /prod/v2/balance.
models
Browse the hosted catalog that run executes — find a model_id, then read its Input schema before building a request.
models list
--output json mode the raw catalog payload comes back, including inputs, required_inputs, base_price_usd, and model_url. Backs GET /v1/models.
models categories
models list --category. Backs GET /v1/models/categories.
models get
input_schema — property types, defaults, enums, and ranges. Read this instead of guessing parameter names for run --input. Properties whose format is image_uri / video_uri / audio_uri take a public HTTPS URL.
Backs GET /v1/models/{model_id}.
run
Run a Model API model end-to-end: submit, poll, fetch the result, download generated files.
<model_id> is the slash-separated identifier from the Models catalog (e.g. blackforestlabs/flux-1-kontext/pro/edit, openai/gpt-image-2/text-to-image).
Examples
End-to-end output
[tag] text if not a TTY / NO_COLOR is set).
Behavior details
- Submit:
POST https://model-api.runcomfy.net/v1/models/<model_id>with the JSON body as-is (Model API expects flat input, not{"input":{...}}). - Poll:
GET .../requests/<id>/statusevery--poll-secsseconds. - Fetch: on terminal status (
completed/succeeded/failed/cancelled),GET .../requests/<id>/result. - Download whitelist: the CLI scans the result JSON recursively and downloads every URL whose host ends with
.runcomfy.netor.runcomfy.com. URLs outside that whitelist are listed but not fetched — preventing a compromised upstream model from coercing the CLI into pulling arbitrary internet content. Downloads stream to disk and abort withunlink(2)if the response exceeds 2 GiB. - Ctrl-C: while polling, sends
POST .../requests/<id>/cancelto RunComfy before exiting. If the cancel call itself fails, the CLI prints the request_id and tells you to retry withruncomfy cancel <id>— so you don’t get billed for GPU you thought was stopped.
status
Poll the status of a Model API request submitted via runcomfy run --no-wait.
queue: position N.
The CLI doesn’t loop — it returns the current snapshot and exits. Wrap in your own
while loop for repeated checks. Backs GET .../requests/<id>/status.
result
Fetch the result record of a request submitted with run --no-wait, and download its files.
run, this never submits anything — it reads an existing request. Calling it before the request finishes prints the current record and exits 0; a failed or cancelled request exits non-zero. Alias: runcomfy requests result. Backs GET /v1/requests/{id}/result.
cancel
Cancel a queued or running Model API request.
--output json mode, the response includes an outcome field (cancelled or not_cancellable).
runcomfy run (without --no-wait) auto-cancels on Ctrl-C, so you only need cancel directly when you submitted with --no-wait, the auto-cancel failed, or you’re cancelling someone else’s request_id. Backs POST .../requests/<id>/cancel (returns 202 Accepted).
deployments
Manage Serverless API (ComfyUI) deployments and run inference on them. Unlike run, which uses hosted catalog models, these run your own cloud-saved ComfyUI workflows on hardware you choose.
deployments list and deployments get
--include-payload adds workflow_api_json — use it to discover the node IDs and input names that deployments run --overrides targets. Backs GET /prod/v2/deployments[/{id}].
deployments create
For LoRA deployments, create via the RunComfy UI (Trainer → LoRA Assets → Deploy), then use
deployments list to get the id. Backs POST /prod/v2/deployments.
deployments update
Only the flags you pass are changed.
--disable pauses the deployment (instances shut down, billing stops, configuration is preserved); --enable resumes it. Backs PATCH /prod/v2/deployments/{id}.
deployments delete
64 unless --yes is given. Consider deployments update <id> --disable to pause instead. Backs DELETE /prod/v2/deployments/{id}.
deployments run
Submit an inference request and, by default, wait for it.
One of
--overrides, --overrides-file or --workflow-file is required — the API rejects an empty body.
data: URI directly in the override value. Ctrl-C while waiting cancels the remote request. Backs POST /prod/v2/deployments/{id}/inference.
deployments status, result and cancel
status also prints instance_id once an instance is running your job — that’s what deployments proxy needs. Output URLs from result are hosted for 7 days. A cancel that the API has only accepted reports Cancellation requested; poll status to confirm it reaches canceled.
deployments proxy
Call a ComfyUI backend endpoint on a live instance.
POST /prod/v2/deployments/{id}/instances/{instance_id}/proxy/{path}.
datasets
Manage LoRA training datasets. A dataset must reach READY before a training job can mount it.
datasets create, list, status and delete
folder_path. status shows the lifecycle — DRAFT → UPLOADING → READY (or FAILED) — plus the files that uploaded successfully.
datasets upload
.txt with the same base name — img_0001.jpg pairs with img_0001.txt.
--wait polls until READY (or FAILED, which exits non-zero). Ctrl-C while waiting stops watching; the uploads are already done.
train
Submit and manage AI Toolkit training jobs — typically LoRA training.
train submit
Two paths in the config are fixed by the platform:
{dataset_name} is the dataset’s name from datasets list.
Training runs for hours, so the command returns as soon as the job is queued unless you pass --wait. With --wait, Ctrl-C stops watching but does not cancel the job.
train status and train result
IN_QUEUE → RUNNING → STOPPED (finished or preempted), FAILED, or CANCELED. status prints step progress:
result lists checkpoints, the resolved config, and samples as hosted URLs. It is safe to call while the job is still RUNNING — the artifact list grows over time — and after a FAILED or CANCELED job to recover whatever was produced. Downloads are opt-in via --download because checkpoints are large.
A checkpoint URL can be fed straight back to run without deploying anything:
path is either a name from your LoRA Assets or a public URL.
train cancel, resume and edit
cancel stops progress; artifacts produced so far stay available through train result. resume restarts from the highest-step checkpoint under the same job_id (from step 0 if none exists) — useful after a preemption. edit replaces the config of a STOPPED / CANCELED / FAILED job, after which resume re-queues it; config.name must still match the original job’s name.