issues with rgthree-comfy/reroute.js
Hello guys, As the screenshot shows, there is a problem, or rather several, with one of your scripts. To be able to load a workflow and install the missing nodes, I must first disable rgthree, install the repos, and then re-enable rgthree. Can you verify what's happening with this script? Thanks in advance and especially thank you for your work.
Looking at the error I think this is a duplicate of https://github.com/rgthree/rgthree-comfy/issues/453 which was a bug in ComfyUI filed here: https://github.com/Comfy-Org/ComfyUI_frontend/issues/3248
I think the fix has made it's way to ComfyUI main, tough. Have you updated your ComfyUI and it's Frontend recently?
hey sorry i seem to have created an issue duplicate: https://github.com/rgthree/rgthree-comfy/issues/484#issue-3034593281 ig it didn't come up in my search because your error was in screenshot form.
anyway i made this edit it in "reroute.js" file:
}
onConnectionsChange(type, _slotIndex, connected, _link_info, _ioSlot) {
if (connected && type === LiteGraph.OUTPUT) {
const types = new Set(
this.outputs[0].links
.map((l) => app.graph.links[l]) // Get the link object first
.filter((link) => link) // Ensure the link object exists
.map((link) => link.type) // Now get the type
.filter((t) => t !== "*"),
);
if (types.size > 1) {
const linksToDisconnect = [];
// Iterate backwards when removing items to avoid index issues
for (let i = this.outputs[0].links.length - 2; i >= 0; i--) {
const linkId = this.outputs[0].links[i];
const link = app.graph.links[linkId];
// Add an extra check here too, just in case.
if (link) {
linksToDisconnect.push(link);
}
}
for (const link of linksToDisconnect) {
const node = app.graph.getNodeById(link.target_id);
node.disconnectInput(link.target_slot);
}
}
}
this.scheduleStabilize();
}
that seems to have fixed it but no idea if this (vibe)code is any good
hey sorry i seem to have created an issue duplicate: #484 (comment) ig it didn't come up in my search because your error was in screenshot form.
anyway i made this edit it in "reroute.js" file:
} onConnectionsChange(type, _slotIndex, connected, _link_info, _ioSlot) { if (connected && type === LiteGraph.OUTPUT) { const types = new Set( this.outputs[0].links .map((l) => app.graph.links[l]) // Get the link object first .filter((link) => link) // Ensure the link object exists .map((link) => link.type) // Now get the type .filter((t) => t !== "*"), ); if (types.size > 1) { const linksToDisconnect = []; // Iterate backwards when removing items to avoid index issues for (let i = this.outputs[0].links.length - 2; i >= 0; i--) { const linkId = this.outputs[0].links[i]; const link = app.graph.links[linkId]; // Add an extra check here too, just in case. if (link) { linksToDisconnect.push(link); } } for (const link of linksToDisconnect) { const node = app.graph.getNodeById(link.target_id); node.disconnectInput(link.target_slot); } } } this.scheduleStabilize(); }that seems to have fixed it but no idea if this (vibe)code is any good
@tazztone try to update your ComfyUI Frontend (it needs to be manually updated, its different from updating ComfyUi itself) instead of changing the custom node code. It should be fixed. IDK, you should try it. I don't have this error on the current version.
Is this still happening for anyone on the latest Cupdated ComfyUI? There was a bug in ComfyUI_frontend that had its fix in late march which times well to the original filing here. See https://github.com/Comfy-Org/ComfyUI_frontend/issues/3248