diff --git a/browser_tests/tests/nodeBadge.spec.ts-snapshots/node-badge-Hide-built-in-chromium-linux.png b/browser_tests/tests/nodeBadge.spec.ts-snapshots/node-badge-Hide-built-in-chromium-linux.png index d13b7dab3a..467bce51fe 100644 Binary files a/browser_tests/tests/nodeBadge.spec.ts-snapshots/node-badge-Hide-built-in-chromium-linux.png and b/browser_tests/tests/nodeBadge.spec.ts-snapshots/node-badge-Hide-built-in-chromium-linux.png differ diff --git a/src/stores/nodeDefStore.ts b/src/stores/nodeDefStore.ts index f7c7c14b4c..65a7b3437b 100644 --- a/src/stores/nodeDefStore.ts +++ b/src/stores/nodeDefStore.ts @@ -24,7 +24,7 @@ import { useSettingStore } from '@/platform/settings/settingStore' import { NodeSearchService } from '@/services/nodeSearchService' import { useSubgraphStore } from '@/stores/subgraphStore' import { - NodeSourceType, + CORE_NODE_MODULES, getEssentialsCategory, getNodeSource } from '@/types/nodeSource' @@ -92,6 +92,7 @@ export class ComfyNodeDefImpl readonly essentials_category?: string /** Whether the blueprint is a global/installed blueprint (not user-created). */ readonly isGlobal?: boolean + readonly isCoreNode: boolean // V2 fields readonly inputs: Record @@ -169,6 +170,9 @@ export class ComfyNodeDefImpl obj.essentials_category ) this.isGlobal = obj.isGlobal + this.isCoreNode = CORE_NODE_MODULES.includes( + this.python_module.split('.')[0] + ) // Initialize V2 fields const defV2 = transformNodeDefV1ToV2(obj) @@ -198,10 +202,6 @@ export class ComfyNodeDefImpl return [scores[0], -nodeFrequency, ...scores.slice(1)] } - get isCoreNode(): boolean { - return this.nodeSource.type === NodeSourceType.Core - } - get nodeLifeCycleBadgeText(): string { if (this.deprecated) return '[DEPR]' if (this.experimental) return '[BETA]' diff --git a/src/types/nodeSource.ts b/src/types/nodeSource.ts index 09ae5562e3..e659803371 100644 --- a/src/types/nodeSource.ts +++ b/src/types/nodeSource.ts @@ -10,6 +10,7 @@ export enum NodeSourceType { Essentials = 'essentials', Unknown = 'unknown' } +export const CORE_NODE_MODULES = ['nodes', 'comfy_extras', 'comfy_api_nodes'] export type NodeSource = { type: NodeSourceType @@ -68,9 +69,7 @@ export const getNodeSource = ( displayText: displayName, badgeText: displayName } - } else if ( - ['nodes', 'comfy_extras', 'comfy_api_nodes'].includes(modules[0]) - ) { + } else if (CORE_NODE_MODULES.includes(modules[0])) { return { type: NodeSourceType.Core, className: 'comfy-core',