Comfy-Org/ComfyUI · error · ValueError

Total reference audio duration is {total_audio_duration:.1f}

Error message

Total reference audio duration is {total_audio_duration:.1f}s. Maximum is {limits['max_total_seconds']} seconds.

What it means

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.

Source

Thrown at comfy_api_nodes/nodes_bytedance.py:2816

            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(
            reference_assets,
            reference_image_assets,
            reference_video_assets,
            reference_audio_assets,
            len(reference_images),
            len(reference_videos),
            len(reference_audios),
        )
        prompt_text = _rewrite_asset_refs(model["prompt"], asset_labels)

        content: list[TaskTextContent | TaskImageContent | TaskVideoContent | TaskAudioContent] = [
            TaskTextContent(text=prompt_text),
        ]

View on GitHub (pinned to 1c6d8d45b3)

Solutions

  1. Trim audio references so their total stays under the stated maximum.
  2. Keep one or two representative clips instead of many.
Defensive patterns

Strategy: validation

Validate before calling

total = sum(int(a["waveform"].shape[-1]) / int(a["sample_rate"]) for a in reference_audios.values())
assert total <= seedance2_reference_limits(model_id)["max_total_seconds"]

Prevention

When it happens

Trigger: Connecting multiple voice clips whose summed durations exceed max_total_seconds on the Seedance 2.5 reference node.

Common situations: Adding 'just one more' voice sample past the budget; referencing full spoken sentences when only a phrase is needed.

Related errors


AI-assisted analysis of Comfy-Org/ComfyUI@1c6d8d45b3 (2026-08-14). Data as JSON: /api/errors/4147b66cd20cae29. Report an issue: GitHub.