Fix change tracker count desync on error (#1555)

* Add TS types

* Ensure changeTracker works after exceptions

Wraps all code between before/after change calls in try/finally blocks
This commit is contained in:
filtered
2024-11-16 08:03:21 +11:00
committed by GitHub
parent 8af016ffc1
commit dde0291add
4 changed files with 83 additions and 65 deletions

View File

@@ -1,6 +1,7 @@
import '@comfyorg/litegraph'
import type { ComfyNodeDef } from '@/types/apiTypes'
import type { LLink } from '@comfyorg/litegraph'
import type { NodeId } from './comfyWorkflow'
/**
* ComfyUI extensions of litegraph
@@ -26,8 +27,17 @@ declare module '@comfyorg/litegraph' {
onExecuted?(output: any): void
onNodeCreated?(this: LGraphNode): void
setInnerNodes?(nodes: LGraphNode[]): void
// TODO: Requires several coercion changes to runtime code.
getInnerNodes?() // : LGraphNode[]
convertToNodes?(): LGraphNode[]
recreate?(): Promise<LGraphNode>
refreshComboInNode?(defs: Record<string, ComfyNodeDef>)
applyToGraph?(extraLinks?: LLink[]): void
updateLink?(link: LLink): LLink | null
onExecutionStart?(): unknown
index?: number
runningInternalNodeId?: NodeId
comfyClass?: string