From 70d541513fe0561e8e67d2898d81da42db242664 Mon Sep 17 00:00:00 2001 From: Chris Dumas Date: Thu, 22 Oct 2026 13:00:35 +0000 Subject: [PATCH] Add clearance below resolution controls --- js/dumas_resolution.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/js/dumas_resolution.js b/js/dumas_resolution.js index dd50c90..66e8c5d 100644 --- a/js/dumas_resolution.js +++ b/js/dumas_resolution.js @@ -143,11 +143,11 @@ function render(node, root) { function setup(node) { node.resizable = false; const root=document.createElement("div"); root.className="dumas-res"; - const widget=node.addDOMWidget("dumas_resolution_ui", "custom", root, {serialize:false, getValue:()=>read(node), setValue:()=>{}, getMinHeight:()=>500}); + const widget=node.addDOMWidget("dumas_resolution_ui", "custom", root, {serialize:false, getValue:()=>read(node), setValue:()=>{}, getMinHeight:()=>570}); // Keep the LiteGraph frame at least as tall as the rendered controls. // The DOM widget otherwise keeps its old compact minimum and overhangs // the node even when the node itself is marked non-resizable. - widget.computeLayoutSize=()=>({minHeight:500,minWidth:1}); + widget.computeLayoutSize=()=>({minHeight:570,minWidth:1}); root.addEventListener("click", (event) => { const button=event.target.closest("button"); if (!button) return; const s=read(node), id=button.dataset.id; @@ -160,7 +160,7 @@ function setup(node) { render(node,root); }); root.addEventListener("change", (event) => { const key=event.target.dataset.key; if(!key)return; const s=read(node), value=key==="batch" ? Math.max(1,Math.min(64,Number(event.target.value)||1)) : Math.max(1,Math.min(16384,Number(event.target.value)||1)); s[key]=value; if(s.mode==="custom") { s.w=snap(clamp(s.custom_w),s.snap); s.h=snap(clamp(s.custom_h),s.snap); } else if(s.mode==="custom_ratio") { [s.w,s.h]=ratioPair(s.w,s.custom_ratio_w,s.custom_ratio_h,s.snap); } write(node,s); render(node,root); }); - node._dumasResolutionRoot=root; node.size=[300,540]; queueMicrotask(()=>render(node,root)); + node._dumasResolutionRoot=root; node.size=[300,640]; queueMicrotask(()=>render(node,root)); } const originalGraphToPrompt=app.graphToPrompt?.bind(app); @@ -174,7 +174,7 @@ app.registerExtension({ if(nodeData?.name!==CLASS)return; const oldConfigure=nodeType.prototype.onConfigure; nodeType.prototype.onConfigure=function(...args){const result=oldConfigure?.apply(this,args); if(this._dumasResolutionRoot)render(this,this._dumasResolutionRoot); return result;}; - nodeType.prototype.onResize=function(){this.size=[300,540];}; + nodeType.prototype.onResize=function(){this.size=[300,640];}; }, nodeCreated(node){if(node.comfyClass===CLASS)setup(node);}, });