calesthio/OpenMontage · error · ValueError

all reference audio clips together must be at most {max_refe

Error message

all reference audio clips together must be at most {max_reference_seconds} seconds

What it means

Raised when the sum of reference_audio_durations exceeds the total reference budget (15s standard variants, 30s on 2.5). Individually valid clips can still break the combined cap, mirroring the video-side rule.

Source

Thrown at tools/video/seedance_ark.py:837

            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
                    )
                )
                is not None
            ]
            if sum(local_audio_durations) > max_reference_seconds:
                raise ValueError(
                    "all local reference audio clips together must be at "
                    f"most {max_reference_seconds} seconds"
                )

View on GitHub (pinned to 95e1c3d0ab)

Solutions

  1. Reduce durations or clip count until the sum is within 15 (or 30 on 2.5)
  2. Concatenate clips into one file and reference it once
  3. Switch to model_variant='2.5' for the larger budget

Example fix

# before
inputs = {"reference_audio_durations": [5, 5, 5, 5]}  # 20 > 15

# after
inputs = {"reference_audio_durations": [5, 5, 5]}  # 15 ok
Defensive patterns

Strategy: validation

Validate before calling

max_s = 30 if str(inputs.get("model_variant", "standard")).lower() == "2.5" else 15
assert sum(float(d) for d in inputs.get("reference_audio_durations") or []) <= max_s

Type guard

def within_total_audio_budget(durations: list, max_s: int = 15) -> bool:
    return sum(float(d) for d in durations or []) <= max_s

Prevention

When it happens

Trigger: Four valid 5-second audio durations on standard (20 > 15), or eleven 3-second clips on 2.5 (33 > 30).

Common situations: Stacking near-cap clips; assuming only per-clip duration is checked; porting a 2.5 workload back to a standard variant.

Related errors


AI-assisted analysis of calesthio/OpenMontage@95e1c3d0ab (2026-08-15). Data as JSON: /api/errors/bb59a7cf37246d82. Report an issue: GitHub.