From b6f9256d76e3d994952b1c3cf34009ab67a3f014 Mon Sep 17 00:00:00 2001 From: InpaintRegionEditor Dev Date: Tue, 3 Mar 2026 20:45:06 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=88=B7=E6=96=B0=E8=8A=82=E7=82=B9?= =?UTF-8?q?=E5=90=8E=E9=87=8D=E6=96=B0=E5=8A=A0=E8=BD=BD=E5=9B=BE=E5=83=8F?= =?UTF-8?q?=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- web/extension.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) 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); + } }; // 鼠标事件