Kill Ray
The shutdown button that saves your ComfyUI restart
- ray_actors
Kill Ray is the node you attach at the end of a raylight workflow so it doesn't hold your GPUs hostage. After a multi-GPU generation, the Ray workers keep squatting on your VRAM - and because ComfyUI doesn't know how to clean up a distributed cluster on its own, the standard fix for "I want to run a normal single-GPU workflow now" is restarting ComfyUI. This node is that restart, minus the restart.
It's a terminal node with no outputs. You wire the ray_actors in and it does exactly one job: shut things down cleanly.
The two kill modes
- Kill Workers Only - shuts down the Ray worker processes but leaves the Ray cluster itself alive. This is your "switch to a regular workflow without losing the cluster" button. It's the mode you'll use 95% of the time, because spinning up workers is the slow part of Raylight and you don't want to redo it for the next distributed run.
- Kill Entire Cluster - workers and the Ray runtime, the whole thing. This is the "I need a clean slate" mode, and the README positions it for when Raylight itself is in a bad state. It also resets the internal ControlNet loader state, so if you're swapping ControlNet setups between runs, this is the thorough reset.
There's also a practical detail in the tooltip: it's meant to be used "in case of error in Raylight." If a run dies mid-sampling and your workers are wedged, killing them from the graph (or from a tiny throwaway workflow with just this node wired to the actors) is a lot less painful than hunting ray processes in a terminal.
The trap
The ray_actors input is the same object that flows through the sampler, so the natural way to use Kill Ray is chaining it after your sampler in the same graph: init → sampler → kill. That works, but it means every successful run tears the cluster down. If you're iterating on prompts and want to keep workers warm, don't put Kill Workers Only in your main path - keep a separate one-node workflow (Ray Initializer → Kill Ray) that you run only when you actually want to stop. That's the difference between a smooth iteration loop and waiting through a full Ray boot on every single attempt.
One honest caveat: raylight's loader was reworked so it no longer kills workers just to reset model state, which fixed a whole class of memory leaks. So in current versions you need Kill Ray far less often than the early-adopter threads suggested. It's still the right tool when you do need it - particularly the "entire cluster" mode after a crash.
Installation is just the pack (ComfyUI Manager → "raylight", or clone + pip install -r requirements.txt). Nothing model-specific here; this node needs nothing but the Ray actors to point at.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| ray_actors | RAY_ACTORS | Ray actors to shut down cleanly. | |
| kill_mode | COMBO | This terminal node function to cleanly shutdown worker or entire cluster, this is usefull if you want to switch to regular WF without restarting ComfyUI, or incase of error in Raylight |
Outputs (0)
No outputs