{"record":{"id":"4147b66cd20cae29","repo":"Comfy-Org/ComfyUI","slug":"total-reference-audio-duration-is-total-audio-dur","errorCode":null,"errorMessage":"Total reference audio duration is {total_audio_duration:.1f}s. Maximum is {limits['max_total_seconds']} seconds.","messagePattern":"Total reference audio duration is (.+?)s\\. Maximum is (.+?) seconds\\.","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"comfy_api_nodes/nodes_bytedance.py","lineNumber":2816,"sourceCode":"            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(\n            reference_assets,\n            reference_image_assets,\n            reference_video_assets,\n            reference_audio_assets,\n            len(reference_images),\n            len(reference_videos),\n            len(reference_audios),\n        )\n        prompt_text = _rewrite_asset_refs(model[\"prompt\"], asset_labels)\n\n        content: list[TaskTextContent | TaskImageContent | TaskVideoContent | TaskAudioContent] = [\n            TaskTextContent(text=prompt_text),\n        ]","sourceCodeStart":2798,"sourceCodeEnd":2834,"githubUrl":"https://github.com/Comfy-Org/ComfyUI/blob/1c6d8d45b3693bfbb32385b410d813a7fd6be216/comfy_api_nodes/nodes_bytedance.py#L2798-L2834","documentation":"The combined duration of all reference audios (sum of waveform-length/sample_rate across reference_audios inputs) must not exceed limits[\"max_total_seconds\"] (30.1s on Seedance 2.5). The node computes the total locally and rejects the batch before any network call, quoting the measured total and the cap.","triggerScenarios":"Connecting multiple voice clips whose summed durations exceed max_total_seconds on the Seedance 2.5 reference node.","commonSituations":"Adding 'just one more' voice sample past the budget; referencing full spoken sentences when only a phrase is needed.","solutions":["Trim audio references so their total stays under the stated maximum.","Keep one or two representative clips instead of many."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"total = sum(int(a[\"waveform\"].shape[-1]) / int(a[\"sample_rate\"]) for a in reference_audios.values())\nassert total <= seedance2_reference_limits(model_id)[\"max_total_seconds\"]","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Sum all clip durations against the 30.1s budget before running.","Fewer, shorter clips are better than many long ones."],"tags":["bytedance","seedance","audio","validation","duration","api-nodes"],"backgroundTag":null,"analyzedSha":"1c6d8d45b3693bfbb32385b410d813a7fd6be216","analyzedAt":"2026-08-14T19:37:18.893Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}