diff --git a/web/extension.js b/web/extension.js index 2c10314..a0e8682 100644 --- a/web/extension.js +++ b/web/extension.js @@ -1352,7 +1352,7 @@ app.registerExtension({ } }; - // 从工作流加载时确保 widget 存在 + // 从工作流加载时确保 widget 存在,并重新加载图像 const origConfigure = nodeType.prototype.configure; nodeType.prototype.configure = function(info) { if (origConfigure) origConfigure.apply(this, arguments); @@ -1365,6 +1365,13 @@ app.registerExtension({ serialize: true }); } + + // 刷新节点后重新加载图像 + const imgW = node.widgets?.find(w => w.name === "image"); + if (imgW?.value) { + // 延迟加载,确保节点完全配置好 + setTimeout(() => loadImageAndDetectMask(node, imgW.value), 0); + } }; // 鼠标事件