{"record":{"id":"956946596b0e27d1","repo":"Comfy-Org/ComfyUI","slug":"total-reference-video-duration-is-total-video-dur","errorCode":null,"errorMessage":"Total reference video duration is {total_video_duration:.1f}s. Maximum is {limits['max_total_seconds']} seconds.","messagePattern":"Total reference video duration is (.+?)s\\. Maximum is (.+?) seconds\\.","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"comfy_api_nodes/nodes_bytedance.py","lineNumber":2803,"sourceCode":"            if min_px:\n                for key in reference_videos:\n                    reference_videos[key] = upscale_video_to_min_pixels(reference_videos[key], min_px)\n\n        total_video_duration = 0.0\n        for i, key in enumerate(reference_videos, 1):\n            video = reference_videos[key]\n            _validate_ref_video_pixels(video, model_id, model[\"resolution\"], i)\n            try:\n                dur = video.get_duration()\n                if dur < 1.8:\n                    raise ValueError(f\"Reference video {i} is too short: {dur:.1f}s. Minimum duration is 1.8 seconds.\")\n                total_video_duration += dur\n            except ValueError:\n                raise\n            except Exception:\n                pass\n        if total_video_duration > limits[\"max_total_seconds\"]:\n            raise ValueError(\n                f\"Total reference video duration is {total_video_duration:.1f}s. \"\n                f\"Maximum is {limits['max_total_seconds']} seconds.\"\n            )\n\n        total_audio_duration = 0.0\n        for i, key in enumerate(reference_audios, 1):\n            audio = reference_audios[key]\n            dur = int(audio[\"waveform\"].shape[-1]) / int(audio[\"sample_rate\"])\n            if dur < 1.8:\n                raise ValueError(f\"Reference audio {i} is too short: {dur:.1f}s. Minimum duration is 1.8 seconds.\")\n            total_audio_duration += dur\n        if total_audio_duration > limits[\"max_total_seconds\"]:\n            raise ValueError(\n                f\"Total reference audio duration is {total_audio_duration:.1f}s. \"\n                f\"Maximum is {limits['max_total_seconds']} seconds.\"\n            )\n\n        asset_labels = _build_asset_labels(","sourceCodeStart":2785,"sourceCodeEnd":2821,"githubUrl":"https://github.com/Comfy-Org/ComfyUI/blob/1c6d8d45b3693bfbb32385b410d813a7fd6be216/comfy_api_nodes/nodes_bytedance.py#L2785-L2821","documentation":"The combined duration of all reference videos (only those whose get_duration() succeeded; unreadable durations are silently skipped via the bare except) must not exceed limits[\"max_total_seconds\"] (30.1s for Seedance 2.5). The node sums probed durations client-side and rejects the batch before upload, quoting the measured total and the cap.","triggerScenarios":"Several reference videos whose durations sum above max_total_seconds (e.g. four 10-second clips = 40s > 30.1s) on the reference node.","commonSituations":"Multi-clip reference workflows after adding one more clip; referencing long shots without trimming; switching models where the total budget differs.","solutions":["Trim clips so the summed duration fits under the stated maximum.","Drop the least important reference video(s).","Replace long sections with a few representative seconds per clip."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"total = sum(v.get_duration() for v in reference_videos.values())\nassert total <= seedance2_reference_limits(model_id)[\"max_total_seconds\"]","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Budget the total reference duration (30.1s on Seedance 2.5) across all clips.","Use short representative excerpts rather than full shots."],"tags":["bytedance","seedance","video","validation","duration","api-nodes"],"backgroundTag":null,"analyzedSha":"1c6d8d45b3693bfbb32385b410d813a7fd6be216","analyzedAt":"2026-08-14T19:37:18.893Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}