mirror of
https://github.com/comfyanonymous/ComfyUI.git
synced 2025-01-11 02:15:17 +00:00
Simplify and fix bug with following virtual nodes
courtesy of someanon
This commit is contained in:
parent
37b70d7987
commit
aff1e3936a
@ -606,24 +606,10 @@ class ComfyApp {
|
|||||||
for (let i in node.inputs) {
|
for (let i in node.inputs) {
|
||||||
let parent = node.getInputNode(i);
|
let parent = node.getInputNode(i);
|
||||||
if (parent) {
|
if (parent) {
|
||||||
let link;
|
let link = node.getInputLink(i);
|
||||||
if (parent.isVirtualNode) {
|
while (parent && parent.isVirtualNode) {
|
||||||
// Follow the path of virtual nodes until we reach the first real one
|
link = parent.getInputLink(link.origin_slot);
|
||||||
while (parent != null) {
|
parent = parent.getInputNode(link.origin_slot);
|
||||||
link = parent.getInputLink(0);
|
|
||||||
if (link) {
|
|
||||||
const from = graph.getNodeById(link.origin_id);
|
|
||||||
if (from.isVirtualNode) {
|
|
||||||
parent = from;
|
|
||||||
} else {
|
|
||||||
parent = null;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
parent = null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
link = node.getInputLink(i);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (link) {
|
if (link) {
|
||||||
|
Loading…
Reference in New Issue
Block a user