mirror of
https://github.com/Comfy-Org/ComfyUI-Manager.git
synced 2026-11-04 23:37:31 +00:00
[GH-ISSUE #3126] "Fix node (recreate)" throws on frontend 1.47+ (string node ids), leaves duplicate node on canvas #1103
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Comfy-Org/ComfyUI-Manager#1103
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @EnragedAntelope on GitHub (Aug 4, 2026).
Original GitHub issue: https://github.com/Comfy-Org/ComfyUI-Manager/issues/3126
What happens
Right-clicking a node with a connected input and choosing "Fix node (recreate)" throws instead of finishing, and the graph ends up with two copies of the node: the original (still wired) and an unconnected replacement stacked on top of it.
Console:
Root cause
In
js/node_fixer.js,node_info_copy()reconnects inputs like this:dest.idis passed instead ofdestitself. Node ids are strings on current frontend versions, andLGraphNode.connect()only resolves its second argument to a node when it's a number — a string id sails past that resolution andconnect()ends up callingfindInputSloton the id string, which throws.The callback also creates the replacement node and copies data into it before removing the original:
Since the exception happens inside
node_info_copy,graph.remove(this)on the next line never runs, so the original node is never cleaned up. That's the duplicate.Not specific to any one custom node pack — this happens to any node with a connected input.
Suggested fix
node_info_copy, passdest(the node object) toconnect(), notdest.id. Same for the output-side loop below it, which already does this correctly (dest.connect(parseInt(i), target_node, link.target_slot)— target_node is an object there, not an id).app.canvas.graph.remove(this)to before the reconnect calls (or at least before the input-copy loop), so a failure partway through doesn't leave both nodes on the canvas. An input only holds one link, so reconnecting before removing the old node fights the link still attached to it anyway.To reproduce
findInputSlot is not a function; two copies of the node are left on the canvas, only one still wired.Frontend version: 1.47.11. Related but not the same bug: #380 (stale link objects after recreate, filed against an older frontend) and the now-closed #1872 (wrong link position after recreate, frontend 1.19.9) — neither describes this specific string-id/exception path.
Happy to open a PR with the two-line fix above if that's useful.