From 044b6751388b4ba3e452f2d574ee895402fdb9c9 Mon Sep 17 00:00:00 2001 From: Comfy Org PR Bot Date: Mon, 3 Nov 2025 06:43:23 +0900 Subject: [PATCH] [backport rh-test] fix: Use environment-specific log API endpoints for Cloud and OSS (#6544) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Backport of #6539 to `rh-test` Automatically created by backport workflow. ┆Issue is synchronized with this [Notion page](https://www.notion.so/PR-6544-backport-rh-test-fix-Use-environment-specific-log-API-endpoints-for-Cloud-and-OSS-29f6d73d365081dc9dd7d95805242774) by [Unito](https://www.unito.io) --------- Co-authored-by: Jin Yi Co-authored-by: Christian Byrne --- src/scripts/api.ts | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/scripts/api.ts b/src/scripts/api.ts index f3d0ce9c7..7dd6ab4d1 100644 --- a/src/scripts/api.ts +++ b/src/scripts/api.ts @@ -7,6 +7,7 @@ import type { ModelFile, ModelFolderInfo } from '@/platform/assets/schemas/assetSchema' +import { isCloud } from '@/platform/distribution/types' import { useToastStore } from '@/platform/updates/common/toastStore' import { type WorkflowTemplates } from '@/platform/workflow/templates/types/template' import type { @@ -1269,15 +1270,22 @@ export class ComfyApi extends EventTarget { } async getLogs(): Promise { - return (await axios.get(this.internalURL('/logs'))).data + const url = isCloud ? this.apiURL('/logs') : this.internalURL('/logs') + return (await axios.get(url)).data } async getRawLogs(): Promise { - return (await axios.get(this.internalURL('/logs/raw'))).data + const url = isCloud + ? this.apiURL('/logs/raw') + : this.internalURL('/logs/raw') + return (await axios.get(url)).data } async subscribeLogs(enabled: boolean): Promise { - return await axios.patch(this.internalURL('/logs/subscribe'), { + const url = isCloud + ? this.apiURL('/logs/subscribe') + : this.internalURL('/logs/subscribe') + return await axios.patch(url, { enabled, clientId: this.clientId })