use relative paths for all web connections

This enables local reverse-proxies to host ComfyUI on a path, eg "http://example.com/ComfyUI/" in such a way that at least everything I tested works. Without this patch, proxying ComfyUI in this way will yield errors.
This commit is contained in:
Alex "mcmonkey" Goodwin
2023-07-10 02:09:03 -07:00
parent af15add967
commit 5797ff89b0
17 changed files with 42 additions and 42 deletions

View File

@@ -404,7 +404,7 @@ export class ComfyApp {
this.images = output.images;
imagesChanged = true;
imgURLs = imgURLs.concat(output.images.map(params => {
return "/view?" + new URLSearchParams(params).toString() + app.getPreviewFormatParam();
return "./view?" + new URLSearchParams(params).toString() + app.getPreviewFormatParam();
}))
}
}
@@ -1005,7 +1005,7 @@ export class ComfyApp {
const extensions = await api.getExtensions();
for (const ext of extensions) {
try {
await import(ext);
await import(".." + ext);
} catch (error) {
console.error("Error loading extension", ext, error);
}