{"record":{"id":"3f3cade921acace2","repo":"calesthio/OpenMontage","slug":"reference-audio-requires-at-least-one-reference-im","errorCode":null,"errorMessage":"reference audio requires at least one reference image or video","messagePattern":"reference audio requires at least one reference image or video","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"tools/video/seedance_ark.py","lineNumber":857,"sourceCode":"                        f\"{max_reference_seconds} seconds\"\n                    )\n            local_audio_durations = [\n                duration\n                for ref in audio_refs\n                if (\n                    duration := self._local_or_data_audio_duration(\n                        str(ref), max_seconds=max_reference_seconds\n                    )\n                )\n                is not None\n            ]\n            if sum(local_audio_durations) > max_reference_seconds:\n                raise ValueError(\n                    \"all local reference audio clips together must be at \"\n                    f\"most {max_reference_seconds} seconds\"\n                )\n            if audio_refs and not (image_refs or video_refs):\n                raise ValueError(\n                    \"reference audio requires at least one reference image or video\"\n                )\n            if not (image_refs or video_refs):\n                raise ValueError(\n                    \"reference_to_video requires at least one image or video\"\n                )\n\n            content.extend(\n                self._image_content(ref, role=\"reference_image\") for ref in image_refs\n            )\n            content.extend(\n                {\n                    \"type\": \"video_url\",\n                    \"video_url\": {\"url\": str(ref)},\n                    \"role\": \"reference_video\",\n                }\n                for ref in video_refs\n            )","sourceCodeStart":839,"sourceCodeEnd":875,"githubUrl":"https://github.com/calesthio/OpenMontage/blob/95e1c3d0ab93482159818560f6a8c8e866b9139f/tools/video/seedance_ark.py#L839-L875","documentation":"Raised when audio references are supplied but no image or video references exist. Ark's reference audio is a conditioning signal bound to visual references, so audio-only reference_to_video requests are rejected client-side.","triggerScenarios":"operation='reference_to_video' with populated reference_audio_* keys and empty image and video ref collections.","commonSituations":"Trying to do audio-driven generation without visuals; cleanup code that drops image refs but leaves audio refs; splitting a multimodal payload across calls.","solutions":["Add at least one reference image or video to the same request","Remove the audio refs if no visual conditioning is intended","Use text_to_video with generate_audio if you only want audio in the output"],"exampleFix":"# before\ninputs = {\"operation\": \"reference_to_video\", \"prompt\": p,\n          \"reference_audio_urls\": [a]}\n\n# after\ninputs = {\"operation\": \"reference_to_video\", \"prompt\": p,\n          \"reference_image_url\": img, \"reference_audio_urls\": [a]}","handlingStrategy":"validation","validationCode":"has_audio = bool(collected_audio_refs(inputs))\nhas_visual = bool(image_ref_list(inputs)) or bool(video_ref_list(inputs))\nif has_audio and not has_visual:\n    inputs = {k: v for k, v in inputs.items() if not k.startswith(\"reference_audio\")}","typeGuard":"def audio_has_visual_partner(inputs: dict) -> bool:\n    return not collected_audio_refs(inputs) or bool(image_ref_list(inputs) or video_ref_list(inputs))","tryCatchPattern":null,"preventionTips":["Treat reference audio as an attachment to a visual ref, never standalone","Validate the visual ref exists before attaching audio"],"tags":["validation","seedance","ark","audio","reference-to-video"],"backgroundTag":null,"analyzedSha":"95e1c3d0ab93482159818560f6a8c8e866b9139f","analyzedAt":"2026-08-15T06:31:20.014Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}