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
e5318d91
Commit
e5318d91
authored
Mar 13, 2023
by
pythongosssss
Browse files
Combo support detault value
parent
6db777b3
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
1 deletion
+5
-1
web/scripts/app.js
web/scripts/app.js
+5
-1
No files found.
web/scripts/app.js
View file @
e5318d91
...
@@ -497,7 +497,11 @@ class ComfyApp {
...
@@ -497,7 +497,11 @@ class ComfyApp {
if
(
Array
.
isArray
(
type
))
{
if
(
Array
.
isArray
(
type
))
{
// Enums e.g. latent rotation
// Enums e.g. latent rotation
this
.
addWidget
(
"
combo
"
,
inputName
,
type
[
0
],
()
=>
{},
{
values
:
type
});
let
defaultValue
=
type
[
0
];
if
(
inputData
[
1
]
&&
inputData
[
1
].
default
)
{
defaultValue
=
inputData
[
1
].
default
;
}
this
.
addWidget
(
"
combo
"
,
inputName
,
defaultValue
,
()
=>
{},
{
values
:
type
});
}
else
if
(
`
${
type
}
:
${
inputName
}
`
in
widgets
)
{
}
else
if
(
`
${
type
}
:
${
inputName
}
`
in
widgets
)
{
// Support custom widgets by Type:Name
// Support custom widgets by Type:Name
Object
.
assign
(
config
,
widgets
[
`
${
type
}
:
${
inputName
}
`
](
this
,
inputName
,
inputData
,
app
)
||
{});
Object
.
assign
(
config
,
widgets
[
`
${
type
}
:
${
inputName
}
`
](
this
,
inputName
,
inputData
,
app
)
||
{});
...
...
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