Expose sequence chunk metadata outputs
This commit is contained in:
@@ -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
|
connected directly to `Sequence Prompt` with `Prompt Format = Timeline` (or
|
||||||
`Auto`).
|
`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
|
All clip tabs use the single `Default chunk duration` control. There is no
|
||||||
per-clip duration because Continuum multi-clip projects are intentionally
|
per-clip duration because Continuum multi-clip projects are intentionally
|
||||||
uniform; resizing a shot boundary updates its timestamp in the visible prompt
|
uniform; resizing a shot boundary updates its timestamp in the visible prompt
|
||||||
|
|||||||
+8
-4
@@ -135,8 +135,8 @@ class DumasH3SequencePromptBuilder:
|
|||||||
"the node emits one absolute Timeline prompt for Sequence Prompt."
|
"the node emits one absolute Timeline prompt for Sequence Prompt."
|
||||||
)
|
)
|
||||||
CATEGORY = "DUMAS H3/Prompt"
|
CATEGORY = "DUMAS H3/Prompt"
|
||||||
RETURN_TYPES = ("STRING",)
|
RETURN_TYPES = ("STRING", "INT", "FLOAT")
|
||||||
RETURN_NAMES = ("sequence_prompt",)
|
RETURN_NAMES = ("sequence_prompt", "chunk_count", "chunk_duration")
|
||||||
FUNCTION = "build"
|
FUNCTION = "build"
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
@@ -159,12 +159,16 @@ class DumasH3SequencePromptBuilder:
|
|||||||
clip_count=int(clip_count),
|
clip_count=int(clip_count),
|
||||||
default_seconds=float(default_chunk_seconds),
|
default_seconds=float(default_chunk_seconds),
|
||||||
)
|
)
|
||||||
return (format_sequence_prompt(
|
return (
|
||||||
|
format_sequence_prompt(
|
||||||
shared_directive=shared_directive,
|
shared_directive=shared_directive,
|
||||||
sequence=sequence,
|
sequence=sequence,
|
||||||
soundscape=soundscape,
|
soundscape=soundscape,
|
||||||
music=music,
|
music=music,
|
||||||
),)
|
),
|
||||||
|
len(sequence["clips"]),
|
||||||
|
float(default_chunk_seconds),
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
NODE_CLASS_MAPPINGS = {"DumasH3SequencePromptBuilder": DumasH3SequencePromptBuilder}
|
NODE_CLASS_MAPPINGS = {"DumasH3SequencePromptBuilder": DumasH3SequencePromptBuilder}
|
||||||
|
|||||||
@@ -63,8 +63,9 @@ def test_normalizer_rejects_invalid_slot_ranges(bad):
|
|||||||
|
|
||||||
def test_node_schema_has_single_string_output_and_serialized_editor_state():
|
def test_node_schema_has_single_string_output_and_serialized_editor_state():
|
||||||
schema = DumasH3SequencePromptBuilder.INPUT_TYPES()["required"]
|
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
|
assert schema["timeline_json"][1]["multiline"] is True
|
||||||
result = DumasH3SequencePromptBuilder().build(1, 4, "Directive", json.dumps(default_sequence(1, 4)), "N/A", "N/A")
|
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].startswith("[0-4s]\nDirective")
|
||||||
assert result[0].count("overall_soundscape:") == 1
|
assert result[0].count("overall_soundscape:") == 1
|
||||||
|
assert result[1:] == (1, 4.0)
|
||||||
|
|||||||
Reference in New Issue
Block a user