Queued Reboot
Restart the ComfyUI server as a queued job (after the current queue finishes), with a top-bar button.
ComfyUI-QueuedReboot
Restart the ComfyUI server as a queued job instead of killing it instantly.
ComfyUI-Manager's Restart button reboots immediately with os.execv and does
not look at the queue, so any job that is currently generating gets torn down.
This node lets you queue the restart like any other prompt: it runs only after
the current (and earlier) jobs finish.
What you get
Reboot ComfyUI (Queued)node (RebootComfyNode). Drop it into a graph (or submit it on its own) and the server restarts when its turn in the queue comes up.- Top-bar commands (no graph needed) — added under the Extensions menu
and the command palette:
- Reboot ComfyUI (after current job) — FIFO: restarts once the running job (and anything queued before) finishes. Jobs queued after it are lost.
- Reboot ComfyUI (after queue empties) — waits until the whole queue is empty (including later-added jobs) before restarting.
Both submit a minimal one-node prompt directly, so your open graph is never touched or consumed.
Node inputs
| Input | Default | Meaning |
|-------|---------|---------|
| wait_for_queue_empty | false | false: reboot as soon as this job's turn comes. true: wait for the whole queue to drain first. |
| grace_seconds | 2 | Delay before rebooting, so the job's completion notifications can flush. |
Security
Rebooting is gated by the ComfyUI-Manager security level (mirrors Manager's
own middle gate): allowed for weak / normal / normal-, blocked at
strong. If ComfyUI-Manager is not installed there is no policy to enforce and
reboots are allowed.
Override with the COMFYUI_QUEUED_REBOOT environment variable (takes
precedence over the security level):
COMFYUI_QUEUED_REBOOT=0— always denyCOMFYUI_QUEUED_REBOOT=1— always allow
When denied, the node raises an error and the server is left untouched.
⚠️ Run on trusted networks only. ComfyUI's
/promptAPI is unauthenticated, so anyone who can reach the server can trigger a reboot (a single HTTP POST), and could do so repeatedly to force a restart loop. This is the same exposure as ComfyUI-Manager's Restart, but reachable programmatically at any time. If you bind with--listen/ expose the server beyond localhost, gate it: set ComfyUI-Manager's security level tostrong, or setCOMFYUI_QUEUED_REBOOT=0, and re-enable only when you intend to reboot. With no ComfyUI-Manager installed there is no security level to read, so the gate is open by default — rely onCOMFYUI_QUEUED_REBOOTin that case.
Requirements
- A ComfyUI frontend new enough to support
registerExtensioncommands/menuCommands(recent ComfyUI). On older frontends the node still works when added to a graph manually, but the top-bar buttons may not appear. - No extra Python dependencies (standard library only).
How the restart works
The restart is queued as a job and runs on a background thread once its turn
comes. It only guarantees that the current job's completion has been signalled
before restarting; it does not flush other components' pending disk writes,
so treat it like any hard restart (don't queue it expecting a clean checkpoint
of in-flight work). With wait_for_queue_empty it waits up to one hour for the
queue to drain and then aborts rather than restart over a still-running job.
The restart reproduces the standard behaviour independently (no third-party
code): it closes the log wrapper, and either writes the comfy-cli .reboot
marker (when launched under comfy-cli) or os.execvs the current interpreter
with the original argv.
argv[0] is captured as an absolute path at import time, so a later
os.chdir() by any node cannot break the relaunch.
Note on custom launchers:
os.execvkeeps the current environment variables, but if your server is started through a wrapper that builds the command/arguments (e.g. ansrunor Docker entrypoint), the reconstructedargvmay not fully reproduce that setup — the same limitation as ComfyUI-Manager's restart. Verify a restart once in your environment before relying on it.
Install
Clone into ComfyUI/custom_nodes/ (or install via ComfyUI-Manager) and restart
ComfyUI. No extra Python dependencies.
Publishing
Before publishing to the Comfy Registry, fill the placeholders in
pyproject.toml: set [tool.comfy] PublisherId (required — an empty value is
rejected by comfy node publish) and the real [project.urls] Repository.
License
Apache-2.0. See LICENSE.