From 857b4534f1142f37a771760ab5f237712b63d205 Mon Sep 17 00:00:00 2001
From: ViolinKaine <125495038+ViolinKaine@users.noreply.github.com>
Date: Mon, 15 Jun 2026 20:44:01 +0200
Subject: [PATCH 1/2] Fix aria2 path handling for local (non-Docker)
installations
The previous logic stripped the ComfyUI base path prefix and sent a
root-relative path (e.g. /custom_nodes) to aria2 via RPC, causing a
permission error when aria2 tried to create that directory at the
filesystem root.
Use the full absolute path when model_dir is absolute; fall back to
/models/
only for relative paths (Docker-style setups).
Co-Authored-By: Claude Sonnet 4.6
---
glob/manager_downloader.py | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/glob/manager_downloader.py b/glob/manager_downloader.py
index 2718de50..eb872ecf 100644
--- a/glob/manager_downloader.py
+++ b/glob/manager_downloader.py
@@ -80,10 +80,10 @@ def aria2_download_url(model_url: str, model_dir: str, filename: str):
import tqdm
import time
- if model_dir.startswith(core.comfy_path):
- model_dir = model_dir[len(core.comfy_path) :]
-
- download_dir = model_dir if model_dir.startswith('/') else os.path.join('/models', model_dir)
+ if os.path.isabs(model_dir):
+ download_dir = model_dir
+ else:
+ download_dir = os.path.join('/models', model_dir)
download = aria2_find_task(download_dir, filename)
if download is None:
From 0681955bd8def3f567dc3fced73aa912a3139046 Mon Sep 17 00:00:00 2001
From: ViolinKaine <125495038+ViolinKaine@users.noreply.github.com>
Date: Mon, 15 Jun 2026 20:51:51 +0200
Subject: [PATCH 2/2] Address Docker regression: detect container mode for
aria2 path remapping
In Docker, aria2 runs in a separate container with only mounted paths
visible (e.g. /models, /custom_nodes), not host absolute paths. Detect
Docker via /.dockerenv or COMFYUI_ARIA2_CONTAINER_PATHS=true env var and
remap to container-relative paths in that case. On bare-metal, use the
full absolute path so aria2 can locate the directory.
Co-Authored-By: Claude Sonnet 4.6
---
glob/manager_downloader.py | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/glob/manager_downloader.py b/glob/manager_downloader.py
index eb872ecf..5da00a08 100644
--- a/glob/manager_downloader.py
+++ b/glob/manager_downloader.py
@@ -80,7 +80,15 @@ def aria2_download_url(model_url: str, model_dir: str, filename: str):
import tqdm
import time
- if os.path.isabs(model_dir):
+ # In Docker, aria2 runs in a separate container and can only access
+ # container-relative mount paths (e.g. /models, /custom_nodes), not host
+ # absolute paths. Outside Docker, use the full absolute path directly.
+ in_docker = os.path.exists('/.dockerenv') or os.environ.get('COMFYUI_ARIA2_CONTAINER_PATHS', '').lower() == 'true'
+
+ if in_docker and model_dir.startswith(core.comfy_path):
+ rel = model_dir[len(core.comfy_path):]
+ download_dir = rel if rel.startswith('/') else '/' + rel
+ elif os.path.isabs(model_dir):
download_dir = model_dir
else:
download_dir = os.path.join('/models', model_dir)