--output {pretty,json}, -q/--quiet, -v/--verbose, and all except login / logout require authentication (Authentication).
Aliases: runcomfy requests get ≡ runcomfy status, 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.
| Flag | Description |
|---|---|
--web-base <URL> | Override the auth host (default https://www.runcomfy.com). Useful for staging / preview environments. Also reads RUNCOMFY_WEB_BASE. |
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.
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).
| Flag | Default | Description |
|---|---|---|
--input '<JSON>' | — | Inline JSON payload matching the model’s Input schema |
--input-file <PATH> | — | Read JSON input from a file. Use - for stdin. Mutually exclusive with --input. |
--no-wait | false | Submit and return the request_id immediately; don’t poll |
--poll-secs <N> | 2 | Polling interval in seconds while waiting |
--output-dir <DIR> | . | Where to download generated files |
--no-download | false | Skip file download; only print the result JSON |
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.
| status | Meaning |
|---|---|
in_queue | Waiting for a runner; queue_position shows how many ahead |
in_progress | Running on GPU |
completed / succeeded | Done; fetch the output via runcomfy run (same request_id) or curl result_url |
failed | Run errored; fetch result_url for the failure reason |
cancelled | Cancelled (by you or by the platform) |
while loop for repeated checks. Backs GET .../requests/<id>/status.
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).