Comfy-Org / Comfy-Org/ComfyUI_frontend
Bug: Subgraph nodes get duplicate inputs on load, causing connected inputs to be silently dropped
- 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?
### ComfyUI version
Regression introduced between v0.16.4 (working) and v0.17.2 (broken)
### Description
When loading a workflow containing subgraph (group) nodes, the subgraph node's inputs get duplicated. Each input appears twice in the node's `inputs` array — once connected (correct) and once with `link: null` (spurious duplicate). This causes the execution backend to silently drop the connected value, producing a cryptic `missing 1 required positional argument` error on any node inside the subgraph that receives that input.
This reproduces with plain `.json` workflow files. It is not limited to workflows loaded from video-embedded metadata.
### Steps to reproduce
1. Create or load a workflow containing a subgraph node with connected inputs
2. Save as `.json`
3. Load the `.json` in v0.17.2
4. Inspect the subgraph node's inputs — each input appears twice
5. Run the workflow — any node inside the subgraph receiving those inputs will fail
### Expected behavior
Subgraph node inputs load cleanly with no duplicates, same as v0.16.4.
### Actual behavior
Each input is duplicated. Example of corrupted node inputs:
```json
"inputs": [
{"name": "image", "type": "IMAGE", "link": 1326},
{"name": "input1", "type": "*", "link": null},
{"name": "image", "type": "IMAGE", "link": null},
{"name": "input1", "type": "*", "link": null}
]
```
The second `image` entry with `link: null` causes `images` to be absent from `input_data_all` entirely when the execution backend processes the node, confirmed via debug logging:
```
DEBUG ImageRebatch: keys=['batch_size'] missing=[]
```
### Why it fails silently
The `Required input is missing` log line does not include the node ID or reason. The actual error surface is a generic Python `TypeError` from the node's execute function, with no indication the real problem is duplicate inputs in the subgraph definition.
### Suggested fix
In `get_input_data` in `execution.py`, when iterating node inputs, if a key already exists in `input_data_all` with a valid connected value, do not overwrite it with a `None`/missing entry from a duplicate. Additionally, prompt validation should detect and warn on duplicate input names.
### Versions
- v0.16.4: working correctly
- v0.17.2: broken
- OS: Linux (Debian)
- GPU: RTX 4070
### Steps to Reproduce
.
### How is this affecting you?
Workflow won't execute
### ComfyUI Frontend Version
1.41.20
### Browser
Firefox
### Console Errors
```javascript
```
### Logs
```shell
```
### Additional Context
_No response_
┆Issue is synchronized with this [Notion page](https://www.notion.so/Issue-10133-Bug-Subgraph-nodes-get-duplicate-inputs-on-load-causing-connected-inputs-to-be-sile-3266d73d3650817eba00d8ebc84bc6a0) by [Unito](https://www.unito.io)
Contributor guide
Assessment
This issue has not been assessed yet.