mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-02-03 06:47:33 +00:00
Restrict applyToGraph to PrimitiveNode (#2669)
This commit is contained in:
@@ -569,7 +569,7 @@ export function isValidCombo(combo: string[], obj: unknown) {
|
||||
return true
|
||||
}
|
||||
|
||||
function isPrimitiveNode(node: LGraphNode): node is PrimitiveNode {
|
||||
export function isPrimitiveNode(node: LGraphNode): node is PrimitiveNode {
|
||||
return node.type === 'PrimitiveNode'
|
||||
}
|
||||
|
||||
|
||||
1
src/types/litegraph-augmentation.d.ts
vendored
1
src/types/litegraph-augmentation.d.ts
vendored
@@ -73,7 +73,6 @@ declare module '@comfyorg/litegraph' {
|
||||
convertToNodes?(): LGraphNode[]
|
||||
recreate?(): Promise<LGraphNode>
|
||||
refreshComboInNode?(defs: Record<string, ComfyNodeDef>)
|
||||
applyToGraph?(extraLinks?: LLink[]): void
|
||||
updateLink?(link: LLink): LLink | null
|
||||
onExecutionStart?(): unknown
|
||||
/**
|
||||
|
||||
@@ -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()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user