Derive external timeline duration from sections

This commit is contained in:
OpenClaw Agent
2026-07-20 09:17:04 +00:00
parent 8736d4a463
commit e01ceef71b
3 changed files with 13 additions and 20 deletions

View File

@@ -106,21 +106,13 @@ class Timeline(io.ComfyNode):
node_id="TimelineCS",
display_name="Timeline DUMAS",
category="WhatDreamsCost DUMAS",
description="Builds an external timeline payload for LTX Director from a section set and total duration.",
description="Builds an external timeline payload for LTX Director from a section set, deriving the total duration from the sections.",
inputs=[
TimelineSectionSetData.Input(
"section_set",
optional=True,
tooltip="Optional section set. When omitted, the timeline payload contains no sections.",
),
io.Float.Input(
"duration",
default=5.0,
min=0.1,
max=1000.0,
step=0.01,
tooltip="Total timeline duration in seconds.",
),
],
outputs=[
TimelineData.Output(display_name="timeline"),
@@ -128,9 +120,11 @@ class Timeline(io.ComfyNode):
)
@classmethod
def execute(cls, section_set=None, duration=5.0) -> io.NodeOutput:
def execute(cls, section_set=None, duration=None) -> io.NodeOutput:
sections = list((section_set or {}).get("sections") or [])
total_duration = sum(max(0.1, float(item.get("duration") or 0.0)) for item in sections)
payload = {
"duration": max(0.1, float(duration or 0.0)),
"sections": list((section_set or {}).get("sections") or []),
"duration": max(0.1, float(total_duration or 0.0)),
"sections": sections,
}
return io.NodeOutput(payload)