"git@developer.sourcefind.cn:gaoqiong/composable_kernel.git" did not exist on "9e11d3b83e480ce422d1d0b66c57b10b0a11b688"
Commit f12ec559 authored by comfyanonymous's avatar comfyanonymous
Browse files

Allow boolean widgets to have no options dict.

parent 4aeef781
...@@ -305,14 +305,23 @@ export const ComfyWidgets = { ...@@ -305,14 +305,23 @@ export const ComfyWidgets = {
}; };
}, },
BOOLEAN(node, inputName, inputData) { BOOLEAN(node, inputName, inputData) {
let defaultVal = inputData[1]["default"]; let defaultVal = false;
let options = {};
if (inputData[1]) {
if (inputData[1].default)
defaultVal = inputData[1].default;
if (inputData[1].label_on)
options["on"] = inputData[1].label_on;
if (inputData[1].label_off)
options["off"] = inputData[1].label_off;
}
return { return {
widget: node.addWidget( widget: node.addWidget(
"toggle", "toggle",
inputName, inputName,
defaultVal, defaultVal,
() => {}, () => {},
{"on": inputData[1].label_on, "off": inputData[1].label_off} options,
) )
}; };
}, },
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment