diff --git a/src/scripts/app.ts b/src/scripts/app.ts index 4c953b998b..7e7bbb57f4 100644 --- a/src/scripts/app.ts +++ b/src/scripts/app.ts @@ -657,7 +657,7 @@ export class ComfyApp { } } - node.prototype.onDrawBackground = function (ctx) { + function unsafeDrawBackground(ctx) { if (!this.flags.collapsed) { let imgURLs = [] let imagesChanged = false @@ -992,6 +992,14 @@ export class ComfyApp { } } } + + node.prototype.onDrawBackground = function (ctx) { + try { + unsafeDrawBackground.call(this, ctx) + } catch (error) { + console.error('Error drawing node background', error) + } + } } /**