Fix essentials nodes not being marked core (#9287)

In adding an essentials cateogory for nodes, #8987 introduced a
regression where core nodes which are also essential are marked as being
from a `nodes` custom node instead of being marked core. Since the
essentials designation should pre-empt core and custom nodes can choose
to mark themself as essential, the getter for `isCoreNode` is updated to
instead repeat the existing check for if a node is core.

| Before | After |
| ------ | ----- |
| <img width="360" alt="before"
src="https://github.com/user-attachments/assets/f1b8bf80-d072-409a-a0f9-4837e1d11767"
/> | <img width="360" alt="after"
src="https://github.com/user-attachments/assets/14ff525b-9833-4e73-888f-791aff6cf531"/>|

┆Issue is synchronized with this [Notion
page](https://www.notion.so/PR-9287-Fix-essentials-nodes-not-being-marked-core-3146d73d365081fca2a0f8bdc2baf01a)
by [Unito](https://www.unito.io)
This commit is contained in:
AustinMroz
2026-02-27 16:23:08 -08:00
committed by GitHub
parent 07dab97aed
commit ea5ffcc66e
3 changed files with 7 additions and 8 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 42 KiB

After

Width:  |  Height:  |  Size: 41 KiB

View File

@@ -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<string, InputSpecV2>
@@ -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]'

View File

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