Comfy-Org / Comfy-Org/ComfyUI_frontend

Node replacement does not transfer Autogrow input connections (dot-notation mappings are skipped)

Open
#11,176 2 comments 0 reactions 0 assignees View on GitHub
area:nodes Potential Bug Public API
Dominant language
TypeScript
Stars
2k
Forks
699
Avg merge
1d 7h
Merged PRs (30d)
490

Description

### Prerequisites

- [x] I am running the latest version of ComfyUI
- [x] I have custom nodes enabled

### What happened?

NodeReplace.input_mapping entries that use dot notation for Autogrow inputs (e.g. items.item0) are not applied during replacement in the frontend, so Autogrow links are dropped after replacing a missing node.

This appears to contradict the node replacement docs and the core example that explicitly use dot notation for Autogrow mappings:

[Node replacement docs](https://docs.comfy.org/custom-nodes/backend/node-replacement)
[Core nodes_replacements.py example](https://github.com/Comfy-Org/ComfyUI/blob/master/comfy_extras/nodes_replacements.py)

### Steps to Reproduce

**Steps to Reproduce:**
1. Create an old node with:
- io.Autogrow.Input("inputs", TemplatePrefix(..., prefix="input", min=1, max=20))
- an index widget

2. Create a new node with:
- io.Autogrow.Input("items", TemplatePrefix(..., prefix="item", min=1, max=20))
- a selection_idx widget

3. Register replacement:
```
io.NodeReplace(
new_node_id="NewAutoSelect",
old_node_id="OldAutoPass",
old_widget_ids=["index"],
input_mapping=[
*[{"new_id": f"items.item{i}", "old_id": f"inputs.input{i}"} for i in range(20)],
{"new_id": "selection_idx", "old_id": "index"},
],
output_mapping=[...],
)
```

4. Build workflow using old node with multiple connected autogrow inputs (e.g. 3+ links).

5. Make old node missing (keep new node + replacement), load workflow, click replace.

**Actual Result:**
- Widget value transfer works (index -> selection_idx).
- Output mapping works.
- Autogrow input links are disconnected after replacement.

**Expected Result:**
Autogrow links should transfer according to input_mapping dot-notation entries

**Suspected root cause:**
In frontend replacement logic (src/platform/nodeReplacement/useNodeReplacement.ts), dotted new_id mappings are skipped entirely:
`if (isDotNotation(inputMap.new_id)) continue // Autogrow/DynamicCombo`
So transferInputConnection(...) is never called for Autogrow mappings.
Additionally, replacement creates a fresh new node. If the new node only has autogrow min slots initially, later mapped slots may not exist yet unless autogrow is expanded first (see dynamic autogrow behavior in src/core/graph/widgets/dynamicWidgets.ts).

**Suggested fix direction:**
1. Do not skip connection transfer for dot-notation mappings.
2. Ensure autogrow inputs exist on the new node before applying mapped connections (pre-expand or equivalent).
3. Keep dot-notation skip only for widget-value transfer if needed, not for link transfer.

### How is this affecting you?

Feature doesn't work as expected

### ComfyUI Frontend Version

1.42.8

### Browser

Chrome/Chromium

### Console Errors

```javascript

```

### Logs

```shell

```

### Additional Context

_No response_

┆Issue is synchronized with this [Notion page](https://www.notion.so/Issue-11176-Node-replacement-does-not-transfer-Autogrow-input-connections-dot-notation-mappings--3406d73d365081f7bed7fa3fe5ca68b4) by [Unito](https://www.unito.io)

Contributor guide

Open the contributing guide

Research direction

Start in src/platform/nodeReplacement/useNodeReplacement.ts, where dotted new_id mappings are skipped, and inspect dynamic autogrow behavior in src/core/graph/widgets/dynamicWidgets.ts. Reproduce the workflow with multiple autogrow links, then verify replacement creates the needed slots and preserves those links while widget and output mappings still work.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.