{"record":{"id":"91e9825dd9938e2a","repo":"calesthio/OpenMontage","slug":"resolution-must-be-480p-720p-1080p-or-4k","errorCode":null,"errorMessage":"resolution must be 480p, 720p, 1080p, or 4k","messagePattern":"resolution must be 480p, 720p, 1080p, or 4k","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"tools/video/seedance_ark.py","lineNumber":701,"sourceCode":"                ),\n                duration_seconds=round(time.time() - started, 2),\n            )\n\n    def _build_payload(self, inputs: dict[str, Any]) -> dict[str, Any]:\n        operation = str(inputs.get(\"operation\", \"text_to_video\"))\n        if operation not in {\n            \"text_to_video\",\n            \"image_to_video\",\n            \"reference_to_video\",\n        }:\n            raise ValueError(\n                \"operation must be text_to_video, image_to_video, or reference_to_video\"\n            )\n\n        model, variant = self._resolve_model(inputs)\n        resolution = str(inputs.get(\"resolution\", \"720p\")).lower()\n        if resolution not in self.OUTPUT_DIMENSIONS:\n            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(","sourceCodeStart":683,"sourceCodeEnd":719,"githubUrl":"https://github.com/calesthio/OpenMontage/blob/95e1c3d0ab93482159818560f6a8c8e866b9139f/tools/video/seedance_ark.py#L683-L719","documentation":"Second check in `_build_payload`: after lowercasing, `resolution` (default '720p') must be a key in the tool's `OUTPUT_DIMENSIONS` map — 480p, 720p, 1080p, or 4k. These are the resolutions Ark's Seedance content-generation API accepts; anything else (e.g. '1440p', '2k', '540p') would be rejected by or confuse the provider, so the tool fails fast before the paid POST.","triggerScenarios":"Passing `resolution: '2k'`, `'1440p'`, `'sd'`, `'hd'`, or an empty string; passing 1080 (int) which lowercases to '1080' without the 'p'; typos like '720P' actually pass (case is lowered) but '720 p' fails.","commonSituations":"Porting settings from another provider whose resolution vocabulary differs (fal/Runway use different tokens); treating the value as a dimension pair or pixel height; config defaults left as placeholders.","solutions":["Use exactly one of: '480p', '720p', '1080p', '4k' (case-insensitive)","Note that the 4k literal has no 'p' — '4kp' is invalid","Cross-check the variant constraint: if the model variant is 2.5/fast/mini, only 480p/720p are allowed (next check)"],"exampleFix":"# before\ninputs = {\"resolution\": \"2k\", \"prompt\": \"...\"}\n# after\ninputs = {\"resolution\": \"1080p\", \"prompt\": \"...\"}","handlingStrategy":"validation","validationCode":"VALID_RES = {\"480p\", \"720p\", \"1080p\", \"4k\"}\nresolution = str(inputs.get(\"resolution\", \"720p\")).lower()\nif resolution not in VALID_RES:\n    raise ValueError(f\"resolution {resolution!r} not in {sorted(VALID_RES)}\")","typeGuard":"def is_valid_resolution(r: object) -> bool:\n    return str(r).lower() in {\"480p\", \"720p\", \"1080p\", \"4k\"}","tryCatchPattern":null,"preventionTips":["Normalize resolution through a helper that maps provider vocabularies ('2k'→'1080p' decisions made explicitly)","Remember '4k' has no trailing p"],"tags":["seedance","ark","input-validation","resolution"],"backgroundTag":null,"analyzedSha":"95e1c3d0ab93482159818560f6a8c8e866b9139f","analyzedAt":"2026-08-15T06:31:20.014Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}