From 6a27517db6e37edc9baf0f6ca6002a5e6136227b Mon Sep 17 00:00:00 2001 From: shanexi Date: Mon, 21 Oct 2024 17:33:59 +0800 Subject: [PATCH] Convert to ShellAgent with default value assigned --- web/shellagent.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/web/shellagent.js b/web/shellagent.js index 662d9b6..e21a7d1 100644 --- a/web/shellagent.js +++ b/web/shellagent.js @@ -184,11 +184,9 @@ app.registerExtension({ callback: () => { this.convertWidgetToInput(w); const node = addNode("ShellAgentPluginInputText", this, { before: true }); - // if (nodeData.name === 'CLIPTextEncode') { + const dvn = node.widgets.find(w => w.name === 'default_value') + dvn.value = w.value; node.connect(0, this, this.inputs.length - 1); - // } else { - // window.alert('[ShellAgent] Unsupported quick operation.') - // } } }) } @@ -198,6 +196,8 @@ app.registerExtension({ callback: () => { this.convertWidgetToInput(w); const node = addNode("ShellAgentPluginInputInteger", this, { before: true }); + const dvn = node.widgets.find(w => w.name === 'default_value') + dvn.value = w.value; node.connect(0, this, this.inputs.length - 1); } }) @@ -207,6 +207,8 @@ app.registerExtension({ callback: () => { this.convertWidgetToInput(w); const node = addNode("ShellAgentPluginInputFloat", this, { before: true }); + const dvn = node.widgets.find(w => w.name === 'default_value') + dvn.value = w.value; node.connect(0, this, this.inputs.length - 1); } })