fix: 刷新节点后重新加载图像数据
This commit is contained in:
+8
-1
@@ -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);
|
||||
}
|
||||
};
|
||||
|
||||
// 鼠标事件
|
||||
|
||||
Reference in New Issue
Block a user