{"record":{"id":"963b9fb31990eb33","repo":"calesthio/OpenMontage","slug":"provide-only-one-of-end-image-url-end-image-path","errorCode":null,"errorMessage":"provide only one of end_image_url/end_image_path","messagePattern":"provide only one of end_image_url/end_image_path","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"tools/video/seedance_ark.py","lineNumber":758,"sourceCode":"                raise ValueError(\n                    \"text_to_video does not accept reference media; use \"\n                    \"image_to_video or reference_to_video\"\n                )\n        elif operation == \"image_to_video\":\n            first_refs = self._single_image_refs(inputs)\n            if len(first_refs) != 1:\n                raise ValueError(\"image_to_video requires exactly one reference image\")\n            content.append(self._image_content(first_refs[0], role=\"first_frame\"))\n            end_refs = [\n                value\n                for value in (\n                    inputs.get(\"end_image_url\"),\n                    inputs.get(\"end_image_path\"),\n                )\n                if value\n            ]\n            if len(end_refs) > 1:\n                raise ValueError(\"provide only one of end_image_url/end_image_path\")\n            if end_refs:\n                content.append(self._image_content(end_refs[0], role=\"last_frame\"))\n        else:\n            image_refs = list(inputs.get(\"reference_image_urls\") or [])\n            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","sourceCodeStart":740,"sourceCodeEnd":776,"githubUrl":"https://github.com/calesthio/OpenMontage/blob/95e1c3d0ab93482159818560f6a8c8e866b9139f/tools/video/seedance_ark.py#L740-L776","documentation":"Raised when operation is 'image_to_video' and both end_image_url and end_image_path are non-empty. The Ark last-frame slot takes one image, so providing the end frame through two channels at once is ambiguous and rejected before the request is sent.","triggerScenarios":"inputs containing truthy values for both end_image_url and end_image_path simultaneously under image_to_video.","commonSituations":"A config template that fills both URL and local-path variants of every field; migrating a caller from paths to URLs without clearing the old key.","solutions":["Keep only one end-frame key (end_image_url for remote, end_image_path for local) and delete the other","If both point at the same asset, keep the URL variant"],"exampleFix":"# before\ninputs = {\"operation\": \"image_to_video\", \"reference_image_url\": a,\n           \"end_image_url\": eu, \"end_image_path\": ep}\n\n# after\ninputs = {\"operation\": \"image_to_video\", \"reference_image_url\": a,\n           \"end_image_url\": eu}","handlingStrategy":"validation","validationCode":"if inputs.get(\"end_image_url\") and inputs.get(\"end_image_path\"):\n    raise ValueError(\"set only one of end_image_url/end_image_path\")\n# or: inputs.pop(\"end_image_path\", None) when a URL is present","typeGuard":"def has_single_end_frame(inputs: dict) -> bool:\n    return bool(inputs.get(\"end_image_url\")) != bool(inputs.get(\"end_image_path\"))","tryCatchPattern":null,"preventionTips":["Prefer URL keys for remote assets and never populate both variants","Normalize input dicts through one sanitizer before the builder"],"tags":["validation","seedance","ark","image-to-video","input-validation"],"backgroundTag":null,"analyzedSha":"95e1c3d0ab93482159818560f6a8c8e866b9139f","analyzedAt":"2026-08-15T06:31:20.014Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}