Skip to content

fix: Use relative URLs to support ComfyUI hosted under a subpath#78

Open
ncaq wants to merge 1 commit into
newtextdoc1111:devfrom
ncaq:subpath
Open

fix: Use relative URLs to support ComfyUI hosted under a subpath#78
ncaq wants to merge 1 commit into
newtextdoc1111:devfrom
ncaq:subpath

Conversation

@ncaq

@ncaq ncaq commented Jul 24, 2026

Copy link
Copy Markdown

When ComfyUI is served under a subpath by a reverse proxy,
for example https://example.com/comfy-ui/,
the absolute imports from /scripts/ fail with 404,
and the whole extension silently fails to load.
The absolute fetch() calls to /autocomplete-plus/* likewise miss the proxy prefix.

This PR rewrites the imports relative to the module location
(extensions//js/ is three levels below the ComfyUI root),
and the fetch() URLs relative to the document base URL,
so both resolve correctly whether ComfyUI is hosted at the root or under a subpath.

Tested by serving ComfyUI both at the root and behind a reverse proxy
(Tailscale Serve) under /comfy-ui/:
the extension loads and the tag CSV endpoints respond in both setups.

When ComfyUI is served under a subpath by a reverse proxy,
for example https://example.com/comfy-ui/,
the absolute imports from /scripts/ fail with 404,
and the whole extension silently fails to load.
The absolute fetch() calls to /autocomplete-plus/* likewise miss the proxy prefix.

Rewrite the imports relative to the module location,
where extensions/<node-dir>/js/ is three levels below the ComfyUI root,
and the fetch() URLs relative to the document base URL,
so both resolve correctly whether ComfyUI is hosted at the root or under a subpath.
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