Nodes/Comfyui_LG_Tools/🎈LG_Pip管理器
ComfyUI Node

🎈LG_Pip管理器

Run pip from inside the node graph

By LAOGOU-666·Created 2 years ago·Updated 7 months ago· 369
🎈LG_Pip管理器
      package_name
      operationinstall

      There's a gap in ComfyUI's tooling that Manager doesn't fill: packages that aren't in its registry, version pins you want without editing a requirements.txt, and the eternal "did it actually install?" question. Normally that means dropping to a terminal, hunting the right Python environment, and squinting at pip output.

      LG_PipManager (Pip管理器 = "pip manager") puts a pip terminal inside the graph. Type a package, pick an operation, and it runs the install, uninstall, upgrade, or list with real-time output streaming into the node. It's the terminal you avoid leaving your workflow for.

      How it works

      The node builds a pip command and executes it with sys.executable - the same interpreter ComfyUI runs on, which is the whole ballgame. If you're in a venv or embedded Python, this hits the right env, not whatever pip your shell finds first. Output streams back over a websocket into a terminal drawn on the node, and it reports success or failure with an exit code.

      The package_name field accepts standard pip syntax - this is where it's smarter than it looks. The author's placeholder spells it out:

      numpy==1.21.0          # pinned version
      torch>=1.9.0           # version range
      requests[security]     # extra dependency
      numpy torch pandas     # multiple packages
      

      Comment lines (#) are stripped, empty lines ignored. For uninstall, it strips version pins and extras down to base package names before running pip uninstall -y.

      Inputs:

      • package_name - multiline string, pip-standard format.
      • operation - install, uninstall, upgrade, or list. (For list the package field is ignored - it just dumps installed packages into the terminal.)

      No outputs; it's an action node.

      When it earns its keep

      • A workflow needs a package Manager doesn't know about.
      • You want to pin a version without editing someone's requirements.txt.
      • "Did that install?" - hit list and grep mentally.

      Installing it

      It's inside Comfyui_LG_Tools - bootstrap once via Manager (search "Comfyui_LG_Tools") or:

      cd ComfyUI/custom_nodes
      git clone https://github.com/LAOGOU-666/Comfyui_LG_Tools.git
      pip install -r requirements.txt
      

      Restart, then right-click → 🎈LAOGOU → Utils.

      Troubleshooting

      • "Please enter a package name" - the field was empty or only comments. Put something real in there.
      • Install "succeeds" but the workflow still fails - restart ComfyUI. Installed Python packages don't get imported into an already-running process.
      • Uninstall broke something - this one's on you, but the node warns for a reason: pip uninstall can remove packages ComfyUI itself needs. If you nuke something critical, reinstall it the same way.
      • The real footgun - ComfyUI has no dependency isolation (the KB's dependency-hell essay is basically this problem). This node installs straight into ComfyUI's environment, with no sandbox, and no undo beyond "install it back." Great for small packages, terrifying if you decide to "upgrade" torch through it. Check what you're pinning before you pin it.

      It's a convenience node with a lot of rope. Used for its purpose - the occasional missing package, checked, not scripted - it's genuinely handy.

      Category🎈LAOGOU/Utils

      Inputs (2)

      NameTypeDefaultDescription
      package_nameSTRING包名支持版本号、额外依赖、多包安装等pip标准格式
      operationCOMBOinstall选择操作类型:安装、卸载、升级或列出已安装包

      Outputs (0)

      No outputs