Skip to content

fix(aria2): resolve comfy_path via common.context in aria2_download_url - #3246

Open
ReinisLusis wants to merge 1 commit into
Comfy-Org:manager-v4from
ReinisLusis:fix/3064-aria2-flat-import
Open

fix(aria2): resolve comfy_path via common.context in aria2_download_url#3246
ReinisLusis wants to merge 1 commit into
Comfy-Org:manager-v4from
ReinisLusis:fix/3064-aria2-flat-import

Conversation

@ReinisLusis

Copy link
Copy Markdown

aria2_download_url in comfyui_manager/common/manager_downloader.py:79 does import manager_core as core. That flat import resolves only in the v3 custom_nodes/ layout; under the pip package the module is comfyui_manager.glob.manager_core, so it raises ModuleNotFoundError.

When it breaks. Only when COMFYUI_MANAGER_ARIA2_SERVER is set — download_url reaches aria2_download_url behind that check. For those users every model install and every CNR node install fails instantly, and aria2 is the only resumable download path Manager has.

Why the one-liner in the thread is not enough. from comfyui_manager.glob import manager_core as core fixes the import, but the next two lines read core.comfy_path, and v4 binds that name in comfyui_manager/common/context.py, not in manager_core. On manager-v4 (bd4ede2) comfyui_manager.glob.manager_core imports fine and hasattr(manager_core, 'comfy_path') is False, so the one-liner trades ModuleNotFoundError for AttributeError. The import has to reach context.

Why try/except rather than a plain package import. main:glob/manager_downloader.py and manager-v4:comfyui_manager/common/manager_downloader.py are byte-identical today, and on main the flat import is the correct one — glob/ is not a package there, so a relative import is not available either. The except arm is exactly what main does now. That makes this hunk correct in both layouts, so it does not have to be revisited when the v4 tree reaches main, and it answers the branch question left open in the thread rather than asking it again.

Verified at manager-v4 bd4ede2 and main f82970b: the patched file compiles and comfy_path resolves in both layouts (package arm through the real common/context.py, flat arm through the real glob/manager_core.py).

Not addressed here: the /models re-rooting a few lines below, raised as a follow-up on the same issue. That one changes behaviour for the separate-container aria2 setup documented in docs/en/use_aria2.md and needs a decision on which topology is supported, so it is left out of this fix.

Refs #3064

`aria2_download_url` did a bare `import manager_core as core`, which resolves
only in the v3 flat layout, so every aria2 download fails with
ModuleNotFoundError under the pip package. v4 binds `comfy_path` in
`common/context.py` rather than in `manager_core`, so the package import has to
reach `context`. The `except` arm is what the flat layout does today, which
keeps the file correct on `main`.

Refs Comfy-Org#3064
@coderabbitai

coderabbitai Bot commented Sep 5, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Team

Run ID: 422ae9f4-8652-4766-9f65-556ef54fdcaa

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Comment @coderabbitai help to get the list of available commands.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant