Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
chenpangpang
ComfyUI
Commits
f12ec559
Commit
f12ec559
authored
Nov 13, 2023
by
comfyanonymous
Browse files
Allow boolean widgets to have no options dict.
parent
4aeef781
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
2 deletions
+11
-2
web/scripts/widgets.js
web/scripts/widgets.js
+11
-2
No files found.
web/scripts/widgets.js
View file @
f12ec559
...
...
@@ -305,14 +305,23 @@ export const ComfyWidgets = {
};
},
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
{
widget
:
node
.
addWidget
(
"
toggle
"
,
inputName
,
defaultVal
,
()
=>
{},
{
"
on
"
:
inputData
[
1
].
label_on
,
"
off
"
:
inputData
[
1
].
label_off
}
options
,
)
};
},
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment