Reboot ComfyUI (Queued)
Reboot ComfyUI without nuking the job that's currently generating
You just installed a node that needs a restart, but your GPU is ten minutes into a Flux render and you'd rather not kiss it goodbye. ComfyUI-Manager's Restart button doesn't care about your feelings: it reboots instantly with os.execv, and anything still in the queue gets torn down mid-generation. Reboot ComfyUI (Queued) from the Queued Reboot pack is the polite version. It restarts the server as a job - submitted like any other prompt - so it only fires after the current work finishes.
That's the whole pitch, and it's a real one. The community keeps a small zoo of queue-manager nodes precisely because ComfyUI's queue gets eaten by restarts. This pack aims at the same gap, just from the "restart" end instead of the "remember my queue" end.
How it works
The node is an output node with no outputs - it's a one-shot action, not a data node, so you drop it into a graph (or run it solo) and hit Queue. When its turn comes up it kicks off a background daemon thread that sleeps for grace_seconds, then does the actual reboot: it closes ComfyUI's log wrapper, drops the comfy-cli .reboot marker if you launched under comfy-cli (so the supervisor respawns it), and otherwise os.execvs the current interpreter with your original launch argv. Because argv[0] is frozen as an absolute path at import time, some node calling os.chdir() later can't break the relaunch. Neat detail.
The inputs that matter
Only two, and the default is fine for most people:
wait_for_queue_empty(boolean, defaultfalse) -falserestarts as soon as this job's turn arrives, which means anything queued after it is lost.truewaits for the entire queue to drain first, including jobs added later. That's the one to switch on when you're scripting a big batch and want zero casualties.grace_seconds(int, default2, 1–60) - a pause before the reboot so the job's completion notifications flush. Leave it alone unless you're seeing dropped "executing" messages.
It also adds two top-bar commands under the Extensions menu - Reboot ComfyUI (after current job) and Reboot ComfyUI (after queue empties) - which submit a minimal one-node prompt without touching your open graph. If the buttons don't appear, your frontend is old; the node still works wired into a graph.
Installing it
No dependencies beyond the Python standard library, which is practically a spa day in this ecosystem:
cd ComfyUI/custom_nodes
git clone https://github.com/t22m003/ComfyUI-QueuedReboot
Then restart ComfyUI. Or just search "Queued Reboot" in ComfyUI Manager and hit install - same thing, one click.
Where people get burned
The security gate. Reboots are checked against ComfyUI-Manager's security level (allowed at weak/normal/normal-, blocked at strong), mirroring Manager's own restart gate. But if Manager isn't installed, there's no policy to read - so the gate is open by default. And ComfyUI's /prompt API is unauthenticated: anyone who can reach the server can fire an HTTP POST and reboot it, repeatedly, into a restart loop. If you bind with --listen, set COMFYUI_QUEUED_REBOOT=0 until you actually want a reboot, or set Manager to strong. The env var overrides everything: 0 always denies, 1 always allows.
Two more honest caveats. First, this is a hard restart: it only guarantees the current job's completion is signalled, not that every node's pending disk writes are flushed - treat it like any restart, not a graceful checkpoint. Second, if you launch through a wrapper that builds the command (a Docker entrypoint, srun), the reconstructed argv may not reproduce your real setup - same limitation as Manager's own restart, so test it once before you trust it in production. And if the queue refuses to drain, wait_for_queue_empty waits up to an hour and then aborts rather than kill a running job - annoying, but safer than the alternative.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| wait_for_queue_emptyopt | BOOLEAN | false | OFF: reboot as soon as this job's turn comes (jobs queued after it are lost). ON: wait until the whole queue is empty before rebooting. |
| grace_secondsopt | INT | 21–60 | Delay before rebooting, so this job's completion notifications can flush. |
Outputs (0)
No outputs