restart_comfy
Restart ComfyUI and wait for it to become responsive again, optionally forcing a restart even with pending jobs.
Instructions
Restart ComfyUI and wait for it to answer again.
What a newly installed or edited node needs: nodes.py imports every pack
once at startup and nothing re-reads them, so a pack added while ComfyUI runs
is simply absent from /object_info. Changed extension JavaScript is the
other case and needs only reload_workspace - a restart there is minutes spent
on a page reload.
Two mechanisms, picked by who owns the process. One this server started is stopped and relaunched through COMFYUI_LAUNCH_SCRIPT. One you started yourself is asked to re-exec itself, through the bridge node - which is the only way to reach it at all, and has the advantage of coming back on the exact command line and environment it already had, rather than on this server's guess at them. That path therefore needs the node installed.
Schemas and model directories are dropped, since a restart is precisely what makes them stale. A tab that was connected reconnects on its own and is waited for; the workflow on its canvas survives, being the browser's, not ComfyUI's.
Args: wait: seconds to wait for ComfyUI to come back. force: restart even with jobs running or queued, throwing that work away.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| wait | No | ||
| force | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||