Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 5 additions & 5 deletions src/stores/nodeDefStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,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'
Expand Down Expand Up @@ -91,6 +91,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>
Expand Down Expand Up @@ -168,6 +169,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)
Expand Down Expand Up @@ -197,10 +201,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]'
Expand Down
5 changes: 2 additions & 3 deletions src/types/nodeSource.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ export enum NodeSourceType {
Essentials = 'essentials',
Unknown = 'unknown'
}
export const CORE_NODE_MODULES = ['nodes', 'comfy_extras', 'comfy_api_nodes']

export type NodeSource = {
type: NodeSourceType
Expand Down Expand Up @@ -98,9 +99,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',
Expand Down
Loading