Comfy-Org / Comfy-Org/ComfyUI_frontend

Using ImpactConditionalBranch node in a subgraph crashes and deletes the entire workflow

Open
#5,707 5 comments 0 reactions 0 assignees View on GitHub
area:subgraph Custom Node Potential Bug
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 searched existing issues to make sure this isn't a duplicate
- [x] I have tested with all custom nodes disabled ([see how](https://docs.comfy.org/troubleshooting/custom-node-issues#step-1%3A-test-with-all-custom-nodes-disabled))

### What happened?

I'm not quite sure if this issue is the fault of the ImpactConditionalBranch from the [Impact Pack custom nodes ](https://github.com/ltdrdata/ComfyUI-Impact-Pack), but I'm thinking that at least the error handling should relate to the frontend.

By including an ImpactConditionalBranch node into a Subgraph and attaching an input to the node, if you save and load the workflow, or simply exit the subgraph and tab into a different workflow and back into the relevant one, the entire contents of the workflow is erased and following error occurs:

Image

This is an example workflow. The node also does not properly update its type when an input is connected, whereas it does update it correctly if done outside of a subgraph. I don't know if this is the cause of the node itself, or because of subgraphs.

Image

The following error log is attached:

# ComfyUI Error Report
## Error Details
- **Node ID:** N/A
- **Node Type:** N/A
- **Exception Type:** Loading aborted due to error reloading workflow data
- **Exception Message:** TypeError: Cannot read properties of undefined (reading 'outputs')
## Stack Trace
```
TypeError: Cannot read properties of undefined (reading 'outputs')
at nodeType.onConnectionsChange (http://127.0.0.1:8188/extensions/ComfyUI-Impact-Pack/impact-pack.js:309:23)
at ComfyNode.configure (http://127.0.0.1:8188/assets/index-Cso8sTOw.js:119161:33)
at ComfyNode.configure (http://127.0.0.1:8188/assets/index-Cso8sTOw.js:316180:15)
at Subgraph.configure (http://127.0.0.1:8188/assets/index-Cso8sTOw.js:133890:34)
at LGraph.configure (http://127.0.0.1:8188/assets/index-Cso8sTOw.js:323795:26)
at LGraph.configure (http://127.0.0.1:8188/extensions/ComfyUI-Custom-Scripts/js/reroutePrimitive.js:14:29)
at Subgraph.configure (http://127.0.0.1:8188/assets/index-Cso8sTOw.js:134033:22)
at LGraph.configure (http://127.0.0.1:8188/assets/index-Cso8sTOw.js:133869:44)
at LGraph.configure (http://127.0.0.1:8188/assets/index-Cso8sTOw.js:323795:26)
at LGraph.configure (http://127.0.0.1:8188/extensions/ComfyUI-Custom-Scripts/js/reroutePrimitive.js:14:29)
```

### Steps to Reproduce

1. Create a subgraph with any node
2. Add a ImpactConditionalBranch node inside the subgraph, and connect its input to anything
3. Tab into another workflow and then back

### How is this affecting you?

Workflow won't execute

### ComfyUI Frontend Version

1.28.0

### Browser

Chrome/Chromium

### Console Errors

```javascript

```

### Logs

```shell

```

### Additional Context

_No response_

┆Issue is synchronized with this [Notion page](https://www.notion.so/Issue-5707-Using-ImpactConditionalBranch-node-in-a-subgraph-crashes-and-deletes-the-entire-workfl-2746d73d365081d49585c12422a3fd67) by [Unito](https://www.unito.io)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.