diff --git a/src/scripts/app.ts b/src/scripts/app.ts index f905643fb..7c5fdc4cb 100644 --- a/src/scripts/app.ts +++ b/src/scripts/app.ts @@ -323,6 +323,14 @@ export class ComfyApp { return '&rand=' + Math.random() } + getClientIdParam() { + const clientId = window.name + if (clientId) { + return '&client_id=' + clientId + } + return '' + } + static onClipspaceEditorSave() { if (ComfyApp.clipspace_return_node) { ComfyApp.pasteFromClipspace(ComfyApp.clipspace_return_node) diff --git a/src/stores/imagePreviewStore.ts b/src/stores/imagePreviewStore.ts index 44e9f665a..cf7e7bb8f 100644 --- a/src/stores/imagePreviewStore.ts +++ b/src/stores/imagePreviewStore.ts @@ -90,10 +90,13 @@ export const useNodeOutputStore = defineStore('nodeOutput', () => { const rand = app.getRandParam() const previewParam = getPreviewParam(node, outputs) + const clientIdParam = app.getClientIdParam() return outputs.images.map((image) => { const imgUrlPart = new URLSearchParams(image) - return api.apiURL(`/view?${imgUrlPart}${previewParam}${rand}`) + return api.apiURL( + `/view?${imgUrlPart}${previewParam}${rand}${clientIdParam}` + ) }) } diff --git a/src/stores/queueStore.ts b/src/stores/queueStore.ts index 316c3564a..93bbf7ffc 100644 --- a/src/stores/queueStore.ts +++ b/src/stores/queueStore.ts @@ -59,6 +59,11 @@ export class ResultItemImpl { params.set('type', this.type) params.set('subfolder', this.subfolder) + const clientId = window.name + if (clientId) { + params.set('client_id', clientId) + } + if (this.format) { params.set('format', this.format) }