Comfy-Org / Comfy-Org/ComfyUI_frontend

Nodes 2.0 Reroute is oversized and hard to customize (no stable selector; “Input 0 / Output 0” labels)

Open
#8,844 1 comment 0 reactions 0 assignees View on GitHub
area:ui
Dominant language
TypeScript
Stars
2k
Forks
699
Avg merge
1d 7h
Merged PRs (30d)
490

Description

## Describe the problem
In Nodes 2.0, the built-in Reroute node appears significantly oversized (e.g. enforced min-width) and always shows slot labels like **"Input 0 / Output 0"**.

Users can override the UI with `user.css`, but Reroute has no stable DOM identifier (node-type/class/data attribute), making it hard to target only Reroute with CSS.

## Expected behavior
- Reroute should be compact by default (no large forced min-width), or provide a setting to control its size.
- Slot labels for Reroute ("Input 0 / Output 0") should be optionally hidden.
- There should be a stable selector to target Reroute specifically (e.g. `data-node-type="reroute"`) for `user.css` customization.

## Actual behavior
- Reroute is large (e.g. `min-w-[225px]`) and shows **"Input 0 / Output 0"**.
- DOM does not expose a stable Reroute-specific selector; nodes appear to be distinguished mainly by `data-node-id` (runtime id), which is not usable for CSS.

## Reproduction steps
1. Enable/use Nodes 2.0 UI.
2. Add a Reroute node.
3. Observe that the node is wide and displays slot labels **"Input 0 / Output 0"**.
4. Try to hide only the Reroute labels via `user.css`; there is no stable selector limited to Reroute.

## Technical details / DOM snippets
Slot labels are rendered as:

Input 0
Output 0

The node container includes classes like:

There is no Reroute-specific class or data attribute visible on the node container.

## Proposed solutions
Any of the following would solve it:

1) Add a stable node-type attribute to the node container, e.g.
- `data-node-type="reroute"` (and similar for other node types)
This would allow safe, node-specific customization via `user.css`.

2) Add a UI setting / preference:
- Hide Reroute slot labels (Input/Output numbering)
- Compact Reroute size (min-width, height, padding)

3) Reduce/remove forced min-width for Reroute specifically (or expose it via CSS variables / settings).

## Environment
- OS: Windows 10/11
- Browser: Firefox (also reproducible in Chromium browsers)
- ComfyUI version: 0.13.0
- ComfyUI_frontend version: 1.38.13
- Nodes 2.0: enabled

### When does this problem occur?

Always. As soon as Nodes 2.0 is enabled and a built-in Reroute node is present on the graph.

### How often do you encounter this problem?

Multiple times per day

### How much does this problem affect your workflow?

Significantly slows down my work

### Current workarounds

_No response_

### Ideas for solutions (Optional)

_No response_

### Additional context

_No response_

┆Issue is synchronized with this [Notion page](https://www.notion.so/Issue-8844-Nodes-2-0-Reroute-is-oversized-and-hard-to-customize-no-stable-selector-Input-0-O-3066d73d3650817dac91cf7f3d8850b0) 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.