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
0782ac2a
Commit
0782ac2a
authored
Sep 08, 2023
by
Chris
Browse files
defaultInput
parent
9261587d
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
1 deletion
+5
-1
web/extensions/core/widgetInputs.js
web/extensions/core/widgetInputs.js
+1
-1
web/scripts/app.js
web/scripts/app.js
+4
-0
No files found.
web/extensions/core/widgetInputs.js
View file @
0782ac2a
...
@@ -142,7 +142,7 @@ app.registerExtension({
...
@@ -142,7 +142,7 @@ app.registerExtension({
const
r
=
origOnNodeCreated
?
origOnNodeCreated
.
apply
(
this
)
:
undefined
;
const
r
=
origOnNodeCreated
?
origOnNodeCreated
.
apply
(
this
)
:
undefined
;
if
(
this
.
widgets
)
{
if
(
this
.
widgets
)
{
for
(
const
w
of
this
.
widgets
)
{
for
(
const
w
of
this
.
widgets
)
{
if
(
w
?.
options
?.
forceInput
)
{
if
(
w
?.
options
?.
forceInput
||
w
?.
options
?.
defaultInput
)
{
const
config
=
nodeData
?.
input
?.
required
[
w
.
name
]
||
nodeData
?.
input
?.
optional
?.[
w
.
name
]
||
[
w
.
type
,
w
.
options
||
{}];
const
config
=
nodeData
?.
input
?.
required
[
w
.
name
]
||
nodeData
?.
input
?.
optional
?.[
w
.
name
]
||
[
w
.
type
,
w
.
options
||
{}];
convertToInput
(
this
,
w
,
config
);
convertToInput
(
this
,
w
,
config
);
}
}
...
...
web/scripts/app.js
View file @
0782ac2a
...
@@ -1248,6 +1248,10 @@ export class ComfyApp {
...
@@ -1248,6 +1248,10 @@ export class ComfyApp {
if
(
!
config
.
widget
.
options
)
config
.
widget
.
options
=
{};
if
(
!
config
.
widget
.
options
)
config
.
widget
.
options
=
{};
config
.
widget
.
options
.
forceInput
=
inputData
[
1
].
forceInput
;
config
.
widget
.
options
.
forceInput
=
inputData
[
1
].
forceInput
;
}
}
if
(
widgetCreated
&&
inputData
[
1
]?.
defaultInput
&&
config
?.
widget
)
{
if
(
!
config
.
widget
.
options
)
config
.
widget
.
options
=
{};
config
.
widget
.
options
.
defaultInput
=
inputData
[
1
].
defaultInput
;
}
}
}
for
(
const
o
in
nodeData
[
"
output
"
])
{
for
(
const
o
in
nodeData
[
"
output
"
])
{
...
...
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