{"record":{"id":"78704d6fae466cc6","repo":"calesthio/OpenMontage","slug":"aspect-ratio-must-be-adaptive-21-9-16-9-4-3-1","errorCode":null,"errorMessage":"aspect_ratio must be adaptive, 21:9, 16:9, 4:3, 1:1, 3:4, or 9:16","messagePattern":"aspect_ratio must be adaptive, 21:9, 16:9, 4:3, 1:1, 3:4, or 9:16","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"tools/video/seedance_ark.py","lineNumber":719,"sourceCode":"            raise ValueError(\"resolution must be 480p, 720p, 1080p, or 4k\")\n        if variant in {\"2.5\", \"fast\", \"mini\"} and resolution not in {\n            \"480p\",\n            \"720p\",\n        }:\n            raise ValueError(f\"{variant} supports only 480p or 720p resolution\")\n\n        ratio = str(inputs.get(\"aspect_ratio\", \"16:9\"))\n        valid_ratios = {\n            \"adaptive\",\n            \"21:9\",\n            \"16:9\",\n            \"4:3\",\n            \"1:1\",\n            \"3:4\",\n            \"9:16\",\n        }\n        if ratio not in valid_ratios:\n            raise ValueError(\n                \"aspect_ratio must be adaptive, 21:9, 16:9, 4:3, 1:1, 3:4, or 9:16\"\n            )\n\n        max_duration = 30 if variant == \"2.5\" else 15\n        duration = self._normalize_duration(inputs.get(\"duration\", 5), max_duration)\n        prompt = str(inputs.get(\"prompt\") or \"\").strip()\n        content: list[dict[str, Any]] = []\n        if prompt:\n            content.append({\"type\": \"text\", \"text\": prompt})\n\n        if inputs.get(\"reference_video_path\"):\n            raise ValueError(\n                \"reference_video_path is not supported by Ark; upload the \"\n                \"video to a public/signed HTTPS URL or Ark asset first\"\n            )\n\n        if operation == \"text_to_video\":\n            if not prompt:","sourceCodeStart":701,"sourceCodeEnd":737,"githubUrl":"https://github.com/calesthio/OpenMontage/blob/95e1c3d0ab93482159818560f6a8c8e866b9139f/tools/video/seedance_ark.py#L701-L737","documentation":"Aspect-ratio gate in `_build_payload`: `aspect_ratio` (default '16:9') must be one of adaptive, 21:9, 16:9, 4:3, 1:1, 3:4, or 9:16 — the ratios Ark's video API accepts. 'adaptive' lets the provider infer the ratio from reference images. Any other string (or a malformed ratio like '16:9:9') is rejected before payload assembly.","triggerScenarios":"Passing `aspect_ratio: '16-9'` (dash), `'vertical'`, `'9x16'` (x instead of colon), `'4:5'`, or wrong-case 'ADAPTIVE'; copying a social-platform spec token like '9:16.0'.","commonSituations":"Social-media presets using non-Ark vocabulary; region-specific ratios (4:5 Instagram) that Ark does not offer; format confusion between 'W:H' and 'H:W' — 3:4 is portrait-tall while 4:3 is landscape, and mixing them up does not error but gives the wrong orientation.","solutions":["Use one of the seven exact tokens; colon separator, lowercase","For portrait video choose '9:16' (not '16:9'), for tall-narrow choose '3:4'","For image-to-video with a reference, 'adaptive' matches the source image"],"exampleFix":"# before\ninputs = {\"aspect_ratio\": \"9x16\", \"prompt\": \"...\"}\n# after\ninputs = {\"aspect_ratio\": \"9:16\", \"prompt\": \"...\"}","handlingStrategy":"validation","validationCode":"VALID_RATIOS = {\"adaptive\", \"21:9\", \"16:9\", \"4:3\", \"1:1\", \"3:4\", \"9:16\"}\nratio = str(inputs.get(\"aspect_ratio\", \"16:9\"))\nif ratio not in VALID_RATIOS:\n    raise ValueError(f\"aspect_ratio {ratio!r} not in {sorted(VALID_RATIOS)}\")","typeGuard":"def is_valid_aspect_ratio(r: object) -> bool:\n    return str(r) in {\"adaptive\", \"21:9\", \"16:9\", \"4:3\", \"1:1\", \"3:4\", \"9:16\"}","tryCatchPattern":null,"preventionTips":["Map platform presets to Ark tokens in one place: shorts/reels → 9:16, standard → 16:9, image-matched → adaptive","Use colons, not dashes or x; orientation matters (3:4 vs 4:3)"],"tags":["seedance","ark","input-validation","aspect-ratio"],"backgroundTag":null,"analyzedSha":"95e1c3d0ab93482159818560f6a8c8e866b9139f","analyzedAt":"2026-08-15T06:31:20.014Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}