From 3e0b0727305186417633fbacd44ab3c047931618 Mon Sep 17 00:00:00 2001 From: Chris Dumas Date: Thu, 15 Oct 2026 10:00:40 +0000 Subject: [PATCH] Expose sequence chunk metadata outputs --- README.md | 4 ++++ prompt_builder.py | 20 ++++++++++++-------- tests/test_sequence_prompt_builder.py | 3 ++- 3 files changed, 18 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 96db53b..f75e137 100644 --- a/README.md +++ b/README.md @@ -9,6 +9,10 @@ flattened to absolute timeline positions when the node executes, so it can be connected directly to `Sequence Prompt` with `Prompt Format = Timeline` (or `Auto`). +The node also outputs the project `chunk_count` as an `INT` and the shared +`chunk_duration` in seconds as a `FLOAT`, so downstream nodes can use the same +project dimensions without duplicating the controls. + All clip tabs use the single `Default chunk duration` control. There is no per-clip duration because Continuum multi-clip projects are intentionally uniform; resizing a shot boundary updates its timestamp in the visible prompt diff --git a/prompt_builder.py b/prompt_builder.py index fdd561c..967be71 100644 --- a/prompt_builder.py +++ b/prompt_builder.py @@ -135,8 +135,8 @@ class DumasH3SequencePromptBuilder: "the node emits one absolute Timeline prompt for Sequence Prompt." ) CATEGORY = "DUMAS H3/Prompt" - RETURN_TYPES = ("STRING",) - RETURN_NAMES = ("sequence_prompt",) + RETURN_TYPES = ("STRING", "INT", "FLOAT") + RETURN_NAMES = ("sequence_prompt", "chunk_count", "chunk_duration") FUNCTION = "build" @classmethod @@ -159,12 +159,16 @@ class DumasH3SequencePromptBuilder: clip_count=int(clip_count), default_seconds=float(default_chunk_seconds), ) - return (format_sequence_prompt( - shared_directive=shared_directive, - sequence=sequence, - soundscape=soundscape, - music=music, - ),) + return ( + format_sequence_prompt( + shared_directive=shared_directive, + sequence=sequence, + soundscape=soundscape, + music=music, + ), + len(sequence["clips"]), + float(default_chunk_seconds), + ) NODE_CLASS_MAPPINGS = {"DumasH3SequencePromptBuilder": DumasH3SequencePromptBuilder} diff --git a/tests/test_sequence_prompt_builder.py b/tests/test_sequence_prompt_builder.py index cedbe87..e68e647 100644 --- a/tests/test_sequence_prompt_builder.py +++ b/tests/test_sequence_prompt_builder.py @@ -63,8 +63,9 @@ def test_normalizer_rejects_invalid_slot_ranges(bad): def test_node_schema_has_single_string_output_and_serialized_editor_state(): schema = DumasH3SequencePromptBuilder.INPUT_TYPES()["required"] - assert DumasH3SequencePromptBuilder.RETURN_TYPES == ("STRING",) + assert DumasH3SequencePromptBuilder.RETURN_TYPES == ("STRING", "INT", "FLOAT") assert schema["timeline_json"][1]["multiline"] is True result = DumasH3SequencePromptBuilder().build(1, 4, "Directive", json.dumps(default_sequence(1, 4)), "N/A", "N/A") assert result[0].startswith("[0-4s]\nDirective") assert result[0].count("overall_soundscape:") == 1 + assert result[1:] == (1, 4.0)