mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-04-27 09:45:13 +00:00
[Refactor] Deprecate ComfyApp.progress (#2065)
This commit is contained in:
@@ -127,8 +127,6 @@ export class ComfyApp {
|
|||||||
lastNodeErrors: any[] | null
|
lastNodeErrors: any[] | null
|
||||||
/** @type {ExecutionErrorWsMessage} */
|
/** @type {ExecutionErrorWsMessage} */
|
||||||
lastExecutionError: { node_id?: NodeId } | null
|
lastExecutionError: { node_id?: NodeId } | null
|
||||||
/** @type {ProgressWsMessage} */
|
|
||||||
progress: { value?: number; max?: number } | null
|
|
||||||
configuringGraph: boolean
|
configuringGraph: boolean
|
||||||
ctx: CanvasRenderingContext2D
|
ctx: CanvasRenderingContext2D
|
||||||
bodyTop: HTMLElement
|
bodyTop: HTMLElement
|
||||||
@@ -187,6 +185,14 @@ export class ComfyApp {
|
|||||||
return useExtensionStore().extensions
|
return useExtensionStore().extensions
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The progress on the current executing node, if the node reports any.
|
||||||
|
* @deprecated Use useExecutionStore().executingNodeProgress instead
|
||||||
|
*/
|
||||||
|
get progress() {
|
||||||
|
return useExecutionStore()._executingNodeProgress
|
||||||
|
}
|
||||||
|
|
||||||
constructor() {
|
constructor() {
|
||||||
this.vueAppReady = false
|
this.vueAppReady = false
|
||||||
this.ui = new ComfyUI(this)
|
this.ui = new ComfyUI(this)
|
||||||
@@ -1484,12 +1490,10 @@ export class ComfyApp {
|
|||||||
})
|
})
|
||||||
|
|
||||||
api.addEventListener('progress', ({ detail }) => {
|
api.addEventListener('progress', ({ detail }) => {
|
||||||
this.progress = detail
|
|
||||||
this.graph.setDirtyCanvas(true, false)
|
this.graph.setDirtyCanvas(true, false)
|
||||||
})
|
})
|
||||||
|
|
||||||
api.addEventListener('executing', ({ detail }) => {
|
api.addEventListener('executing', ({ detail }) => {
|
||||||
this.progress = null
|
|
||||||
this.graph.setDirtyCanvas(true, false)
|
this.graph.setDirtyCanvas(true, false)
|
||||||
this.revokePreviews(this.runningNodeId)
|
this.revokePreviews(this.runningNodeId)
|
||||||
delete this.nodePreviewImages[this.runningNodeId]
|
delete this.nodePreviewImages[this.runningNodeId]
|
||||||
|
|||||||
@@ -192,6 +192,8 @@ export const useExecutionStore = defineStore('execution', () => {
|
|||||||
executingNodeProgress,
|
executingNodeProgress,
|
||||||
bindExecutionEvents,
|
bindExecutionEvents,
|
||||||
unbindExecutionEvents,
|
unbindExecutionEvents,
|
||||||
storePrompt
|
storePrompt,
|
||||||
|
// Raw executing progress data for backward compatibility in ComfyApp.
|
||||||
|
_executingNodeProgress
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user