ComfyUI-LegacyWidgetWidthFix
Drop-in workaround for LiteGraph-mode widget width bug in ComfyUI frontend. (Description by CC)
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
https://github.com/user-attachments/assets/b47e2823-4d75-433c-aa68-b09a59d84bc6
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, future writes from the Vue draw loop are dropped while LiteGraph mode is active, and new nodes are repaired automatically as you add them.
- Repair button → click Repair widget widths now on the fix node to rescan the workflow manually. This is a fallback for unusual custom nodes that create widgets outside ComfyUI's normal widget APIs.
- 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 presence activates the frontend patch; its button only triggers an immediate rescan and does not affect workflow execution.
How the patch works
web/bugfix.js:
- Hooks
LGraphNode.prototype.addWidgetso every newly-created widget has itswidthproperty replaced with a getter/setter and its stale initial width cleared while the patch is active. - Replaces the
widthproperty on all existing widgets the same way. - Rescans every node through ComfyUI's
nodeCreatedextension hook, including a deferred pass for widgets added by other extensions. - The setter drops writes when
LiteGraph.vueNodesModeis false (i.e. in LiteGraph mode, where the bug manifests). - 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).