Replace ComfyApp.runningNodeId with executionStore.executingNodeId (#828)

* Replace ComfyApp.runningNodeId with executionStore.executingNodeId

* nit
This commit is contained in:
Chenlei Hu
2024-09-14 16:01:37 +09:00
committed by GitHub
parent f983f42c45
commit 588cfeca4b
3 changed files with 14 additions and 12 deletions

View File

@@ -52,6 +52,7 @@ import { ModelStore, useModelStore } from '@/stores/modelStore'
import type { ToastMessageOptions } from 'primevue/toast'
import { useWorkspaceStore } from '@/stores/workspaceStateStore'
import { ComfyLGraphNode } from '@/types/comfyLGraphNode'
import { useExecutionStore } from '@/stores/executionStore'
export const ANIM_PREVIEW_WIDGET = '$$comfy_animation_preview'
@@ -119,7 +120,6 @@ export class ComfyApp {
// x, y, scale
zoom_drag_start: [number, number, number] | null
lastNodeErrors: any[] | null
runningNodeId: number | null
lastExecutionError: { node_id: number } | null
progress: { value: number; max: number } | null
configuringGraph: boolean
@@ -136,6 +136,12 @@ export class ComfyApp {
canvasContainer: HTMLElement
menu: ComfyAppMenu
// @deprecated
// Use useExecutionStore().executingNodeId instead
get runningNodeId(): string | null {
return useExecutionStore().executingNodeId
}
constructor() {
this.vueAppReady = false
this.ui = new ComfyUI(this)
@@ -1597,7 +1603,6 @@ export class ComfyApp {
api.addEventListener('executing', ({ detail }) => {
this.progress = null
this.runningNodeId = detail
this.graph.setDirtyCanvas(true, false)
delete this.nodePreviewImages[this.runningNodeId]
})
@@ -1626,7 +1631,6 @@ export class ComfyApp {
})
api.addEventListener('execution_start', ({ detail }) => {
this.runningNodeId = null
this.lastExecutionError = null
// @ts-expect-error
this.graph._nodes.forEach((node) => {
@@ -2948,7 +2952,6 @@ export class ComfyApp {
this.nodePreviewImages = {}
this.lastNodeErrors = null
this.lastExecutionError = null
this.runningNodeId = null
}
addNodeOnGraph(