diff --git a/.gitignore b/.gitignore index 43c038e41..9e432d51e 100644 --- a/.gitignore +++ b/.gitignore @@ -14,4 +14,5 @@ venv/ /web/extensions/* !/web/extensions/logging.js.example !/web/extensions/core/ -/tests-ui/data/object_info.json \ No newline at end of file +/tests-ui/data/object_info.json +.vscode \ No newline at end of file diff --git a/web/scripts/api.js b/web/scripts/api.js index 9aa7528af..cf5a50589 100644 --- a/web/scripts/api.js +++ b/web/scripts/api.js @@ -7,6 +7,10 @@ class ComfyApi extends EventTarget { this.api_base = location.pathname.split('/').slice(0, -1).join('/'); } + set apiBase(apiBase) { + this.api_base = apiBase; + } + apiURL(route) { return this.api_base + route; } @@ -314,7 +318,7 @@ class ComfyApi extends EventTarget { */ async interrupt() { await this.#postItem("interrupt", null); - } + } } export const api = new ComfyApi(); diff --git a/web/scripts/app.js b/web/scripts/app.js index cd20c40fd..e546728eb 100644 --- a/web/scripts/app.js +++ b/web/scripts/app.js @@ -78,6 +78,14 @@ export class ComfyApp { this.shiftDown = false; } + /** + * Provide a setter for the base url of the api + * @param {string} apiBase + */ + set apiBase(apiBase) { + api.apiBase = apiBase; + } + getPreviewFormatParam() { let preview_format = this.ui.settings.getSettingValue("Comfy.PreviewFormat"); if(preview_format)