Nodes/comfyui-sg-process-manager/Kill Process by Name
ComfyUI Node

Kill Process by Name

Convenient, blunt, and not limited to this pack's processes

By sebagallo·Created 9 months ago·Updated 9 months ago· 1
Kill Process by Name
  • trigger
  • trigger
  • success
  • status
name
force_killfalse

Kill Process by Name is the most convenient and the bluntest tool in the comfyui-sg-process-manager pack. Instead of a key or a PID, you give it a process name - notepad.exe, ffmpeg, whatever - and it kills every process on the machine with that name. Notice the phrase "every process." That's the whole character of this node: it doesn't know about keys, it doesn't care whether ComfyUI started the process, and it stops at nothing that shares the name.

When it's the right tool

The genuinely good use case is a cleanup step after a batch job that spawned a bunch of helper processes you don't want lingering. If your workflow launched several ffmpeg instances and you want them all gone, one node with name = ffmpeg and force_kill on is a one-shot broom. It's also handy when a process is hanging and you only know its name, not its PID.

How it works

Platform-split again, like Kill Process by PID:

  • Windows: runs taskkill /IM <name> (with /T for the process tree, or /F to force). Non-zero exit means failure, with stderr surfaced as the status.
  • Unix/macOS: runs pkill -TERM <name>, or pkill -9 <name> with force_kill on.

Here's a subtle one the code reveals: on Unix, pkill returns 1 when it matches nothing, and this node treats both 0 and 1 as success. So killing a name that doesn't exist reports success anyway. If you're relying on this node to verify a process is gone, the status message isn't proof - check with the OS or List Processes if you have a pack-managed process.

Inputs and outputs

  • trigger (any type, passthrough) - fires the node, echoed through.
  • name - the process name to kill (e.g. notepad.exe). This one has no sensible default, so fill it in.
  • force_kill (BOOLEAN, default False) - graceful vs. hard kill.

Outputs: trigger, success (BOOLEAN), status (STRING - "Processes killed successfully" or the error).

Install

Same as the whole pack - ComfyUI Manager search "comfyui-sg-process-manager", or:

cd ComfyUI/custom_nodes
git clone https://github.com/sebagallo/comfyui-sg-process-manager.git

Restart ComfyUI. No dependencies, no downloads.

The honest warnings

First, names are broad. On Unix, pkill matches by process name, and a generic name like python or node can sweep up processes that have nothing to do with your workflow. Be specific. Second, remember the scope: because it reaches outside the pack's registry, a moment's inattention can kill something you didn't mean to. If the process is one this pack started, Kill Process by key is the safer sibling. Use this one when you know the name, want everything matching gone, and have double-checked what that name actually matches.

CategoryProcess Management

Inputs (3)

NameTypeDefaultDescription
trigger*
nameSTRING
force_killoptBOOLEANfalse

Outputs (3)

NameTypeDescription
trigger*
successBOOLEAN
statusSTRING