In ComfyUI's V2 (Vue) renderer, node height is derived from the DOM
widget's rendered size, so setting dom.wrap.style.height inside onResize
creates a feedback loop: each DOM change causes V2 to fire onResize again
with a larger size[1], growing the node without bound.
The fix measures the actual node-height overhead (everything above
dom.wrap) from V2's own first onResize call, where size[1] is DOM-derived
and therefore encodes the exact overhead needed for a zero-change
equilibrium. The handler returns early without touching the DOM until this
measurement is taken, so the loop never starts. A secondary recalibration
step corrects the overhead if V2's internal chrome value shifts post-init
(observed in diagnostic data). The dom.wrap.offsetHeight === h guard is
the terminal condition for both cases.
V1 behavior is unchanged: overhead is pre-seeded with the hardcoded
CTRL_H + NODE_CHROME and no measurement or recalibration runs.
Thank you to @fullthrottler for identifying the root cause and suggesting a temporary fix.