Comfy-Org / Comfy-Org/ComfyUI-Manager
aria2 install path: bare 'import manager_core' → ModuleNotFoundError on the pip package (every install-model fails when COMFYUI_MANAGER_ARIA2_SERVER is set)
- Dominant language
- Python
- Stars
- 16.1k
- Forks
- 2.5k
- Avg merge
- 5d 4h
- Merged PRs (30d)
- 13
Description
### 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()`:
```python
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:
```python
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.
Contributor guide
No contributing guide indexed for this repository
Research direction
Start in comfyui_manager/common/manager_downloader.py at aria2_download_url() and trace how download_url() selects the aria2 path. Check the package and legacy import layouts, including any nearby bare manager_core or manager_util imports. Done means pip-installed install-model tasks work through the configured aria2 RPC path while the legacy custom_nodes layout remains supported.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 84/100