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 <noreply@anthropic.com>
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/<dir> only for relative paths (Docker-style setups).
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>