mirror of
https://github.com/Comfy-Org/ComfyUI-Manager.git
synced 2026-11-04 23:37:31 +00:00
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#3268
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?
📋 Pull Request Information
Original PR: https://github.com/Comfy-Org/ComfyUI-Manager/pull/3402
Author: @StevenLi-phoenix
Created: 10/22/2026
Status: ❌ Closed
Base:
main← Head:fix/3126-recreate-string-node-ids📝 Commits (1)
ecfecf2fix(node-fixer): reconnect inputs to the new node, not its id (#3126)📊 Changes
2 files changed (+157 additions, -1 deletions)
View changed files
📝
js/node_fixer.js(+1 -1)➕
tests/test_node_fixer_recreate.py(+156 -0)📄 Description
Fixes #3126
The root cause and the one-argument fix are as @EnragedAntelope diagnosed in the issue.
Problem
On current frontends, "Fix node (recreate)" fails on any node that has a connected input. The console shows
TypeError: t.findInputSlot is not a function, and the canvas keeps two copies of the node: the original, still wired, and an unwired replacement.Root cause
node_info_copy()injs/node_fixer.jsre-wired each linked input with:NodeIdis a string on current frontends.LGraphNode.connect()looks up the target by id only whentypeof target_node === 'number'. Any other value is used as the node itself, so the id string got totarget_node.findInputSlot(...)and threw. The menu callback adds the replacement node before it callsnode_info_copy(), so the throw skippedapp.canvas.graph.remove(this)and both nodes stayed on the canvas.Fix
Pass the node instead of its id, as the output loop in the same function already does (
dest.connect(parseInt(i), target_node, link.target_slot)). This is a one-line change.I did not take the issue's second suggestion, to remove the original before re-wiring.
LGraph.remove()disconnects the node's inputs and outputs, and those are the linksnode_info_copy()reads.Tests
tests/test_node_fixer_recreate.pylifts the shippednode_info_copy()and the menu callback withtests/js_lift.py. It runs them in node against a small stub graph that has string node ids and the sameconnect()id-resolution rule as litegraph. It covers:node_info_copy()re-creates the input link and the output link on the new node.Red, against the pre-fix file:
Green, and the rest of the suite:
I did not run
tests/e2e. It needs the separate E2E ComfyUI root, and it does not covernode_fixer.js.Manual check: ComfyUI master (46aad33) with
comfyui-frontend-package==1.57.1,python main.py --cpu, and headless Chromium.node_fixer.jswas loaded as a web extension. I wired CheckpointLoaderSimple -> KSampler -> VAEDecode. Then I called the KSampler's "Fix node (recreate)" entry fromgetExtraMenuOptions()in the page.TypeError: t.findInputSlot is not a function. Nodes 1, 2, 3, 4, with KSampler twice. The links still pointed to the original node 2.Not covered
Recreating a node inside a subgraph still fails, with a different cause.
node_info_copy()reads links fromapp.graph(the root graph), so it cannot find links that are inside the subgraph. On 1.57.1 it throwsCannot read properties of undefined (reading 'origin_id'). Inputs that come from the subgraph's input node would need their own handling as well, so I left this for a separate change.The same
dest.idline is also incomfyui_manager/js/node_fixer.jsonmanager-v4.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.