mirror of
https://github.com/comfyanonymous/ComfyUI.git
synced 2026-03-10 19:57:42 +08:00
Allow api_base override
Provide a means for local development to specify the api_base to override assumption that the api is where the client is based on browser 'location'
This commit is contained in:
parent
d19de2753e
commit
f73bf1cffd
1
.gitignore
vendored
1
.gitignore
vendored
@ -15,3 +15,4 @@ venv/
|
|||||||
!/web/extensions/logging.js.example
|
!/web/extensions/logging.js.example
|
||||||
!/web/extensions/core/
|
!/web/extensions/core/
|
||||||
/tests-ui/data/object_info.json
|
/tests-ui/data/object_info.json
|
||||||
|
.vscode
|
||||||
@ -7,6 +7,10 @@ class ComfyApi extends EventTarget {
|
|||||||
this.api_base = location.pathname.split('/').slice(0, -1).join('/');
|
this.api_base = location.pathname.split('/').slice(0, -1).join('/');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
set apiBase(apiBase) {
|
||||||
|
this.api_base = apiBase;
|
||||||
|
}
|
||||||
|
|
||||||
apiURL(route) {
|
apiURL(route) {
|
||||||
return this.api_base + route;
|
return this.api_base + route;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -78,6 +78,14 @@ export class ComfyApp {
|
|||||||
this.shiftDown = false;
|
this.shiftDown = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Provide a setter for the base url of the api
|
||||||
|
* @param {string} apiBase
|
||||||
|
*/
|
||||||
|
set apiBase(apiBase) {
|
||||||
|
api.apiBase = apiBase;
|
||||||
|
}
|
||||||
|
|
||||||
getPreviewFormatParam() {
|
getPreviewFormatParam() {
|
||||||
let preview_format = this.ui.settings.getSettingValue("Comfy.PreviewFormat");
|
let preview_format = this.ui.settings.getSettingValue("Comfy.PreviewFormat");
|
||||||
if(preview_format)
|
if(preview_format)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user