Comfy-Org/ComfyUI · error · ValueError
Total reference video duration is {total_video_duration:.1f}
Error message
Total reference video duration is {total_video_duration:.1f}s. Maximum is {limits['max_total_seconds']} seconds. What it means
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.
Source
Thrown at comfy_api_nodes/nodes_bytedance.py:2803
if min_px:
for key in reference_videos:
reference_videos[key] = upscale_video_to_min_pixels(reference_videos[key], min_px)
total_video_duration = 0.0
for i, key in enumerate(reference_videos, 1):
video = reference_videos[key]
_validate_ref_video_pixels(video, model_id, model["resolution"], i)
try:
dur = video.get_duration()
if dur < 1.8:
raise ValueError(f"Reference video {i} is too short: {dur:.1f}s. Minimum duration is 1.8 seconds.")
total_video_duration += dur
except ValueError:
raise
except Exception:
pass
if total_video_duration > limits["max_total_seconds"]:
raise ValueError(
f"Total reference video duration is {total_video_duration:.1f}s. "
f"Maximum is {limits['max_total_seconds']} seconds."
)
total_audio_duration = 0.0
for i, key in enumerate(reference_audios, 1):
audio = reference_audios[key]
dur = int(audio["waveform"].shape[-1]) / int(audio["sample_rate"])
if dur < 1.8:
raise ValueError(f"Reference audio {i} is too short: {dur:.1f}s. Minimum duration is 1.8 seconds.")
total_audio_duration += dur
if total_audio_duration > limits["max_total_seconds"]:
raise ValueError(
f"Total reference audio duration is {total_audio_duration:.1f}s. "
f"Maximum is {limits['max_total_seconds']} seconds."
)
asset_labels = _build_asset_labels(View on GitHub (pinned to 1c6d8d45b3)
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.
Defensive patterns
Strategy: validation
Validate before calling
total = sum(v.get_duration() for v in reference_videos.values()) assert total <= seedance2_reference_limits(model_id)["max_total_seconds"]
Prevention
- Budget the total reference duration (30.1s on Seedance 2.5) across all clips.
- Use short representative excerpts rather than full shots.
When it happens
Trigger: Several reference videos whose durations sum above max_total_seconds (e.g. four 10-second clips = 40s > 30.1s) on the reference node.
Common situations: Multi-clip reference workflows after adding one more clip; referencing long shots without trimming; switching models where the total budget differs.
Related errors
- Reference video {i} is too short: {dur:.1f}s. Minimum durati
- Reference audio {i} is too short: {dur:.1f}s. Minimum durati
- Total reference audio duration is {total_audio_duration:.1f}
- Reference video {index} is too small: {w}x{h} = {pixels:,} t
- Reference video {index} is too large: {w}x{h} = {pixels:,} t
AI-assisted analysis of Comfy-Org/ComfyUI@1c6d8d45b3 (2026-08-14).
Data as JSON: /api/errors/956946596b0e27d1.
Report an issue: GitHub.