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.
This commit is contained in:
Nuked
2023-11-14 12:52:57 +07:00
committed by GitHub
parent 97404944f5
commit aed11f1196
+9 -7
View File
@@ -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) {