calesthio/OpenMontage · error · ValueError
each reference audio duration must be 2 to {max_reference_se
Error message
each reference audio duration must be 2 to {max_reference_seconds} seconds What it means
Raised when any entry in reference_audio_durations is under 2 seconds or over the reference cap (15s standard variants, 30s on 2.5). Each audio clip hint must fall inside the window Ark can actually use.
Source
Thrown at tools/video/seedance_ark.py:830
if inputs.get("reference_audio_path"):
audio_refs.append(inputs["reference_audio_path"])
if len(audio_refs) > max_audios:
raise ValueError(
"reference_to_video accepts at most 3 reference audio "
f"clips (maximum {max_audios})"
)
audio_durations = list(inputs.get("reference_audio_durations") or [])
if audio_durations:
if len(audio_durations) != len(audio_refs):
raise ValueError(
"reference_audio_durations must match the number of "
"reference audio clips"
)
if any(
float(value) < 2 or float(value) > max_reference_seconds
for value in audio_durations
):
raise ValueError(
f"each reference audio duration must be 2 to {max_reference_seconds} seconds"
)
if (
sum(float(value) for value in audio_durations)
> max_reference_seconds
):
raise ValueError(
"all reference audio clips together must be at most "
f"{max_reference_seconds} seconds"
)
local_audio_durations = [
duration
for ref in audio_refs
if (
duration := self._local_or_data_audio_duration(
str(ref), max_seconds=max_reference_seconds
)
)View on GitHub (pinned to 95e1c3d0ab)
Solutions
- Clamp each duration entry to the 2..15 (or 2..30 on 2.5) range
- Trim or loop source audio so the referenced window is inside the range
- Use model_variant='2.5' for clips up to 30s
Example fix
# before
inputs = {"reference_audio_durations": [1, 3000]}
# after
inputs = {"reference_audio_durations": [2, 15]} Defensive patterns
Strategy: validation
Validate before calling
max_s = 30 if str(inputs.get("model_variant", "standard")).lower() == "2.5" else 15
assert all(2 <= float(d) <= max_s for d in inputs.get("reference_audio_durations") or []) Type guard
def valid_audio_durations(durations: list, max_s: int = 15) -> bool:
return all(2 <= float(d) <= max_s for d in durations or []) Prevention
- Reject ms-scale values (>1000) at the boundary as a units bug
- Trim source audio to the window you reference
When it happens
Trigger: A durations entry of 1, 0.5, 20 (non-2.5), or 45 (2.5); passing milliseconds like 3000 instead of seconds.
Common situations: Referencing very short stingers or long music beds; assuming audio has no duration limits; unit confusion between ms and s.
Related errors
- all reference audio clips together must be at most {max_refe
- all local reference audio clips together must be at most {ma
- each reference video duration must be 2 to {max_reference_se
- all reference videos together must be at most {max_reference
- reference_to_video accepts at most 3 reference audio clips (
AI-assisted analysis of calesthio/OpenMontage@95e1c3d0ab (2026-08-15).
Data as JSON: /api/errors/936eb43b221f9482.
Report an issue: GitHub.