From aed11f11965f9a183bdebe7cf572dc591b98b151 Mon Sep 17 00:00:00 2001 From: Nuked Date: Tue, 14 Nov 2023 06:52:57 +0100 Subject: [PATCH] Fixed code to avoid conflict with (#64) Fixed code to avoid conflict with other nodes. This code will be executed only inside the AnimateDiffCombine node now. --- web/js/vid_preview.js | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/web/js/vid_preview.js b/web/js/vid_preview.js index fe90c62..bf524ba 100644 --- a/web/js/vid_preview.js +++ b/web/js/vid_preview.js @@ -99,15 +99,17 @@ const videoPreview = { name: "AnimateDiff.VideoPreview", async beforeRegisterNodeDef(nodeType, nodeData, app) { const onExecuted = nodeType.prototype.onExecuted; - nodeType.prototype.onExecuted = function (message) { - const r = onExecuted ? onExecuted.apply(this, message) : undefined; + if (nodeData.name === "AnimateDiffCombine") { + nodeType.prototype.onExecuted = function (message) { + const r = onExecuted ? onExecuted.apply(this, message) : undefined; - if (message?.videos) { - this.videos = message.videos; - } + if (message?.videos) { + this.videos = message.videos; + } - return r; - }; + return r; + }; + } const onDrawBackground = nodeType.prototype.onDrawBackground; nodeType.prototype.onDrawBackground = function (ctx) {