calesthio/OpenMontage · error · ValueError

reference_to_video accepts at most 3 reference audio clips (

Error message

reference_to_video accepts at most 3 reference audio clips (maximum {max_audios})

What it means

Raised in reference_to_video mode when audio references (reference_audio_urls + reference_audio_paths + singular url/path keys) exceed the limit: 10 for variant 2.5, 3 otherwise. Note the message hardcodes 'at most 3' in its wording while interpolating the actual max, so on 2.5 the text can mislead; trust the limit logic, not the numeral.

Source

Thrown at tools/video/seedance_ark.py:815

                        f"each reference video duration must be 2 to {max_reference_seconds} seconds"
                    )
                if (
                    sum(float(value) for value in video_durations)
                    > max_reference_seconds
                ):
                    raise ValueError(
                        "all reference videos together must be at most "
                        f"{max_reference_seconds} seconds"
                    )

            audio_refs = list(inputs.get("reference_audio_urls") or [])
            audio_refs.extend(inputs.get("reference_audio_paths") or [])
            if inputs.get("reference_audio_url"):
                audio_refs.append(inputs["reference_audio_url"])
            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 (

View on GitHub (pinned to 95e1c3d0ab)

Solutions

  1. Reduce audio refs to 3 or fewer (10 with model_variant='2.5')
  2. Merge audio clips into a single file before referencing
  3. Set model_variant='2.5' when more clips are genuinely needed

Example fix

# before
inputs = {"reference_audio_urls": stems[:8]}  # standard variant

# after
inputs = {"model_variant": "2.5", "reference_audio_urls": stems[:8]}
Defensive patterns

Strategy: validation

Validate before calling

variant = str(inputs.get("model_variant", "standard")).lower()
max_audios = 10 if variant == "2.5" else 3
audio_refs = list(inputs.get("reference_audio_urls") or []) + list(inputs.get("reference_audio_paths") or [])
if inputs.get("reference_audio_url"): audio_refs.append(inputs["reference_audio_url"])
if inputs.get("reference_audio_path"): audio_refs.append(inputs["reference_audio_path"])
assert len(audio_refs) <= max_audios

Type guard

def within_audio_limit(inputs: dict) -> bool:
    variant = str(inputs.get("model_variant", "standard")).lower()
    refs = (list(inputs.get("reference_audio_urls") or [])
            + list(inputs.get("reference_audio_paths") or [])
            + ([inputs["reference_audio_url"]] if inputs.get("reference_audio_url") else [])
            + ([inputs["reference_audio_path"]] if inputs.get("reference_audio_path") else []))
    return len(refs) <= (10 if variant == "2.5" else 3)

Prevention

When it happens

Trigger: More than 3 audio refs on standard/fast/mini, or more than 10 on 2.5; e.g. passing a per-scene SFX list as individual reference clips.

Common situations: Splitting one soundtrack into stems/shots and passing each as a reference; reading the error on 2.5 and being told '3' when the real cap is 10.

Related errors


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