{"record":{"id":"e2d58941c695d4ae","repo":"Comfy-Org/ComfyUI","slug":"kling-video-o1-does-not-support-durations-greater","errorCode":null,"errorMessage":"kling-video-o1 does not support durations greater than 10 seconds.","messagePattern":"kling-video-o1 does not support durations greater than 10 seconds\\.","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"comfy_api_nodes/nodes_kling.py","lineNumber":869,"sourceCode":"\n    @classmethod\n    async def execute(\n        cls,\n        model_name: str,\n        prompt: str,\n        duration: int,\n        first_frame: Input.Image,\n        end_frame: Input.Image | None = None,\n        reference_images: Input.Image | None = None,\n        resolution: str = \"1080p\",\n        storyboards: dict | None = None,\n        generate_audio: bool = False,\n        seed: int = 0,\n    ) -> IO.NodeOutput:\n        _ = seed\n        if model_name == \"kling-video-o1\":\n            if duration > 10:\n                raise ValueError(\"kling-video-o1 does not support durations greater than 10 seconds.\")\n            if generate_audio:\n                raise ValueError(\"kling-video-o1 does not support audio generation.\")\n            if resolution == \"4k\":\n                raise ValueError(\"kling-video-o1 does not support 4k resolution.\")\n        stories_enabled = storyboards is not None and storyboards[\"storyboards\"] != \"disabled\"\n        if stories_enabled and model_name == \"kling-video-o1\":\n            raise ValueError(\"kling-video-o1 does not support storyboards.\")\n        prompt = normalize_omni_prompt_references(prompt)\n        validate_string(prompt, strip_whitespace=True, min_length=0 if stories_enabled else 1, max_length=2500)\n        if end_frame is not None and reference_images is not None:\n            raise ValueError(\"The 'end_frame' input cannot be used simultaneously with 'reference_images'.\")\n        if end_frame is not None and stories_enabled:\n            raise ValueError(\"The 'end_frame' input cannot be used simultaneously with storyboards.\")\n        if (\n            model_name == \"kling-video-o1\"\n            and duration not in (5, 10)\n            and end_frame is None\n            and reference_images is None","sourceCodeStart":851,"sourceCodeEnd":887,"githubUrl":"https://github.com/Comfy-Org/ComfyUI/blob/1c6d8d45b3693bfbb32385b410d813a7fd6be216/comfy_api_nodes/nodes_kling.py#L851-L887","documentation":"Image-to-video variant of the o1 duration guard: for kling-video-o1 i2v, duration must be at most 10 seconds (checked as duration > 10, slightly looser than the t2v node's exact 5-or-10 check, though the later per-model branch still enforces 5/10). Any duration above 10 raises before the request.","triggerScenarios":"kling-video-o1 image-to-video with duration set to 15+; workflows migrated from models supporting longer i2v durations.","commonSituations":"Model swap without adjusting duration; assuming i2v supports t2v's longer-duration tiers.","solutions":["Set duration to 10 seconds or fewer (5 or 10 are the supported values)","Use a different model for longer image-to-video clips","Generate in segments and concatenate with a video-join node"],"exampleFix":"// before\nmodel_name = \"kling-video-o1\"; duration = 15\n\n// after\nmodel_name = \"kling-video-o1\"; duration = 10","handlingStrategy":"validation","validationCode":"def o1_i2v_duration_ok(model_name: str, duration: int) -> bool:\n    return model_name != \"kling-video-o1\" or duration <= 10\n\nassert o1_i2v_duration_ok(model_name, duration)","typeGuard":"def i2v_duration_supported(model_name: str, duration: int) -> bool:\n    if model_name != \"kling-video-o1\":\n        return True\n    return duration <= 10 and duration in (5, 10)  # later branch enforces 5/10","tryCatchPattern":"try:\n    out = await kling_i2v_node(model_name=model, duration=duration, ...)\nexcept ValueError as e:\n    if \"does not support durations\" in str(e):\n        out = await kling_i2v_node(model_name=model, duration=10, ...)\n    else:\n        raise","preventionTips":["Cap o1 i2v duration at 10s (use 5 or 10)","For longer i2v, chain clips and join, or switch model"],"tags":["kling","model-constraints","duration","image-to-video","validation"],"backgroundTag":null,"analyzedSha":"1c6d8d45b3693bfbb32385b410d813a7fd6be216","analyzedAt":"2026-08-14T19:37:18.893Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}