From 58e978fc6f9dd6edfb91356fa18d353ed172df52 Mon Sep 17 00:00:00 2001 From: kk8bit Date: Sun, 20 Sep 2026 17:31:03 +0800 Subject: [PATCH] Fix ab Images extension throwing on frontend 1.53 LGraphNode.prototype now defines title/type as accessors. Object.assign uses [[Set]], so assigning a plain object containing those keys onto nodeType.prototype invoked the inherited setter with `this` bound to the prototype, which has no _state, and threw a TypeError. The throw aborted beforeRegisterNodeDef, so none of the node's methods (onExecuted, onResize, getExtraMenuOptions, onDrawForeground, onMouseMove, onNodeCreated) were ever installed. title and type are set by ComfyUI's node registration anyway, so drop them from the assigned object. The hardcoded title also shadowed the localized display name. --- web/ab_images.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/web/ab_images.js b/web/ab_images.js index c0dcfb6..84d9554 100644 --- a/web/ab_images.js +++ b/web/ab_images.js @@ -12,9 +12,11 @@ app.registerExtension({ async beforeRegisterNodeDef(nodeType, nodeData) { if (nodeData.name !== "AB_Images") return; + // 不要把 title/type 放进这个对象:它会被 Object.assign 到 nodeType.prototype, + // 而 LGraphNode.prototype 上的 title/type 是 accessor,Object.assign 会触发继承的 + // setter(此时 this 是 prototype,没有 _state),直接抛 TypeError。 + // 两者本来也由 ComfyUI 的节点注册负责,这里设置无效。 const ABImagesNode = { - title: "AB Images", - type: "AB_Images", imgs: [], isPointerOver: false, pointerPos: [0, 0],