Allow director width and height input links
This commit is contained in:
@@ -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");
|
||||
|
||||
@@ -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"],
|
||||
|
||||
Reference in New Issue
Block a user