{"record":{"id":"4f48e832b7911325","repo":"calesthio/OpenMontage","slug":"each-reference-video-duration-must-be-2-to-max-re","errorCode":null,"errorMessage":"each reference video duration must be 2 to {max_reference_seconds} seconds","messagePattern":"each reference video duration must be 2 to (.+?) seconds","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"tools/video/seedance_ark.py","lineNumber":796,"sourceCode":"            if inputs.get(\"reference_video_url\"):\n                video_refs.append(inputs[\"reference_video_url\"])\n            if len(video_refs) > max_videos:\n                raise ValueError(\n                    f\"reference_to_video accepts at most {max_videos} reference videos\"\n                )\n            self._validate_remote_refs(video_refs, \"reference video\")\n            video_durations = list(inputs.get(\"reference_video_durations\") or [])\n            if video_durations:\n                if len(video_durations) != len(video_refs):\n                    raise ValueError(\n                        \"reference_video_durations must match the number of \"\n                        \"reference videos\"\n                    )\n                if any(\n                    float(value) < 2 or float(value) > max_reference_seconds\n                    for value in video_durations\n                ):\n                    raise ValueError(\n                        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:","sourceCodeStart":778,"sourceCodeEnd":814,"githubUrl":"https://github.com/calesthio/OpenMontage/blob/95e1c3d0ab93482159818560f6a8c8e866b9139f/tools/video/seedance_ark.py#L778-L814","documentation":"Raised when any value in reference_video_durations is below 2 seconds or above the model's per-reference cap (15s for standard/fast/mini, 30s for 2.5). Ark cannot trim a reference video outside this window, so the builder rejects it before upload.","triggerScenarios":"A reference_video_durations entry like 1, 0.5, 20 (non-2.5), or 45 (2.5).","commonSituations":"Assuming any clip length is acceptable; using the 2.5 limits (30s) against a standard-variant model; passing milliseconds (e.g. 5000) instead of seconds.","solutions":["Set each entry in reference_video_durations to a value between 2 and 15 (or 30 with model_variant='2.5')","Trim the source clips to the window you actually want referenced","Use model_variant='2.5' if references longer than 15s are required"],"exampleFix":"# before\ninputs = {\"reference_video_durations\": [1.5, 20]}  # standard variant\n\n# after\ninputs = {\"reference_video_durations\": [2, 15]}","handlingStrategy":"validation","validationCode":"variant = str(inputs.get(\"model_variant\", \"standard\")).lower()\nmax_s = 30 if variant == \"2.5\" else 15\nassert all(2 <= float(d) <= max_s for d in inputs.get(\"reference_video_durations\") or [])","typeGuard":"def valid_video_durations(durations: list, max_s: int = 15) -> bool:\n    return all(2 <= float(d) <= max_s for d in durations or [])","tryCatchPattern":null,"preventionTips":["Clamp durations to [2, max] and trim the source clip to match","Keep units in seconds everywhere; reject ms-scale values (>1000) in review"],"tags":["validation","seedance","ark","durations","limits"],"backgroundTag":null,"analyzedSha":"95e1c3d0ab93482159818560f6a8c8e866b9139f","analyzedAt":"2026-08-15T06:31:20.014Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}