diff --git a/src/composables/maskeditor/useMaskEditorLoader.ts b/src/composables/maskeditor/useMaskEditorLoader.ts index 74d39a5a28..fb878d4d5c 100644 --- a/src/composables/maskeditor/useMaskEditorLoader.ts +++ b/src/composables/maskeditor/useMaskEditorLoader.ts @@ -59,10 +59,7 @@ function mkFileUrl(props: { ref: ImageRef; preview?: boolean }): string { } const pathPlusQueryParams = api.apiURL( - '/view?' + - params.toString() + - app.getPreviewFormatParam() + - app.getRandParam() + '/view?' + params.toString() + app.getPreviewFormatParam() ) const imageElement = new Image() imageElement.crossOrigin = 'anonymous' diff --git a/src/composables/queue/useCompletionSummary.test.ts b/src/composables/queue/useCompletionSummary.test.ts index 34ec42ff6c..f5819cc827 100644 --- a/src/composables/queue/useCompletionSummary.test.ts +++ b/src/composables/queue/useCompletionSummary.test.ts @@ -10,7 +10,7 @@ type MockTask = { executionEndTimestamp?: number previewOutput?: { isImage: boolean - urlWithTimestamp: string + url: string } } @@ -72,7 +72,7 @@ describe('useCompletionSummary', () => { if (previewUrl) { task.previewOutput = { isImage, - urlWithTimestamp: previewUrl + url: previewUrl } } diff --git a/src/composables/queue/useCompletionSummary.ts b/src/composables/queue/useCompletionSummary.ts index 4964664a20..cced94ac32 100644 --- a/src/composables/queue/useCompletionSummary.ts +++ b/src/composables/queue/useCompletionSummary.ts @@ -78,7 +78,7 @@ export const useCompletionSummary = () => { completedCount++ const preview = task.previewOutput if (preview?.isImage) { - imagePreviews.push(preview.urlWithTimestamp) + imagePreviews.push(preview.url) } } else if (state === 'failed') { failedCount++ diff --git a/src/extensions/core/imageCompare.ts b/src/extensions/core/imageCompare.ts index 4821ec062a..8599127b8e 100644 --- a/src/extensions/core/imageCompare.ts +++ b/src/extensions/core/imageCompare.ts @@ -1,6 +1,5 @@ import type { NodeOutputWith } from '@/schemas/apiSchema' import { api } from '@/scripts/api' -import { app } from '@/scripts/app' import { useExtensionService } from '@/services/extensionService' type ImageCompareOutput = NodeOutputWith<{ @@ -23,15 +22,14 @@ useExtensionService().registerExtension({ onExecuted?.call(this, output) const { a_images: aImages, b_images: bImages } = output - const rand = app.getRandParam() const beforeUrl = aImages && aImages.length > 0 - ? api.apiURL(`/view?${new URLSearchParams(aImages[0])}${rand}`) + ? api.apiURL(`/view?${new URLSearchParams(aImages[0])}`) : '' const afterUrl = bImages && bImages.length > 0 - ? api.apiURL(`/view?${new URLSearchParams(bImages[0])}${rand}`) + ? api.apiURL(`/view?${new URLSearchParams(bImages[0])}`) : '' const widget = node.widgets?.find((w) => w.type === 'imagecompare') diff --git a/src/extensions/core/load3d/Load3dUtils.ts b/src/extensions/core/load3d/Load3dUtils.ts index ba7c36e557..1583bdd330 100644 --- a/src/extensions/core/load3d/Load3dUtils.ts +++ b/src/extensions/core/load3d/Load3dUtils.ts @@ -2,7 +2,6 @@ import type Load3d from '@/extensions/core/load3d/Load3d' import { t } from '@/i18n' import { useToastStore } from '@/platform/updates/common/toastStore' import { api } from '@/scripts/api' -import { app } from '@/scripts/app' class Load3dUtils { static async generateThumbnailIfNeeded( @@ -133,8 +132,7 @@ class Load3dUtils { const params = [ 'filename=' + encodeURIComponent(filename), 'type=' + type, - 'subfolder=' + subfolder, - app.getRandParam().substring(1) + 'subfolder=' + subfolder ].join('&') return `/view?${params}` diff --git a/src/renderer/extensions/vueNodes/widgets/utils/audioUtils.ts b/src/renderer/extensions/vueNodes/widgets/utils/audioUtils.ts index a596d5c749..5adab1e626 100644 --- a/src/renderer/extensions/vueNodes/widgets/utils/audioUtils.ts +++ b/src/renderer/extensions/vueNodes/widgets/utils/audioUtils.ts @@ -1,5 +1,4 @@ import type { ResultItemType } from '@/schemas/apiSchema' -import { app } from '@/scripts/app' /** * Format time in MM:SS format @@ -20,8 +19,7 @@ export function getResourceURL( const params = [ 'filename=' + encodeURIComponent(filename), 'type=' + type, - 'subfolder=' + subfolder, - app.getRandParam().substring(1) + 'subfolder=' + subfolder ].join('&') return `/view?${params}` diff --git a/src/scripts/app.ts b/src/scripts/app.ts index 067b6177d5..58a96fa800 100644 --- a/src/scripts/app.ts +++ b/src/scripts/app.ts @@ -16,7 +16,6 @@ import { } from '@/lib/litegraph/src/litegraph' import type { Vector2 } from '@/lib/litegraph/src/litegraph' import type { IBaseWidget } from '@/lib/litegraph/src/types/widgets' -import { isCloud } from '@/platform/distribution/types' import { useSettingStore } from '@/platform/settings/settingStore' import { useTelemetry } from '@/platform/telemetry' import type { WorkflowOpenSource } from '@/platform/telemetry/types' @@ -333,11 +332,6 @@ export class ComfyApp { else return '' } - getRandParam() { - if (isCloud) return '' - return '&rand=' + Math.random() - } - 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 d2aa2d4e02..e5e67bc4d1 100644 --- a/src/stores/imagePreviewStore.ts +++ b/src/stores/imagePreviewStore.ts @@ -112,12 +112,11 @@ export const useNodeOutputStore = defineStore('nodeOutput', () => { const outputs = getNodeOutputs(node) if (!outputs?.images?.length) return - const rand = app.getRandParam() const previewParam = getPreviewParam(node, outputs) return outputs.images.map((image) => { const imgUrlPart = new URLSearchParams(image) - return api.apiURL(`/view?${imgUrlPart}${previewParam}${rand}`) + return api.apiURL(`/view?${imgUrlPart}${previewParam}`) }) } diff --git a/src/stores/queueStore.ts b/src/stores/queueStore.ts index c302a1076e..8d935960fc 100644 --- a/src/stores/queueStore.ts +++ b/src/stores/queueStore.ts @@ -84,10 +84,6 @@ export class ResultItemImpl { return api.apiURL('/view?' + this.urlParams) } - get urlWithTimestamp(): string { - return `${this.url}&t=${+new Date()}` - } - get isVhsFormat(): boolean { return !!this.format && !!this.frame_rate }