cancel_job
Interrupt and stop the currently running ComfyUI job, with escalation to free VRAM if the interrupt is not honored. Optionally clear all pending jobs.
Instructions
Stop the CURRENTLY RUNNING ComfyUI job ROBUSTLY. Sends an interrupt, then WAITS and verifies the job actually stopped — ComfyUI only honors interrupts BETWEEN steps, so a long single step (e.g. a high-res video sampler) can ignore a plain cancel. If the interrupt isn't honored it escalates to freeing VRAM (POST /free) and re-checks; if it STILL won't die it reports the job as WEDGED and tells you to restart_comfyui (an HTTP cancel cannot kill a stuck step). Set clear_pending:true to also drop ALL pending jobs in the same call — the correct 'reset the queue' action, since cancelling alone leaves pending jobs that would run next. The partial result is discarded. Use cancel_queued_job to remove one specific PENDING job instead.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| prompt_id | No | Optional. If given, only interrupts the running job when its prompt_id matches; omit to interrupt whatever is currently running. | |
| clear_pending | No | Also clear ALL pending jobs (recommended when resetting after a stuck/slow render, so a re-queue doesn't stack behind a backlog). Default false. |