Skip to content

Commit

Permalink
Merge branch 'reroute-disconnect-fix' of https://github.com/ssitu/Com…
Browse files Browse the repository at this point in the history
  • Loading branch information
comfyanonymous committed Jun 21, 2023
2 parents 51581db + 6f54b01 commit 6f0f8aa
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions web/extensions/core/rerouteNode.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,13 @@ app.registerExtension({
// Ignore wildcard nodes as these will be updated to real types
const types = new Set(this.outputs[0].links.map((l) => app.graph.links[l].type).filter((t) => t !== "*"));
if (types.size > 1) {
const linksToDisconnect = [];
for (let i = 0; i < this.outputs[0].links.length - 1; i++) {
const linkId = this.outputs[0].links[i];
const link = app.graph.links[linkId];
linksToDisconnect.push(link);
}
for (const link of linksToDisconnect) {
const node = app.graph.getNodeById(link.target_id);
node.disconnectInput(link.target_slot);
}
Expand Down

0 comments on commit 6f0f8aa

Please sign in to comment.