🎈LG_安装依赖
Install any pack's requirements without leaving ComfyUI
Dependency hell is ComfyUI's most reliable feature: you clone a pack, load a workflow, and it dies because a requirements.txt never got installed. Usually ComfyUI Manager saves you. But Manager only knows the packs in its registry - the moment you hand-clone something, or a pack's deps fail through Manager's installer, you're back to dropping to a terminal and babysitting pip.
LG_InstallDependencies (安装依赖 = "install dependencies") is the shortcut for that moment. It lists every folder in your custom_nodes directory that has a requirements.txt, you pick one, and it runs the install - with a live terminal panel right on the node so you can watch it work (or fail) in place.
How it works
The node scans your custom_nodes directory at load time and builds a dropdown of every plugin folder containing a requirements.txt. Pick one, hit run, and it executes:
pip install -r /path/to/custom_nodes/<folder>/requirements.txt
The part that matters under the hood: it uses sys.executable - the exact same Python interpreter ComfyUI is running in. If ComfyUI lives in a venv or its embedded Python, that's the env that gets the packages, not whatever pip happens to be on your PATH. That distinction is exactly where manual installs go wrong, and this node gets it right by construction. Output streams back over a websocket into a terminal widget drawn on the node, and it flags failures with an exit code.
Input:
- plugin_folder - the dropdown of custom-node folders with a
requirements.txt.
No outputs; it's a terminal/action node.
When it earns its keep
- You
git cloned a pack by hand (not through Manager) and it's missing deps. - Manager's auto-install of a pack's requirements silently failed and you want the raw pip output to see why.
- You want to install the Comfyui_LG_Tools pack's own requirements without touching a terminal - which is amusingly on-theme, since the dropdown includes the pack itself.
Installing it
It's a node inside the pack, so bootstrap once the normal way - Manager, or:
cd ComfyUI/custom_nodes
git clone https://github.com/LAOGOU-666/Comfyui_LG_Tools.git
pip install -r requirements.txt
Restart and look under right-click → 🎈LAOGOU → Utils. Note the pack's own requirements pull in opencv-contrib-python and transparent-background - the latter drags in a hefty torch-family stack and downloads ONNX checkpoints on first use for the background-removal nodes. Expect a long first install and a chunky disk footprint.
Troubleshooting
- "No folders found" - you're not in a standard install where custom_nodes has subfolders, or none of them have a requirements.txt. Check the path yourself.
- Install succeeds but nodes still missing - restart ComfyUI. This node installs packages, it doesn't register newly-added node classes; a restart is required either way.
- pip errors about permissions - you're installing into an env you don't own (e.g. a system-wide Python). Fix ownership or run ComfyUI from a venv.
- The real footgun: this installs into ComfyUI's own environment, and ComfyUI has no dependency isolation.
pip install -ra pack that pinstorchto something else and you can break your whole setup. Manager's careful here for a reason. For one-off small deps this node is great; for "let's see what happens" upgrades, maybe not.
If you find yourself using it every day, that's a sign your dependency hygiene needs a look - but for the "one missing package" moment, it's exactly what you want.
Inputs (1)
| Name | Type | Default | Description |
|---|---|---|---|
| plugin_folder | COMBO | 选择要安装依赖的插件文件夹 |
Outputs (0)
No outputs