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
eccc9e64
Commit
eccc9e64
authored
Dec 09, 2023
by
comfyanonymous
Browse files
Merge branch 'group-reroute-fix' of
https://github.com/pythongosssss/ComfyUI
parents
da74e3bb
080ef75c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
35 additions
and
0 deletions
+35
-0
tests-ui/tests/groupNode.test.js
tests-ui/tests/groupNode.test.js
+31
-0
web/extensions/core/groupNode.js
web/extensions/core/groupNode.js
+4
-0
No files found.
tests-ui/tests/groupNode.test.js
View file @
eccc9e64
...
...
@@ -383,6 +383,37 @@ describe("group node", () => {
getOutput
([
nodes
.
pos
.
id
,
nodes
.
neg
.
id
,
nodes
.
empty
.
id
,
nodes
.
sampler
.
id
])
);
});
test
(
"
groups can connect to each other via internal reroutes
"
,
async
()
=>
{
const
{
ez
,
graph
,
app
}
=
await
start
();
const
latent
=
ez
.
EmptyLatentImage
();
const
vae
=
ez
.
VAELoader
();
const
latentReroute
=
ez
.
Reroute
();
const
vaeReroute
=
ez
.
Reroute
();
latent
.
outputs
[
0
].
connectTo
(
latentReroute
.
inputs
[
0
]);
vae
.
outputs
[
0
].
connectTo
(
vaeReroute
.
inputs
[
0
]);
const
group1
=
await
convertToGroup
(
app
,
graph
,
"
test
"
,
[
latentReroute
,
vaeReroute
]);
group1
.
menu
.
Clone
.
call
();
expect
(
app
.
graph
.
_nodes
).
toHaveLength
(
4
);
const
group2
=
graph
.
find
(
app
.
graph
.
_nodes
[
3
]);
expect
(
group2
.
node
.
type
).
toEqual
(
"
workflow/test
"
);
expect
(
group2
.
id
).
not
.
toEqual
(
group1
.
id
);
group1
.
outputs
.
VAE
.
connectTo
(
group2
.
inputs
.
VAE
);
group1
.
outputs
.
LATENT
.
connectTo
(
group2
.
inputs
.
LATENT
);
const
decode
=
ez
.
VAEDecode
(
group2
.
outputs
.
LATENT
,
group2
.
outputs
.
VAE
);
const
preview
=
ez
.
PreviewImage
(
decode
.
outputs
[
0
]);
expect
((
await
graph
.
toPrompt
()).
output
).
toEqual
({
[
latent
.
id
]:
{
inputs
:
{
width
:
512
,
height
:
512
,
batch_size
:
1
},
class_type
:
"
EmptyLatentImage
"
},
[
vae
.
id
]:
{
inputs
:
{
vae_name
:
"
vae1.safetensors
"
},
class_type
:
"
VAELoader
"
},
[
decode
.
id
]:
{
inputs
:
{
samples
:
[
latent
.
id
+
""
,
0
],
vae
:
[
vae
.
id
+
""
,
0
]
},
class_type
:
"
VAEDecode
"
},
[
preview
.
id
]:
{
inputs
:
{
images
:
[
decode
.
id
+
""
,
0
]
},
class_type
:
"
PreviewImage
"
},
});
});
test
(
"
displays generated image on group node
"
,
async
()
=>
{
const
{
ez
,
graph
,
app
}
=
await
start
();
const
nodes
=
createDefaultWorkflow
(
ez
,
graph
);
...
...
web/extensions/core/groupNode.js
View file @
eccc9e64
...
...
@@ -602,6 +602,10 @@ export class GroupNodeHandler {
innerNode = innerNode.getInputNode(0);
}
if (l && GroupNodeHandler.isGroupNode(innerNode)) {
return innerNode.updateLink(l);
}
link.origin_id = innerNode.id;
link.origin_slot = l?.origin_slot ?? output.slot;
return link;
...
...
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