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
2dc7257e
Commit
2dc7257e
authored
Apr 08, 2023
by
omar92
Browse files
Allow connect premitive Node to "comfyiUI-nodes that have forceInput setting"
parent
ebd7f9bf
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
4 deletions
+15
-4
web/extensions/core/widgetInputs.js
web/extensions/core/widgetInputs.js
+15
-4
No files found.
web/extensions/core/widgetInputs.js
View file @
2dc7257e
...
...
@@ -233,7 +233,9 @@ app.registerExtension({
// Fires before the link is made allowing us to reject it if it isn't valid
// No widget, we cant connect
if
(
!
input
.
widget
)
return
false
;
if
(
!
input
.
widget
)
{
if
(
!
(
input
.
type
in
ComfyWidgets
))
return
false
;
}
if
(
this
.
outputs
[
slot
].
links
?.
length
)
{
return
this
.
#
isValidConnection
(
input
);
...
...
@@ -252,9 +254,18 @@ app.registerExtension({
const
input
=
theirNode
.
inputs
[
link
.
target_slot
];
if
(
!
input
)
return
;
const
widget
=
input
.
widget
;
const
{
type
,
linkType
}
=
getWidgetType
(
widget
.
config
);
var
_widget
;
if
(
!
input
.
widget
)
{
if
(
!
(
input
.
type
in
ComfyWidgets
))
return
;
_widget
=
{
"
name
"
:
input
.
name
,
"
config
"
:
[
input
.
type
,
{}]
}
//fake widget
}
else
{
_widget
=
input
.
widget
;
}
const
widget
=
_widget
;
const
{
type
,
linkType
}
=
getWidgetType
(
widget
.
config
);
console
.
log
({
"
input
"
:
input
});
// Update our output to restrict to the widget type
this
.
outputs
[
0
].
type
=
linkType
;
this
.
outputs
[
0
].
name
=
type
;
...
...
@@ -274,7 +285,7 @@ app.registerExtension({
if
(
type
in
ComfyWidgets
)
{
widget
=
(
ComfyWidgets
[
type
](
this
,
"
value
"
,
inputData
,
app
)
||
{}).
widget
;
}
else
{
widget
=
this
.
addWidget
(
type
,
"
value
"
,
null
,
()
=>
{},
{});
widget
=
this
.
addWidget
(
type
,
"
value
"
,
null
,
()
=>
{
},
{});
}
if
(
node
?.
widgets
&&
widget
)
{
...
...
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