Skip to content

aria2 install path: bare 'import manager_core' → ModuleNotFoundError on the pip package (every install-model fails when COMFYUI_MANAGER_ARIA2_SERVER is set) #3064

Description

@artokun

Summary

In the pip-packaged comfyui-manager (installed via pip install comfyui-manager, used with --enable-manager), every model install fails with ModuleNotFoundError: No module named 'manager_core' when COMFYUI_MANAGER_ARIA2_SERVER is set. This makes the built-in aria2 fast-download path completely unusable for pip-package users.

Version

comfyui-manager==4.2.2 (pip), ComfyUI 0.27.0, Python 3.12, Linux.

Root cause

comfyui_manager/common/manager_downloader.py, aria2_download_url():

def aria2_download_url(model_url: str, model_dir: str, filename: str):
    import manager_core as core            # <-- line 79
    ...
    if model_dir.startswith(core.comfy_path):
        model_dir = model_dir[len(core.comfy_path):]

import manager_core is a flat/top-level import that only resolves in the legacy custom_nodes/ComfyUI-Manager/ layout (where manager_core.py sits on sys.path). In the pip package the module is comfyui_manager.glob.manager_core, so the bare import manager_core raises ModuleNotFoundError.

The function is only reached when COMFYUI_MANAGER_ARIA2_SERVER is set (see download_url()if aria2: return aria2_download_url(...)), so pip users without aria2 never hit it — but anyone enabling the aria2 RPC path (the documented fast-download feature) has every install-model task fail instantly.

Reproduce

  1. pip install comfyui-manager, launch ComfyUI with --enable-manager.
  2. Run an aria2c --enable-rpc daemon; set COMFYUI_MANAGER_ARIA2_SERVER=http://127.0.0.1:6800 (+ secret) in ComfyUI's env.
  3. Queue any model install (UI or POST /v2/manager/queue/task kind install-model).
  4. Task status → error; server log: [ComfyUI-Manager] ERROR: No module named 'manager_core'. Nothing downloads.

Suggested fix

Import via the package path with a fallback for the legacy layout:

try:
    from comfyui_manager.glob import manager_core as core
except ImportError:                     # legacy custom_nodes layout
    import manager_core as core

(Same pattern likely needed anywhere else in the aria2 path that does a bare import manager_core / import manager_util.)

Workaround (for others hitting this)

Drop a shim manager_core.py on sys.path exposing comfy_path (a string pointing at the ComfyUI root) — the only attribute aria2_download_url consumes. Because the import is function-level, writing the shim takes effect without restarting ComfyUI.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions