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
4b0b5165
Commit
4b0b5165
authored
Jun 09, 2023
by
comfyanonymous
Browse files
Add code to handle primitive nodes connected to reroute nodes.
Revert last commit because I noticed it broke a few things.
parent
8e14c46a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
2 deletions
+16
-2
web/extensions/core/widgetInputs.js
web/extensions/core/widgetInputs.js
+16
-2
No files found.
web/extensions/core/widgetInputs.js
View file @
4b0b5165
...
@@ -200,8 +200,23 @@ app.registerExtension({
...
@@ -200,8 +200,23 @@ app.registerExtension({
applyToGraph
()
{
applyToGraph
()
{
if
(
!
this
.
outputs
[
0
].
links
?.
length
)
return
;
if
(
!
this
.
outputs
[
0
].
links
?.
length
)
return
;
function
get_links
(
node
)
{
let
links
=
[];
for
(
const
l
of
node
.
outputs
[
0
].
links
)
{
const
linkInfo
=
app
.
graph
.
links
[
l
];
const
n
=
node
.
graph
.
getNodeById
(
linkInfo
.
target_id
);
if
(
n
.
type
==
"
Reroute
"
)
{
links
=
links
.
concat
(
get_links
(
n
));
}
else
{
links
.
push
(
l
);
}
}
return
links
;
}
let
links
=
get_links
(
this
);
// For each output link copy our value over the original widget value
// For each output link copy our value over the original widget value
for
(
const
l
of
this
.
outputs
[
0
].
links
)
{
for
(
const
l
of
links
)
{
const
linkInfo
=
app
.
graph
.
links
[
l
];
const
linkInfo
=
app
.
graph
.
links
[
l
];
const
node
=
this
.
graph
.
getNodeById
(
linkInfo
.
target_id
);
const
node
=
this
.
graph
.
getNodeById
(
linkInfo
.
target_id
);
const
input
=
node
.
inputs
[
linkInfo
.
target_slot
];
const
input
=
node
.
inputs
[
linkInfo
.
target_slot
];
...
@@ -240,7 +255,6 @@ app.registerExtension({
...
@@ -240,7 +255,6 @@ app.registerExtension({
// No widget, we cant connect
// No widget, we cant connect
if
(
!
input
.
widget
)
{
if
(
!
input
.
widget
)
{
if
(
this
.
outputs
[
0
]?.
type
!=
'
*
'
&&
target_node
.
type
==
"
Reroute
"
)
return
true
;
if
(
!
(
input
.
type
in
ComfyWidgets
))
return
false
;
if
(
!
(
input
.
type
in
ComfyWidgets
))
return
false
;
}
}
...
...
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