feat: add TopbarBadge interface and implement cloud badge in extension

This commit is contained in:
Johnpaul
2025-10-13 23:18:51 +01:00
parent 636a89ac0c
commit 42854d9561
3 changed files with 28 additions and 0 deletions

View File

@@ -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
})

View File

@@ -1,4 +1,5 @@
import './clipspace'
import './cloudBadge'
import './contextMenuFilter'
import './dynamicPrompts'
import './editAttention'

View File

@@ -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