From dcac6dba802cd0aa37c17cd3963f32af3fb3a241 Mon Sep 17 00:00:00 2001 From: Chenlei Hu Date: Thu, 20 Feb 2025 12:45:31 -0500 Subject: [PATCH] [BugFix] Auto grow node if widgets need more space (#556) --- src/LGraphNode.ts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/LGraphNode.ts b/src/LGraphNode.ts index 7b0c82064..6221f6c86 100644 --- a/src/LGraphNode.ts +++ b/src/LGraphNode.ts @@ -3374,6 +3374,15 @@ export class LGraphNode implements Positionable, IPinnable, IColorable { w.y = y y += w.computedHeight } + + // Grow the node if necessary. + // Ref: https://github.com/Comfy-Org/ComfyUI_frontend/issues/2652 + // TODO: Move the layout logic before drawing of the node shape, so we don't + // need to trigger extra round of rendering. + if (y > bodyHeight) { + this.setSize([this.size[0], y]) + this.graph.setDirtyCanvas(false, true) + } } /**