Nodes/ComfyUI-MakkiTools/UniversalInstaller(mki-安装Python包)
ComfyUI Node

UniversalInstaller(mki-安装Python包)

Pip Install From Inside a Workflow — Then Actually Restart

By MakkiShizu·Created about a year ago·Updated 7 months ago· 9
UniversalInstaller(mki-安装Python包)
    • STRING
    package_name
    backendpip
    mirror_sourcedefault
    update_if_no_versionfalse
    extra_index_url

    UniversalInstaller(mki-安装Python包) does exactly what its name says: it pip-installs a Python package from inside a ComfyUI workflow. You type a package name, hit run, and the node invokes pip in the same Python environment that's running ComfyUI, streams the install log to the console, and shows you a ✅ or ❌ status with the full log in a box on the node. No terminal tab required.

    Why it exists. Dependency hell, plain and simple. The KB's ecosystem essay describes the structural problem: every custom node installs into one shared Python environment with no isolation, and the more packs you add, the more likely a workflow comes up missing some transitive dependency that no pack's requirements.txt bothered to pin. When that happens, the old ritual was drop to a terminal, run pip, restart. This node folds that ritual into the graph itself.

    For a chunk of the user base, the mirrors are the actual point. The author is a Chinese developer, and the node ships one-click switches for the Tsinghua, Aliyun, Douban, and USTC PyPI mirrors - the difference between a download that takes seconds and one that crawls or times out from behind the Great Firewall.

    How it works. It builds a command like sys.executable -m pip install <package> and runs it via subprocess, printing output lines to the ComfyUI console as they arrive, then returns a STRING with the success/failure status and the install log. The pack's frontend extension renders that string in a multiline info box on the node.

    The inputs that matter:

    • package_name - anything pip accepts, e.g. requests or tipo-kgen==0.2.0.
    • backend - pip or uv. The uv option runs python -m uv pip install, which means uv has to already be installed in that Python. It's not bundled - pick uv without uv and you just get a failed install.
    • mirror_source - default / tsinghua / aliyun / douban / ustc / custom.
    • update_if_no_version - appends -U when the package name has no version specifier.
    • extra_index_url - only consulted when mirror_source is custom.

    Output: one STRING (the status + log).

    Gotchas, and there are two real ones. First: restart ComfyUI after a successful install. The README says it explicitly, and it's not a suggestion - a freshly installed module can't be imported by other nodes until the process restarts, because Python's module table was already built. Second: the node re-runs every queue pass. Its IS_CHANGED always reports a change, so ComfyUI will attempt the install on every single run even when the package is already there. Once it works, bypass the node - leaving it live means pip gets invoked constantly, which is slow and noisy. And worth stating plainly: installing a package is executing arbitrary code, in the same unsandboxed model as everything in custom_nodes land. It's a power tool, not a toy - which is presumably exactly why the author built it.

    Install. The node itself needs no extra dependencies - the whole pack's requirements.txt exists for the translation nodes:

    cd ComfyUI/custom_nodes
    git clone https://github.com/MakkiShizu/ComfyUI-MakkiTools
    cd ComfyUI-MakkiTools
    ..\..\..\python_embeded\python.exe -m pip install -r requirements.txt   # Windows portable
    pip install -r requirements.txt                                          # venv/conda
    

    Or search "ComfyUI-MakkiTools" in ComfyUI Manager. Restart, then install packages to your heart's content - and restart again after each one.

    CategoryMakkiTools

    Inputs (5)

    NameTypeDefaultDescription
    package_nameSTRINGThe name of the package to install, such as 'requests' or 'tipo-kgen==0.2.0'. 要安装的包名称,例如'requests'或'tipo-kgen==0.2.0'。
    backendCOMBOpipPackage manager to use 要使用的包管理器
    mirror_sourceCOMBOdefaultSelect the mirror source, use the content in extra_index_url when custom. 选择镜像源,自定义时使用extra_index_url中的内容。
    update_if_no_versionBOOLEANfalseWhen the package name does not specify a version, should the -U parameter be used to update to the latest version. 当包名称未指定版本时,是否应使用-U参数更新到最新版本。
    extra_index_urloptSTRINGAdditional index URLs (e.g., private sources), optional. Only used when 'mirror_source' is set to 'custom'. 附加索引URL(例如私有源),可选。仅在'mirror_source'设置为'custom'时使用。

    Outputs (1)

    NameTypeDescription
    STRINGSTRING