{"record":{"id":"07f019a845328449","repo":"Comfy-Org/ComfyUI","slug":"keyframe-time-times-1-s-is-past-the-end-of-a-c","errorCode":null,"errorMessage":"Keyframe time {times[-1]}s is past the end of a {cap}s clip.","messagePattern":"Keyframe time (.+?)s is past the end of a (.+?)s clip\\.","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"comfy_api_nodes/nodes_bfl.py","lineNumber":1075,"sourceCode":"    \"\"\"Parse one keyframe time in seconds per image: increasing, inside the clip.\"\"\"\n    parts = [part.strip() for part in value.split(\",\") if part.strip()]\n    if len(parts) != image_count:\n        raise ValueError(\n            f\"Give one time per keyframe image: got {len(parts)} time(s) for {image_count} image(s).\"\n        )\n    try:\n        times = [float(part) for part in parts]\n    except ValueError as exc:\n        raise ValueError(f\"Keyframe times must be numbers in seconds, comma-separated; got '{value}'.\") from exc\n    if not all(math.isfinite(time) for time in times):\n        raise ValueError(f\"Keyframe times must be finite numbers in seconds; got '{value}'.\")\n    if any(later <= earlier for earlier, later in zip(times, times[1:])):\n        raise ValueError(f\"Keyframe times must increase; got {times}.\")\n    if times[0] < 0:\n        raise ValueError(f\"Keyframe times cannot be negative; got {times[0]}.\")\n    cap = _FLUX3_MAX_DURATION if duration == \"auto\" else int(duration)\n    if times[-1] > cap:\n        raise ValueError(f\"Keyframe time {times[-1]}s is past the end of a {cap}s clip.\")\n    return times\n\n\nclass Flux3VideoNodeBase(IO.ComfyNode):\n    \"\"\"Shared widgets, request plumbing and polling for the FLUX 3 generation modes.\"\"\"\n\n    RATE_HD: float\n    RATE_FHD: float\n\n    @classmethod\n    def common_inputs(cls) -> list:\n        return [\n            IO.Combo.Input(\n                \"aspect_ratio\",\n                options=_FLUX3_ASPECT_RATIOS,\n                default=\"auto\",\n                tooltip=\"Output aspect ratio. 'auto' picks one from the prompt and inputs.\",\n            ),","sourceCodeStart":1057,"sourceCodeEnd":1093,"githubUrl":"https://github.com/Comfy-Org/ComfyUI/blob/1c6d8d45b3693bfbb32385b410d813a7fd6be216/comfy_api_nodes/nodes_bfl.py#L1057-L1093","documentation":"The last keyframe time must fall inside the generated clip: it is compared against cap = 20 (duration 'auto') or the chosen integer duration in seconds. A final keyframe past the end would reference a moment the video never reaches.","triggerScenarios":"Passing a times string whose largest value exceeds the duration setting — e.g. '0, 15, 18' with duration=10, or any value > 20 with duration='auto'.","commonSituations":"Lowering the duration widget after writing times; keeping times from a longer template clip; assuming 'auto' extends beyond 20s.","solutions":["Raise the duration setting to at least ceil(last_time) seconds.","Or rescale/trim times so the last one is <= duration.","Remember duration='auto' caps at 20 seconds, not infinity."],"exampleFix":"# before\nduration = \"10\"; keyframe_times = \"0, 8, 16\"  # 16 > 10 -> ValueError\n\n# after\nduration = \"20\"; keyframe_times = \"0, 8, 16\"","handlingStrategy":"validation","validationCode":"cap = 20 if duration == \"auto\" else int(duration)\ntimes = [float(p) for p in value.split(\",\")]\nassert times[-1] <= cap, f\"last keyframe {times[-1]}s exceeds {cap}s clip\"","typeGuard":"def last_time_within_clip(times: list[float], duration: int | str) -> bool:\n    cap = 20 if duration == \"auto\" else int(duration)\n    return times[-1] <= cap","tryCatchPattern":null,"preventionTips":["Set duration >= ceil(last keyframe time).","Rescale times when lowering duration.","Remember duration='auto' caps at 20 seconds."],"tags":["bfl","flux3","keyframes","duration","bounds-check"],"backgroundTag":null,"analyzedSha":"1c6d8d45b3693bfbb32385b410d813a7fd6be216","analyzedAt":"2026-08-14T19:37:18.893Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}