calesthio/OpenMontage · error · ValueError

prompt is required for text_to_video

Error message

prompt is required for text_to_video

What it means

Operation-specific gate in `_build_payload`: when `operation` is 'text_to_video', a non-empty stripped `prompt` is mandatory — and the next check additionally rejects any reference media. Pure text-to-video has nothing else to condition on, so an empty prompt means the request has no content at all. This mirrors Ark's own requirement but fails locally, before the paid POST.

Source

Thrown at tools/video/seedance_ark.py:738

                "aspect_ratio must be adaptive, 21:9, 16:9, 4:3, 1:1, 3:4, or 9:16"
            )

        max_duration = 30 if variant == "2.5" else 15
        duration = self._normalize_duration(inputs.get("duration", 5), max_duration)
        prompt = str(inputs.get("prompt") or "").strip()
        content: list[dict[str, Any]] = []
        if prompt:
            content.append({"type": "text", "text": prompt})

        if inputs.get("reference_video_path"):
            raise ValueError(
                "reference_video_path is not supported by Ark; upload the "
                "video to a public/signed HTTPS URL or Ark asset first"
            )

        if operation == "text_to_video":
            if not prompt:
                raise ValueError("prompt is required for text_to_video")
            if self._has_any_media(inputs):
                raise ValueError(
                    "text_to_video does not accept reference media; use "
                    "image_to_video or reference_to_video"
                )
        elif operation == "image_to_video":
            first_refs = self._single_image_refs(inputs)
            if len(first_refs) != 1:
                raise ValueError("image_to_video requires exactly one reference image")
            content.append(self._image_content(first_refs[0], role="first_frame"))
            end_refs = [
                value
                for value in (
                    inputs.get("end_image_url"),
                    inputs.get("end_image_path"),
                )
                if value
            ]

View on GitHub (pinned to 95e1c3d0ab)

Solutions

  1. Supply a non-empty `prompt` for text_to_video
  2. If you meant to animate an image, set `operation: 'image_to_video'` with exactly one reference image
  3. If you meant multi-reference, set `operation: 'reference_to_video'`

Example fix

# before
inputs = {"operation": "text_to_video", "image_url": "https://...png"}
# after
inputs = {"operation": "image_to_video", "image_url": "https://...png", "prompt": "slow zoom in, cinematic"}
Defensive patterns

Strategy: validation

Validate before calling

operation = str(inputs.get("operation", "text_to_video"))
prompt = str(inputs.get("prompt") or "").strip()
if operation == "text_to_video" and not prompt:
    if has_reference_media(inputs):
        raise ValueError("image supplied but no prompt: did you mean image_to_video?")
    raise ValueError("text_to_video requires a prompt")

Type guard

def ready_for_text_to_video(inputs: dict) -> bool:
    return bool(str(inputs.get("prompt") or "").strip()) and not has_any_media(inputs)

Try / catch

try:
    result = ark.execute(inputs)
except ValueError as e:
    if "prompt is required" in str(e) and inputs.get("image_url"):
        inputs["operation"] = "image_to_video"
        inputs["prompt"] = DEFAULT_MOTION_PROMPT
        result = ark.execute(inputs)
    else:
        raise

Prevention

When it happens

Trigger: Calling with `operation: 'text_to_video'` and prompt omitted/whitespace; passing the prompt under a wrong key so it reads empty; intending image-conditioned generation but leaving operation at its default while supplying only images (that case hits the sibling 'does not accept reference media' error first if a prompt exists, or this one if not).

Common situations: Default-argument traps: operation defaults to text_to_video, so a call with only an image and no prompt lands here; prompt templating producing an empty string; users copying input dicts from other tools and dropping the prompt field.

Related errors


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