Isolate comparer node classes to avoid overwrite

Bump package version to 1.8.5 and ensure each image comparer node gets its own override class. Added NODE_OVERRIDE_CLASSES map and changed MxdImageComparer.setUp to create/cache a per-node class (by nodeData.name), assign nodeData to it, and register that bound class—preventing static nodeData from being overwritten when multiple comparer nodes are registered.
This commit is contained in:
Maxed-Out-99
2026-02-23 16:10:18 -08:00
parent 3ca3859588
commit 07d4c7fa90
2 changed files with 10 additions and 2 deletions
+1 -1
View File
@@ -1,7 +1,7 @@
[project]
name = "ComfyUI-MaxedOut"
description = "Custom ComfyUI nodes used in Maxed Out workflows (SDXL, Flux, Wan 2.2, etc.)"
version = "1.8.3"
version = "1.8.5"
license = {file = "LICENSE"}
# classifiers = [
# # For OS-independent nodes (works on all operating systems)
+9 -1
View File
@@ -9,6 +9,7 @@ const NODE_TYPE_STRINGS = new Set([
"Video Comparer MXD",
"VideoComparerMXD",
]);
const NODE_OVERRIDE_CLASSES = new Map();
// --- Canvas Utilities (Inline) ---
function measureText(ctx, str) {
@@ -589,7 +590,14 @@ class MxdImageComparer extends MxdBaseServerNode {
</ul>`;
}
static setUp(comfyClass, nodeData) {
MxdBaseServerNode.registerForOverride(comfyClass, nodeData, MxdImageComparer);
let boundClass = NODE_OVERRIDE_CLASSES.get(nodeData.name);
if (!boundClass) {
// Each comparer node needs its own class so static nodeData does not get overwritten.
boundClass = class extends MxdImageComparer {};
NODE_OVERRIDE_CLASSES.set(nodeData.name, boundClass);
}
boundClass.nodeData = nodeData;
MxdBaseServerNode.registerForOverride(comfyClass, nodeData, boundClass);
}
static onRegisteredForOverride(comfyClass) {
addConnectionLayoutSupport(MxdImageComparer, app, [