fix: 刷新节点后重新加载图像数据

This commit is contained in:
InpaintRegionEditor Dev
2026-03-03 20:45:06 +08:00
parent 5d3cf16bac
commit b6f9256d76
+8 -1
View File
@@ -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);
}
};
// 鼠标事件