Support per-chunk timeline durations
This commit is contained in:
@@ -12,6 +12,7 @@ from ComfyUI_H3_Continuum_Join.v3.nodes import (
|
||||
H3ContinuumSamplerProduction,
|
||||
H3ContinuumSamplerV3,
|
||||
)
|
||||
from ComfyUI_H3_Continuum_Join.v2.prompts import make_prompt_plan
|
||||
|
||||
|
||||
def _chunk_seconds_schema(node_class):
|
||||
@@ -31,7 +32,7 @@ def test_all_shared_sampler_and_prompt_plan_schemas_allow_thirty_seconds():
|
||||
for node_class in node_classes:
|
||||
schema = _chunk_seconds_schema(node_class)
|
||||
assert schema["default"] == 5.0
|
||||
assert schema["min"] == 4.0
|
||||
assert schema["min"] == 4.1
|
||||
assert schema["max"] == 30.0
|
||||
assert schema["step"] == 0.1
|
||||
assert schema["tooltip"] == CHUNK_SECONDS_TOOLTIP
|
||||
@@ -42,4 +43,23 @@ def test_chunk_seconds_tooltip_describes_validated_and_high_cost_ranges():
|
||||
assert "above 15 seconds are supported" in CHUNK_SECONDS_TOOLTIP
|
||||
assert "VRAM" in CHUNK_SECONDS_TOOLTIP
|
||||
assert "high resolution" in CHUNK_SECONDS_TOOLTIP
|
||||
assert "shared by every chunk" in CHUNK_SECONDS_TOOLTIP
|
||||
assert "for each chunk" in CHUNK_SECONDS_TOOLTIP
|
||||
|
||||
|
||||
def test_timeline_prompt_can_define_per_chunk_durations():
|
||||
plan = make_prompt_plan(
|
||||
mode="Timeline",
|
||||
script="[0-10s]\nfirst\n\n[10-15s]\nsecond\n\n[15-25s]\nthird",
|
||||
chunks=3,
|
||||
chunk_seconds=5.0,
|
||||
)
|
||||
assert plan["chunk_durations"] == [10.0, 5.0, 10.0]
|
||||
assert plan["prompts"] == ["first", "second", "third"]
|
||||
|
||||
|
||||
def test_timeline_prompt_rejects_four_second_chunks_with_fixed_fallback():
|
||||
plan = make_prompt_plan(
|
||||
mode="Timeline", script="[0-4s]\nshort", chunks=1, chunk_seconds=5.0
|
||||
)
|
||||
assert plan["chunk_durations"] == [5.0]
|
||||
assert any(item.get("code") == "H3C-P100" for item in plan["diagnostics"])
|
||||
|
||||
Reference in New Issue
Block a user