Worker Keeper — Manual Kill
Free 14 GB of RAM by killing the comfy-env workers your other nodes left behind
- trigger
- trigger
Have you ever run a GeometryPack workflow, switched to a normal image-to-image one, and watched your RAM and VRAM stay full for no obvious reason? That's not a leak. That's comfy-env. Packs like GeometryPack, GaussianPack, SAM3, MoGe2, Sharp, PanoPack, and DepthAnythingV3 use PozzettiAndrea's comfy-env framework to isolate their heavy Python dependencies in a separate subprocess - around 2 GB of system RAM and a few hundred MB to a couple GB of VRAM each, because the model weights load inside that subprocess too. The catch: ComfyUI never kills those subprocesses. Run a few of these packs and you've got 14 GB of RAM plus VRAM quietly burning on workers you're not even using.
WorkerKeeper is the pack that fixes that. It's mostly an install-and-forget background service - two hooks watch every prompt and silently kill idle workers. This node, Worker Keeper - Manual Kill, is the manual override: a way to kill a specific environment's worker from inside a workflow, the moment you know you're done with it.
How it works
At startup the node discovers every comfy-env environment you have installed - it inspects the proxy class closures of _comfy_env_isolated node types, reads the live worker pool, and scans the pixi environments directory. For each environment found, it adds a BOOLEAN toggle to the node. Flip a toggle ON, connect any trigger, and when the node executes it force-kills that environment's worker.
The kill uses the same "silent" path as the background layers: direct proc.kill() plus immediate temp-directory cleanup, instead of comfy-env's graceful shutdown handshake. That's deliberate - it's what avoids the "RuntimeError: Worker process died" noise you'd otherwise see in the log when you yank a subprocess mid-handshake. No tracebacks, no log spam.
All toggles default to OFF. Environments you leave OFF stay under the automatic service's control, so this node doesn't fight the background layers - it just lets you force the issue early, e.g. kill the geometry worker the moment your mesh is baked so VRAM frees up for the next stage.
Inputs and outputs that matter
This is as simple as nodes get. The only real input is trigger (wildcard type), and it passes straight through to the output unchanged - insert the node anywhere in a workflow and data flows through it untouched, like LoadImage → WorkerKeeperManualKill → PreviewImage. It's an output node, so it also works fine as an endpoint in the graph.
The rest of the inputs are the auto-generated environment toggles (one BOOLEAN per detected env). That's the whole list. If you're used to nodes with twenty knobs, enjoy the break.
Installing it
Both routes work, and neither has dependencies - the node only uses Python's stdlib plus the comfy-env modules ComfyUI already loads, so there's no requirements.txt rabbit hole.
Via ComfyUI Manager: search for "ComfyUI-WorkerKeeper" and install, or use Install via Git URL with https://github.com/kajan988/ComfyUI-WorkerKeeper.git.
Manual:
cd ComfyUI/custom_nodes
git clone https://github.com/kajan988/ComfyUI-WorkerKeeper.git
Then restart ComfyUI. One real gotcha: the pack's own README gives a PozzettiAndrea/ComfyUI-WorkerKeeper.git URL in its install instructions - that's a copy-paste slip, and the actual repo is kajan988/ComfyUI-WorkerKeeper (it's in the pyproject.toml). If Manager search finds it, just use that and skip the URL entirely.
Common issues
- Toggles missing for a new env? The environment list is built at startup. Install a new comfy-env pack (say, a fresh MoGe2), restart ComfyUI, and the toggle appears.
- No toggles at all? The pack you're worried about probably doesn't use comfy-env isolation - most normal custom nodes run in ComfyUI's own process, which is exactly the thing this framework exists to avoid. In that case the node is a harmless pass-through.
- Not sure what's alive? The pack also registers
GET /workerkeeper/statusandPOST /workerkeeper/kill_allon the ComfyUI server, socurl http://localhost:8188/workerkeeper/statusshows you every live worker and its state. - Want a no-workflow kill button? The pack ships a keybindable command ("Kill all isolation workers" under Settings → Keybindings) that nukes every live worker with a green toast. Most days that's the one you'll actually reach for.
Honest take: if you only run one comfy-env pack occasionally, you don't need this node at all - the automatic service is the real product. Reach for Manual Kill when you're juggling a few isolated packs in one session and want to reclaim VRAM mid-workflow. It's small, it's free, and unlike most "cleanup" tools, it demonstrably does what it says.
Inputs (1)
| Name | Type | Default | Description |
|---|---|---|---|
| trigger | * | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| trigger | * | — |