From 42854d95612b107d4a6967df58c486bbfcd05f5b Mon Sep 17 00:00:00 2001 From: Johnpaul Date: Mon, 13 Oct 2025 23:18:51 +0100 Subject: [PATCH] feat: add TopbarBadge interface and implement cloud badge in extension --- src/extensions/core/cloudBadge.ts | 15 +++++++++++++++ src/extensions/core/index.ts | 1 + src/types/comfy.ts | 12 ++++++++++++ 3 files changed, 28 insertions(+) create mode 100644 src/extensions/core/cloudBadge.ts diff --git a/src/extensions/core/cloudBadge.ts b/src/extensions/core/cloudBadge.ts new file mode 100644 index 000000000..fddff2aaf --- /dev/null +++ b/src/extensions/core/cloudBadge.ts @@ -0,0 +1,15 @@ +import { isProductionEnvironment } from '@/config/environment' +import { useExtensionService } from '@/services/extensionService' + +useExtensionService().registerExtension({ + name: 'Comfy.CloudBadge', + // Only show badge when running in cloud environment + topbarBadges: isProductionEnvironment() + ? [ + { + label: 'BETA', + text: 'Comfy Cloud' + } + ] + : undefined +}) diff --git a/src/extensions/core/index.ts b/src/extensions/core/index.ts index 5354ef4e9..de4ec3752 100644 --- a/src/extensions/core/index.ts +++ b/src/extensions/core/index.ts @@ -1,4 +1,5 @@ import './clipspace' +import './cloudBadge' import './contextMenuFilter' import './dynamicPrompts' import './editAttention' diff --git a/src/types/comfy.ts b/src/types/comfy.ts index 0ce8d89dc..cad5b70c5 100644 --- a/src/types/comfy.ts +++ b/src/types/comfy.ts @@ -18,6 +18,14 @@ export interface AboutPageBadge { icon: string } +export interface TopbarBadge { + text: string + /** + * Optional badge label (e.g., "BETA", "ALPHA", "NEW") + */ + label?: string +} + type MenuCommandGroup = { /** * The path to the menu group. @@ -71,6 +79,10 @@ export interface ComfyExtension { * Badges to add to the about page */ aboutPageBadges?: AboutPageBadge[] + /** + * Badges to add to the topbar + */ + topbarBadges?: TopbarBadge[] /** * Allows any initialisation, e.g. loading resources. Called after the canvas is created but before nodes are added * @param app The ComfyUI app instance