Fix nodeDef resolution for virtual nodes. (#6175)

<img width="697" height="250" alt="image"
src="https://github.com/user-attachments/assets/71fe7d9b-0cd6-43c6-b0d5-7dcb64d385a6"
/>

Virtual nodes (like primitives) don't have a nodeData. As a result, the
existing call to attempt lookup from a node instance fails. This is
fixed by adding `node.type` as a fallback

┆Issue is synchronized with this [Notion
page](https://www.notion.so/PR-6175-Fix-nodeDef-resolution-for-virtual-nodes-2936d73d365081b0abfcfe8532a50f8e)
by [Unito](https://www.unito.io)
This commit is contained in:
AustinMroz
2025-10-20 20:22:30 -07:00
committed by GitHub
parent 80013bcd5c
commit 9ae66c778d

View File

@@ -342,8 +342,7 @@ export const useNodeDefStore = defineStore('nodeDef', () => {
nodeDefsByDisplayName.value[nodeDef.display_name] = nodeDefImpl
}
function fromLGraphNode(node: LGraphNode): ComfyNodeDefImpl | null {
// Frontend-only nodes don't have nodeDef
const nodeTypeName = node.constructor?.nodeData?.name
const nodeTypeName = node.constructor?.nodeData?.name ?? node.type
if (!nodeTypeName) return null
const nodeDef = nodeDefsByName.value[nodeTypeName] ?? null
return nodeDef