From c782f3263bf5720d33aafa1e56c8f820573e87fa Mon Sep 17 00:00:00 2001 From: OpenClaw Agent Date: Fri, 17 Jul 2026 08:10:29 +0000 Subject: [PATCH] Allow director width and height input links --- js/ltx_director.js | 23 +++++++++++++++++++++-- ltx_director.py | 16 ++++++++-------- 2 files changed, 29 insertions(+), 10 deletions(-) diff --git a/js/ltx_director.js b/js/ltx_director.js index 48b8323..99a7ecf 100644 --- a/js/ltx_director.js +++ b/js/ltx_director.js @@ -12097,9 +12097,28 @@ app.registerExtension({ setTimeout(refreshFromWidgets, 60); setTimeout(refreshFromWidgets, 250); - // Keep width/height as regular widgets on the node so they can be used like - // standard Comfy fields instead of being panel-only controls. + const ensureVisibleResolutionWidgets = () => { + const isLiteGraph = !window.LiteGraph || !window.LiteGraph.vueNodesMode; + for (const name of ["custom_width", "custom_height"]) { + const w = getW(name); + if (!w) continue; + showWidget(w); + if (isLiteGraph && w.type === "converted-widget" && node.inputs) { + if (!node.inputs.find(i => i.name === name)) { + const slot = node.addInput(name, "INT"); + if (slot != null) { + const inp = node.inputs[node.inputs.length - 1]; + if (inp) inp.widget = { name }; + } + } + } + } + }; + + // Keep width/height as regular widgets on the node while also allowing + // them to behave as standard automation inputs. ["frame_rate", "resize_method", "reference_strength"].forEach(n => { hideWidget(getW(n)); }); + ensureVisibleResolutionWidgets(); ensureTimingHidden(); }; const settingsContainer = document.createElement("div"); diff --git a/ltx_director.py b/ltx_director.py index 56be1d3..ff089f3 100644 --- a/ltx_director.py +++ b/ltx_director.py @@ -1976,14 +1976,14 @@ class LTXDirector(io.ComfyNode): "guide_strength", default="", tooltip="Auto-populated from the timeline editor (comma-separated guide strengths for image segments).", ), - io.Int.Input( - "custom_width", default=0, min=0, max=8192, step=1, optional=True, - tooltip="Target output width for all image segments. Set to 0 to use the original image width.", - ), - io.Int.Input( - "custom_height", default=0, min=0, max=8192, step=1, optional=True, - tooltip="Target output height for all image segments. Set to 0 to use the original image height.", - ), + io.Int.Input( + "custom_width", default=0, min=0, max=8192, step=1, optional=True, force_input=True, + tooltip="Target output width for all image segments. Set to 0 to use the original image width.", + ), + io.Int.Input( + "custom_height", default=0, min=0, max=8192, step=1, optional=True, force_input=True, + tooltip="Target output height for all image segments. Set to 0 to use the original image height.", + ), io.Combo.Input( "resize_method", options=["maintain aspect ratio", "stretch to fit", "pad", "pad green", "crop"],