Skip to content

fix: set widget.hidden in toggleWidget_2 to prevent textarea overlap in modern frontend - #385

Open
DDavisWA wants to merge 2 commits into
jags111:mainfrom
DDavisWA:fix/efficient-loader-textarea-overlap
Open

fix: set widget.hidden in toggleWidget_2 to prevent textarea overlap in modern frontend#385
DDavisWA wants to merge 2 commits into
jags111:mainfrom
DDavisWA:fix/efficient-loader-textarea-overlap

Conversation

@DDavisWA

@DDavisWA DDavisWA commented May 26, 2026

Copy link
Copy Markdown

Problem

In ComfyUI frontend >= v1.43.18, multiline STRING widgets (CLIP_POSITIVE / CLIP_NEGATIVE in the Efficient Loader) are rendered as DOM elements whose Y-position is calculated by accumulating the heights of all preceding widgets. The frontend uses widget.hidden to skip excluded widgets in this accumulation.

toggleWidget_2 (used for the Efficient Loader) was hiding lora_model_strength and lora_clip_strength by setting widget.type and widget.computeSize only — without setting widget.hidden. Those widgets still contributed to the Y-offset accumulation, pushing the CLIP text boxes down into the fields below them (token_normalization, weight_interpretation, etc.).

Fix

One line added to toggleWidget_2, mirroring the pattern already present in toggleWidget:

widget.hidden = !show;

Testing

Open an Efficient Loader node with lora_name = None. CLIP_POSITIVE and CLIP_NEGATIVE text boxes sit in their correct positions and no longer overlap the fields below them.

Related

Part of the fix for #344 (efficiency-nodes UI trouble). This PR covers toggleWidget_2 (Efficient Loader text boxes); #384 covers the same class of bug in toggleWidget (XY Input / quantity-adjust nodes). The two together resolve the widget-overlap issues reported in #344.

…in modern ComfyUI frontend

ComfyUI frontend >= v1.43.18 renders multiline STRING widgets (CLIP_POSITIVE /
CLIP_NEGATIVE in the Efficient Loader) as DOM elements whose Y-position is
calculated by accumulating the heights of all preceding widgets. The frontend
uses widget.hidden to skip excluded widgets in this accumulation.

toggleWidget_2 (used for Efficient Loader) was hiding lora_model_strength and
lora_clip_strength by setting widget.type and widget.computeSize only, without
setting widget.hidden. Those widgets still contributed to the Y-offset
accumulation, pushing the CLIP text boxes down into the fields below them.

Fix mirrors the existing pattern in toggleWidget: add widget.hidden = !show.
@DDavisWA
DDavisWA force-pushed the fix/efficient-loader-textarea-overlap branch from 85abb28 to 7f9f6b5 Compare May 26, 2026 13:46
Update fix-xyinput-stray-widget with a bugfix that the display state is not connected to the side panel.
@hwyao

hwyao commented Jul 13, 2026

Copy link
Copy Markdown

Comment on PR #384 #385

I tested #384 and #385 together on ComfyUI frontend v1.43.18 and found one remaining Node Details case.

Reproduction workflow and evidence

widgethider-check.json
This is widgethider-check.json as a UI reproduction workflow. It contains:

  • Efficient Loader
  • XY Input: VAE
  • XY Input: Steps
  • XY Input: Sampler/Scheduler
  • LoRA Stacker

The workflow is intended for UI verification; it does not need to be queued.

Before (Nothing):
Comfy_Desktop_hOPSREw3xT

After 1 (after applying #384 #385):
Comfy_Desktop_gpHDbEtBYO

Remaining issue

#384 and #385 correctly update widget.hidden, so canvas rendering and DOM-widget positioning are fixed.

However, when the right-side Node Details / Parameters panel is already open, changing a mode or count that reveals additional Efficiency Nodes widgets can leave the newly visible parameter rows overflowing or misaligned.

After 2 (after applying #384 #385, triggering error):
Comfy_Desktop_WEMUi7M8wB

Root cause

The frontend has two visibility consumers:

  • Canvas layout observes widget.hidden.
  • Node Details filters widgets through widget.options?.hidden.

In this PR, the relevant code is the toggleWidget_2 helper in js/widgethider.js, immediately after the widget.hidden = !show; line added by this PR (around line 53 in commit 7f9f6b5).

ComfyUI frontend's own PreviewAny extension synchronizes both fields:
https://github.com/Comfy-Org/ComfyUI_frontend/blob/v1.43.18/src/extensions/core/previewAny.ts

Proposed follow-up

Please add this immediately after widget.hidden = !show; for #384 and #385:

if (widget.options) widget.options.hidden = !show;

I will open a focused stacked PR at
https://github.com/DDavisWA/efficiency-nodes-comfyui/tree/fix-xyinput-stray-widget
https://github.com/DDavisWA/efficiency-nodes-comfyui/tree/fix/efficient-loader-textarea-overlap
against for these to pr.

Last (after applying #384 #385 and my patches):
Comfy_Desktop_XXSuymiW2P

Basic Stability Test

default-step-cfg-XY.json
I ran a XY plot for CFG-steps, and it is not crashed. There is no full coverage test and this is therefore only a small experiment.

DDavisWA added a commit to DDavisWA/efficiency-nodes-comfyui that referenced this pull request Jul 29, 2026
Includes hwyao's follow-up syncing widget.options.hidden in toggleWidget_2.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants