[Refactor] Use LGraphNode.progress API (#3281)

This commit is contained in:
Chenlei Hu
2025-03-30 18:13:31 -04:00
committed by GitHub
parent a57e60d60a
commit 10bed33383
4 changed files with 67 additions and 25 deletions

View File

@@ -562,27 +562,15 @@ export class ComfyApp {
LGraphCanvas.prototype.drawNodeShape = function (
node,
ctx,
size,
_size,
_fgcolor,
bgcolor
_bgcolor
) {
// @ts-expect-error fixme ts strict error
const res = origDrawNodeShape.apply(this, arguments)
const nodeErrors = self.lastNodeErrors?.[node.id]
// @ts-expect-error fixme ts strict error
if (self.progress && node.id === +self.runningNodeId) {
ctx.fillStyle = 'green'
ctx.fillRect(
0,
0,
size[0] * (self.progress.value / self.progress.max),
6
)
ctx.fillStyle = bgcolor
}
// Highlight inputs that failed validation
if (nodeErrors) {
ctx.lineWidth = 2