Restrict applyToGraph to PrimitiveNode (#2669)

This commit is contained in:
Chenlei Hu
2025-02-21 15:53:33 -05:00
committed by GitHub
parent 85d04f6814
commit 6cb33d9431
3 changed files with 4 additions and 7 deletions

View File

@@ -1,6 +1,7 @@
import type { LGraph } from '@comfyorg/litegraph'
import { LGraphEventMode } from '@comfyorg/litegraph'
import { isPrimitiveNode } from '@/nodes/PrimitiveNode'
import type { ComfyApiWorkflow, ComfyWorkflowJSON } from '@/types/comfyWorkflow'
/**
@@ -19,11 +20,8 @@ export const graphToPrompt = async (
? outerNode.getInnerNodes()
: [outerNode]
for (const node of innerNodes) {
if (node.isVirtualNode) {
// Don't serialize frontend only nodes but let them make changes
if (node.applyToGraph) {
node.applyToGraph()
}
if (isPrimitiveNode(node)) {
node.applyToGraph()
}
}
}