{"record":{"id":"2f032e3935433cc3","repo":"calesthio/OpenMontage","slug":"duration-must-be-between-4-and-max-seconds-or-1","errorCode":null,"errorMessage":"duration must be between 4 and {max_seconds} or -1","messagePattern":"duration must be between 4 and (.+?) or -1","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"tools/video/seedance_ark.py","lineNumber":947,"sourceCode":"    def _normalize_duration(value: Any, max_seconds: int = 15) -> int:\n        if value == \"auto\":\n            return -1\n        if isinstance(value, bool):\n            raise ValueError(\n                f\"duration must be an integer from 4 to {max_seconds} or -1\"\n            )\n        try:\n            duration = int(value)\n        except (TypeError, ValueError) as exc:\n            raise ValueError(\n                f\"duration must be an integer from 4 to {max_seconds} or -1\"\n            ) from exc\n        if str(value).strip() not in {str(duration), \"auto\"}:\n            raise ValueError(\n                f\"duration must be an integer from 4 to {max_seconds} or -1\"\n            )\n        if duration != -1 and not 4 <= duration <= max_seconds:\n            raise ValueError(f\"duration must be between 4 and {max_seconds} or -1\")\n        return duration\n\n    @staticmethod\n    def _single_image_refs(inputs: dict[str, Any]) -> list[Any]:\n        refs = [\n            inputs.get(\"reference_image_url\") or inputs.get(\"image_url\"),\n            inputs.get(\"reference_image_path\") or inputs.get(\"image_path\"),\n        ]\n        return [ref for ref in refs if ref]\n\n    @staticmethod\n    def _has_any_media(inputs: dict[str, Any]) -> bool:\n        keys = (\n            \"reference_image_url\",\n            \"reference_image_path\",\n            \"reference_image_urls\",\n            \"reference_image_paths\",\n            \"reference_video_url\",","sourceCodeStart":929,"sourceCodeEnd":965,"githubUrl":"https://github.com/calesthio/OpenMontage/blob/95e1c3d0ab93482159818560f6a8c8e866b9139f/tools/video/seedance_ark.py#L929-L965","documentation":"Error \"duration must be between 4 and {max_seconds} or -1\" thrown in calesthio/OpenMontage.","triggerScenarios":"A duration outside the allowed 4-to-max_seconds range (and not -1 for auto) is passed to the Seedance Ark video tool.","commonSituations":"See trigger scenarios.","solutions":["Set duration to an integer between 4 and the model's max_seconds, or -1 for automatic duration.","Check the model variant's allowed duration range in the error message and adjust the value."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"95e1c3d0ab93482159818560f6a8c8e866b9139f","analyzedAt":"2026-08-15T06:31:20.014Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}