{"record":{"id":"90d92b97e14726a9","repo":"calesthio/OpenMontage","slug":"reference-to-video-accepts-at-most-3-reference-aud","errorCode":null,"errorMessage":"reference_to_video accepts at most 3 reference audio clips (maximum {max_audios})","messagePattern":"reference_to_video accepts at most 3 reference audio clips \\(maximum (.+?)\\)","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"tools/video/seedance_ark.py","lineNumber":815,"sourceCode":"                        f\"each reference video duration must be 2 to {max_reference_seconds} seconds\"\n                    )\n                if (\n                    sum(float(value) for value in video_durations)\n                    > max_reference_seconds\n                ):\n                    raise ValueError(\n                        \"all reference videos together must be at most \"\n                        f\"{max_reference_seconds} seconds\"\n                    )\n\n            audio_refs = list(inputs.get(\"reference_audio_urls\") or [])\n            audio_refs.extend(inputs.get(\"reference_audio_paths\") or [])\n            if inputs.get(\"reference_audio_url\"):\n                audio_refs.append(inputs[\"reference_audio_url\"])\n            if inputs.get(\"reference_audio_path\"):\n                audio_refs.append(inputs[\"reference_audio_path\"])\n            if len(audio_refs) > max_audios:\n                raise ValueError(\n                    \"reference_to_video accepts at most 3 reference audio \"\n                    f\"clips (maximum {max_audios})\"\n                )\n            audio_durations = list(inputs.get(\"reference_audio_durations\") or [])\n            if audio_durations:\n                if len(audio_durations) != len(audio_refs):\n                    raise ValueError(\n                        \"reference_audio_durations must match the number of \"\n                        \"reference audio clips\"\n                    )\n                if any(\n                    float(value) < 2 or float(value) > max_reference_seconds\n                    for value in audio_durations\n                ):\n                    raise ValueError(\n                        f\"each reference audio duration must be 2 to {max_reference_seconds} seconds\"\n                    )\n                if (","sourceCodeStart":797,"sourceCodeEnd":833,"githubUrl":"https://github.com/calesthio/OpenMontage/blob/95e1c3d0ab93482159818560f6a8c8e866b9139f/tools/video/seedance_ark.py#L797-L833","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Reduce audio refs to 3 or fewer (10 with model_variant='2.5')","Merge audio clips into a single file before referencing","Set model_variant='2.5' when more clips are genuinely needed"],"exampleFix":"# before\ninputs = {\"reference_audio_urls\": stems[:8]}  # standard variant\n\n# after\ninputs = {\"model_variant\": \"2.5\", \"reference_audio_urls\": stems[:8]}","handlingStrategy":"validation","validationCode":"variant = str(inputs.get(\"model_variant\", \"standard\")).lower()\nmax_audios = 10 if variant == \"2.5\" else 3\naudio_refs = list(inputs.get(\"reference_audio_urls\") or []) + list(inputs.get(\"reference_audio_paths\") or [])\nif inputs.get(\"reference_audio_url\"): audio_refs.append(inputs[\"reference_audio_url\"])\nif inputs.get(\"reference_audio_path\"): audio_refs.append(inputs[\"reference_audio_path\"])\nassert len(audio_refs) <= max_audios","typeGuard":"def within_audio_limit(inputs: dict) -> bool:\n    variant = str(inputs.get(\"model_variant\", \"standard\")).lower()\n    refs = (list(inputs.get(\"reference_audio_urls\") or [])\n            + list(inputs.get(\"reference_audio_paths\") or [])\n            + ([inputs[\"reference_audio_url\"]] if inputs.get(\"reference_audio_url\") else [])\n            + ([inputs[\"reference_audio_path\"]] if inputs.get(\"reference_audio_path\") else []))\n    return len(refs) <= (10 if variant == \"2.5\" else 3)","tryCatchPattern":null,"preventionTips":["Merge stems into one reference track before calling","Remember the message's literal '3' is wrong on 2.5; the real cap is 10"],"tags":["validation","seedance","ark","reference-to-video","audio","limits","error-message-bug"],"backgroundTag":null,"analyzedSha":"95e1c3d0ab93482159818560f6a8c8e866b9139f","analyzedAt":"2026-08-15T06:31:20.014Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}