ComfyUI Extension: ComfyUI-LegacyWidgetWidthFix

Authored by pekkAi-dev

Created

Updated

0 stars

Run ComfyUI workflows without the setup

No installs, no CUDA version roulette, no GPU sitting idle on your bill. Bring a workflow and run it in the browser.

Drop-in workaround for LiteGraph-mode widget width bug in ComfyUI frontend. (Description by CC)

Looking for a different extension?

Custom Nodes (1)

README

ComfyUI-LegacyWidgetWidthFix

A one-node, drop-in workaround for the LiteGraph-mode widget width bug in ComfyUI's frontend (Comfy-Org/ComfyUI_frontend#12443), introduced by #11574 in WidgetLegacy.vue.

Only needed until ComfyOrg patches the bug upstream. Once upstream ships the fix, you can remove the node from your workflows — old workflows that still contain it will continue to load and the node will simply do nothing.

What the bug looks like

In LiteGraph mode (i.e. not the new Vue-node renderer), widget widths get frozen, disregarding node boundaries. Resizing the node after that point no longer resizes its widgets: they overflow, get clipped, or float in dead space. Moving the node can also trigger it.

The root cause is one line in WidgetLegacy.vue that writes widgetInstance.width = width on every draw call, unconditionally. LiteGraph's canvas renderer uses widget.width || nodeWidth as a fallback — once widget.width is a number, node.size[0] is ignored.

What this pack does

Adds a single node, Legacy Widget Width Fix (temporary), under utils/bugfix in the Add Node menu.

  • Drop it into a workflow → the frontend patch installs. Existing widgets have their stale widths cleared, and future writes from the Vue draw loop are dropped while LiteGraph mode is active.
  • Remove it and refresh → the patch deactivates and widgets revert to stock behavior on node removal, with complete removal on refresh (this two-step approach keeps your active session intact if you remove it by accident, with the refresh always reverting all changes. But I would still refresh in case something is stale).
  • Multiple instances → reference-counted; the patch stays installed until the last instance is removed.

The node has no inputs, no outputs, and does nothing on execution. Its only purpose is to be a presence in the graph that the frontend extension can detect.

How the patch works

web/bugfix.js:

  1. Hooks LGraphNode.prototype.addWidget so every newly-created widget has its width property replaced with a getter/setter.
  2. Replaces the width property on all existing widgets the same way.
  3. The setter drops writes when LiteGraph.vueNodesMode is false (i.e. in LiteGraph mode, where the bug manifests).
  4. Reverses everything when the last instance of the node is removed.

If LiteGraph.vueNodesMode isn't exposed on the build you're running, the patch assumes LiteGraph mode and drops the writes — matching the regression case.

If you're already on a frontend build that contains the upstream fix, this pack is a no-op — LiteGraph.vueNodesMode will be true in the contexts where writes are legitimate, and you can leave or remove the node at your convenience (this assumes Comfy-Org doesn't change how vueNodesMode is used).

Why

  • The proper fix is the one-line upstream change in WidgetLegacy.vue; this node just fixes it until then.
  • So others can use it without patching comfy this node does what's needed, without touching your comfy installation. Drop node, refresh. Not working? Delete it. Easy to check. And if it does work, forgetting about it when comfy patches the bug is no problem, the node just stops doing anything.
  • No manager entry -> No sneaky code changes that would get pulled if you update all nodes.

Install

Clone into ComfyUI/custom_nodes/:

git clone https://github.com/pekkAi-dev/ComfyUI-LegacyWidgetWidthFix ComfyUI-LegacyWidgetWidthFix

No Python dependencies. Restart ComfyUI, then add the node from utils/bugfix → Legacy Widget Width Fix (temporary).

Run ComfyUI workflows without the setup

No installs, no CUDA version roulette, no GPU sitting idle on your bill. Bring a workflow and run it in the browser.

Learn more