Comfy-Org / Comfy-Org/ComfyUI_frontend

Subgraph host node leaves blank space for collapsed internal widgets

Open
#10,276 0 comments 0 reactions 0 assignees View on GitHub
area:subgraph area:widgets
Dominant language
TypeScript
Stars
2k
Forks
699
Avg merge
1d 7h
Merged PRs (30d)
490

Description

### Prerequisites

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

### What happened?

Widgets collapsed inside a subgraph do not project correctly onto the outer subgraph node.

From Immac's report, collapsing widgets inside the subgraph causes two visible problems on the host subgraph node:

- the collapsed widget is no longer shown on the front of the subgraph
- layout space is still reserved for it on the front of the subgraph, leaving a blank gap

This appears related to the recent cluster of subgraph/promotion regressions, but it does not look identical to the existing reports about collapsed **nodes** or ghost text fields. This report is specifically about collapsed **widgets inside the subgraph** still affecting host-node layout.

### Steps to Reproduce

1. Create or open a workflow with a subgraph that exposes one or more widgets on the host subgraph node.
2. Enter the subgraph.
3. Collapse one of the widgets inside the subgraph.
4. Return to the parent graph and inspect the front of the subgraph node.
5. Observe that the widget is no longer rendered correctly on the subgraph node, but blank space is still reserved for it.

### How is this affecting you?

Feature doesn't work as expected

### ComfyUI Frontend Version

Unknown

### Browser

Other

### Console Errors

```javascript
None reported.
```

### Logs

```shell
None reported.
```

### Additional Context

Reporter summary from Discord:

> Collapsing widgets inside the subgraph make them not show on the front of the subgraph.
> It also makes the widget take space in the front.

Possibly related issues:

- #9925 Promoted text prompt field disappears from subgraph when node is collapsed (v0.17+)
- #9994 Subgraph: Text fields persist as "ghost" elements on workspace when subgraph is minimized
- #9995 Subgraph: Layout order of elements not respected after changing "Shown on node" configuration
- #9979 Subgraph Functionalities broken (and more)
- Closed regression history: #4399 and #10117

Light code triage:

- `src/services/litegraphService.ts` and `src/services/subgraphPseudoWidgetCache.ts` are involved in deciding which promoted/pseudo widgets are projected to the host subgraph node.
- `src/lib/litegraph/src/subgraph/SubgraphNode.ts` owns promoted-widget reconciliation and host-node widget projection.
- `src/lib/litegraph/src/LGraphNode.ts` uses different filters for visibility vs layout: `computeSize()` checks `isWidgetVisible()`, while `getLayoutWidgets()` only filters `hidden`. If a promoted widget becomes non-visible without being marked hidden, that could explain why it disappears visually but still reserves vertical space.

A minimal workflow and screenshot/video would help confirm whether this is specific to certain widget types or reproducible for any promoted widget in a subgraph.

┆Issue is synchronized with this [Notion page](https://www.notion.so/Issue-10276-Subgraph-host-node-leaves-blank-space-for-collapsed-internal-widgets-3276d73d365081dc8b22f363f28058e8) by [Unito](https://www.unito.io)

Contributor guide

Open the contributing guide

Research direction

Reproduce the issue with a minimal workflow containing a subgraph and a promoted widget, then inspect src/services/litegraphService.ts, src/services/subgraphPseudoWidgetCache.ts, and src/lib/litegraph/src/subgraph/SubgraphNode.ts. Compare the visibility and layout paths in src/lib/litegraph/src/LGraphNode.ts, including isWidgetVisible(), computeSize(), and getLayoutWidgets(). Done means collapsed internal widgets are not rendered on the host subgraph node and no blank layout space remains.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
frontend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.