Group shot timings inside chunk blocks
This commit is contained in:
+13
-5
@@ -99,7 +99,12 @@ def format_sequence_prompt(
|
||||
soundscape: str = "",
|
||||
music: str = "",
|
||||
) -> str:
|
||||
"""Flatten clip-local slots into the absolute H3 Timeline prompt format."""
|
||||
"""Format uniform clips as chunk blocks with relative shot timings.
|
||||
|
||||
Continuum treats square-bracket ranges as physical/logical chunk markers.
|
||||
Shot timings belong inside each chunk and must therefore use plain
|
||||
``start-end s:`` lines rather than creating additional Timeline sections.
|
||||
"""
|
||||
|
||||
sections: list[str] = []
|
||||
directive = str(shared_directive or "").strip()
|
||||
@@ -107,11 +112,14 @@ def format_sequence_prompt(
|
||||
sections.append(directive)
|
||||
cursor = 0.0
|
||||
for clip in sequence["clips"]:
|
||||
duration = float(clip["duration"])
|
||||
chunk_lines = [f"[{cursor:g}-{cursor + duration:g}s]"]
|
||||
for slot in clip["slots"]:
|
||||
start = cursor + float(slot["start"])
|
||||
end = cursor + float(slot["end"])
|
||||
sections.append(f"[{start:g}-{end:g}s]\n{slot['text']}")
|
||||
cursor += float(clip["duration"])
|
||||
start = float(slot["start"])
|
||||
end = float(slot["end"])
|
||||
chunk_lines.append(f"{start:g}-{end:g}s: {slot['text']}")
|
||||
sections.append("\n".join(chunk_lines))
|
||||
cursor += duration
|
||||
sections.append(f"overall_soundscape: {str(soundscape or '').strip() or 'N/A'}")
|
||||
sections.append(f"non_diegetic_music: {str(music or '').strip() or 'N/A'}")
|
||||
return "\n\n".join(sections).strip()
|
||||
|
||||
Reference in New Issue
Block a user