Convert to ShellAgent with default value assigned

This commit is contained in:
shanexi
2024-10-21 17:33:59 +08:00
parent 68e5dad893
commit 6a27517db6
+6 -4
View File
@@ -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);
}
})