Nodes/ComfyUI-ScheduledTask/Shutdown Computer
ComfyUI Node

Shutdown Computer

Shut your PC down when the batch finishes — so you can go to bed

By dseditor·Created about a year ago·Updated about a year ago· 10
Shutdown Computer
  • trigger
  • status
delay_seconds5
force_shutdownfalse

Go to bed, let the GPU clean up after itself

If you've ever queued two hundred images in ComfyUI, set the monitor to sleep, and lain there wondering whether the render finished before your electricity bill did - this is the node that closes the loop. Shutdown Computer sits at the end of a workflow, and when the graph reaches it, it waits out a delay and powers the machine off. It's the "hang up the phone" step of an unattended render.

It ships in ComfyUI-ScheduledTask, a pack built around exactly that lifestyle. The same extension that can fire a workflow on a timer pairs naturally with this: render overnight, auto-power-down, wake up to fresh images. People do automate ComfyUI this way - the community has written whole PowerShell scripts just to keep it stable - and this node is the last mile of that automation.

How it works

It's a terminal action, not a utility. You wire trigger (any input type - a number, an image, a string, whatever's handy) from the last node that matters in your graph and set delay_seconds (0–300, default 5). When execution reaches the node it sleeps for the delay, then shells out to the OS:

  • Windows: shutdown /s /t 0 - or with force_shutdown on, shutdown /s /f /t 0, which kills open apps without saving.
  • Linux/macOS: shutdown -h now - with force on, sudo shutdown -h now.

It returns a status string describing what ran. Useful for logs, not much else.

The inputs that matter

Only two are really yours to set:

  • delay_seconds - your abort window. The default of 5 is short. If you want time to cancel, bump it to something you can react to.
  • force_shutdown - off by default, which is correct. Turn it on only when you're certain nothing unsaved matters.

trigger is a required any-type input, so it just needs a connection to run last. Any upstream output works.

Where people get burned

The big one: ComfyUI only executes nodes that feed an output node. If the status output goes nowhere, this node gets pruned from the execution plan and never runs - your machine stays on, and you'll blame the wrong thing. Wire status into a text preview / display node so the graph actually has a reason to execute it.

Second: the node blocks the execution thread while it sleeps. Fine at the end of a graph, a footgun anywhere in the middle. Third: it fires when it runs, and it only runs if everything upstream completed without erroring - a failed render aborts the queue before downstream nodes get a turn. That's a feature in disguise: you get "shutdown on success" for free.

Finally, on Linux/macOS a plain shutdown -h now needs permission, and force mode invokes sudo, which may prompt or fail in a headless context. And yes - this is a node that runs arbitrary system commands on your machine. Skim the source before you trust any custom node, but especially this one.

Install

Same story as every node in this pack:

  • ComfyUI Manager (easiest): search "ComfyUI-ScheduledTask", install, restart ComfyUI.
  • Manual:
cd ComfyUI/custom_nodes
git clone https://github.com/dseditor/ComfyUI-ScheduledTask
cd ComfyUI-ScheduledTask
pip install -r requirements.txt

Dependencies are just schedule and requests - no model downloads, nothing heavy. Restart, and "Shutdown Computer" appears under system/shutdown. Read that delay once more before you hit Queue.

Categorysystem/shutdown

Inputs (3)

NameTypeDefaultDescription
trigger*
delay_secondsINT50–300
force_shutdownBOOLEANfalse

Outputs (1)

NameTypeDescription
statusSTRING