{"record":{"id":"2ed718e9bb993705","repo":"calesthio/OpenMontage","slug":"reference-to-video-accepts-at-most-max-videos-re","errorCode":null,"errorMessage":"reference_to_video accepts at most {max_videos} reference videos","messagePattern":"reference_to_video accepts at most (.+?) reference videos","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"tools/video/seedance_ark.py","lineNumber":781,"sourceCode":"            image_refs.extend(inputs.get(\"reference_image_paths\") or [])\n            if inputs.get(\"reference_image_url\"):\n                image_refs.append(inputs[\"reference_image_url\"])\n            if inputs.get(\"reference_image_path\"):\n                image_refs.append(inputs[\"reference_image_path\"])\n            max_images = 30 if variant == \"2.5\" else 9\n            max_videos = 10 if variant == \"2.5\" else 3\n            max_audios = 10 if variant == \"2.5\" else 3\n            max_reference_seconds = 30 if variant == \"2.5\" else 15\n            if len(image_refs) > max_images:\n                raise ValueError(\n                    f\"reference_to_video accepts at most {max_images} reference images\"\n                )\n\n            video_refs = list(inputs.get(\"reference_video_urls\") or [])\n            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 (","sourceCodeStart":763,"sourceCodeEnd":799,"githubUrl":"https://github.com/calesthio/OpenMontage/blob/95e1c3d0ab93482159818560f6a8c8e866b9139f/tools/video/seedance_ark.py#L763-L799","documentation":"Raised in reference_to_video mode when the count of video references (reference_video_urls list plus singular reference_video_url) exceeds the model limit: 10 for variant 2.5, 3 otherwise. Note reference_video_path is rejected earlier for Ark, so only URL-based refs count here.","triggerScenarios":"operation='reference_to_video' with more than 3 video URL refs (or more than 10 with model_variant='2.5').","commonSituations":"Passing a clip playlist as multiple reference videos; assuming the 2.5 limits apply to every variant.","solutions":["Reduce reference_video_urls to at most 3 (or 10 with model_variant='2.5')","Concatenate clips into fewer reference videos with ffmpeg first","Switch to model_variant='2.5' when the larger reference set is required"],"exampleFix":"# before\ninputs = {\"operation\": \"reference_to_video\", \"reference_video_urls\": clips[:6]}\n\n# after\ninputs = {\"operation\": \"reference_to_video\", \"model_variant\": \"2.5\",\n          \"reference_video_urls\": clips[:6]}","handlingStrategy":"validation","validationCode":"variant = str(inputs.get(\"model_variant\", \"standard\")).lower()\nmax_videos = 10 if variant == \"2.5\" else 3\nvideo_refs = list(inputs.get(\"reference_video_urls\") or [])\nif inputs.get(\"reference_video_url\"): video_refs.append(inputs[\"reference_video_url\"])\nassert len(video_refs) <= max_videos","typeGuard":"def within_video_limit(inputs: dict) -> bool:\n    v = list(inputs.get(\"reference_video_urls\") or [])\n    if inputs.get(\"reference_video_url\"): v.append(inputs[\"reference_video_url\"])\n    return len(v) <= (10 if str(inputs.get(\"model_variant\", \"standard\")).lower() == \"2.5\" else 3)","tryCatchPattern":null,"preventionTips":["Concatenate clips before referencing when over the cap","Pick model_variant first, then size the reference set to its limits"],"tags":["validation","seedance","ark","reference-to-video","limits"],"backgroundTag":null,"analyzedSha":"95e1c3d0ab93482159818560f6a8c8e866b9139f","analyzedAt":"2026-08-15T06:31:20.014Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}