calesthio/OpenMontage · error · ValueError

reference audio requires at least one reference image or vid

Error message

reference audio requires at least one reference image or video

What it means

Raised when audio references are supplied but no image or video references exist. Ark's reference audio is a conditioning signal bound to visual references, so audio-only reference_to_video requests are rejected client-side.

Source

Thrown at tools/video/seedance_ark.py:857

                        f"{max_reference_seconds} seconds"
                    )
            local_audio_durations = [
                duration
                for ref in audio_refs
                if (
                    duration := self._local_or_data_audio_duration(
                        str(ref), max_seconds=max_reference_seconds
                    )
                )
                is not None
            ]
            if sum(local_audio_durations) > max_reference_seconds:
                raise ValueError(
                    "all local reference audio clips together must be at "
                    f"most {max_reference_seconds} seconds"
                )
            if audio_refs and not (image_refs or video_refs):
                raise ValueError(
                    "reference audio requires at least one reference image or video"
                )
            if not (image_refs or video_refs):
                raise ValueError(
                    "reference_to_video requires at least one image or video"
                )

            content.extend(
                self._image_content(ref, role="reference_image") for ref in image_refs
            )
            content.extend(
                {
                    "type": "video_url",
                    "video_url": {"url": str(ref)},
                    "role": "reference_video",
                }
                for ref in video_refs
            )

View on GitHub (pinned to 95e1c3d0ab)

Solutions

  1. Add at least one reference image or video to the same request
  2. Remove the audio refs if no visual conditioning is intended
  3. Use text_to_video with generate_audio if you only want audio in the output

Example fix

# before
inputs = {"operation": "reference_to_video", "prompt": p,
          "reference_audio_urls": [a]}

# after
inputs = {"operation": "reference_to_video", "prompt": p,
          "reference_image_url": img, "reference_audio_urls": [a]}
Defensive patterns

Strategy: validation

Validate before calling

has_audio = bool(collected_audio_refs(inputs))
has_visual = bool(image_ref_list(inputs)) or bool(video_ref_list(inputs))
if has_audio and not has_visual:
    inputs = {k: v for k, v in inputs.items() if not k.startswith("reference_audio")}

Type guard

def audio_has_visual_partner(inputs: dict) -> bool:
    return not collected_audio_refs(inputs) or bool(image_ref_list(inputs) or video_ref_list(inputs))

Prevention

When it happens

Trigger: operation='reference_to_video' with populated reference_audio_* keys and empty image and video ref collections.

Common situations: Trying to do audio-driven generation without visuals; cleanup code that drops image refs but leaves audio refs; splitting a multimodal payload across calls.

Related errors


AI-assisted analysis of calesthio/OpenMontage@95e1c3d0ab (2026-08-15). Data as JSON: /api/errors/3f3cade921acace2. Report an issue: GitHub.