{"record":{"id":"06f11d673ece29a0","repo":"calesthio/OpenMontage","slug":"prompt-is-required-for-text-to-video","errorCode":null,"errorMessage":"prompt is required for text_to_video","messagePattern":"prompt is required for text_to_video","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"tools/video/seedance_ark.py","lineNumber":738,"sourceCode":"                \"aspect_ratio must be adaptive, 21:9, 16:9, 4:3, 1:1, 3:4, or 9:16\"\n            )\n\n        max_duration = 30 if variant == \"2.5\" else 15\n        duration = self._normalize_duration(inputs.get(\"duration\", 5), max_duration)\n        prompt = str(inputs.get(\"prompt\") or \"\").strip()\n        content: list[dict[str, Any]] = []\n        if prompt:\n            content.append({\"type\": \"text\", \"text\": prompt})\n\n        if inputs.get(\"reference_video_path\"):\n            raise ValueError(\n                \"reference_video_path is not supported by Ark; upload the \"\n                \"video to a public/signed HTTPS URL or Ark asset first\"\n            )\n\n        if operation == \"text_to_video\":\n            if not prompt:\n                raise ValueError(\"prompt is required for text_to_video\")\n            if self._has_any_media(inputs):\n                raise ValueError(\n                    \"text_to_video does not accept reference media; use \"\n                    \"image_to_video or reference_to_video\"\n                )\n        elif operation == \"image_to_video\":\n            first_refs = self._single_image_refs(inputs)\n            if len(first_refs) != 1:\n                raise ValueError(\"image_to_video requires exactly one reference image\")\n            content.append(self._image_content(first_refs[0], role=\"first_frame\"))\n            end_refs = [\n                value\n                for value in (\n                    inputs.get(\"end_image_url\"),\n                    inputs.get(\"end_image_path\"),\n                )\n                if value\n            ]","sourceCodeStart":720,"sourceCodeEnd":756,"githubUrl":"https://github.com/calesthio/OpenMontage/blob/95e1c3d0ab93482159818560f6a8c8e866b9139f/tools/video/seedance_ark.py#L720-L756","documentation":"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.","triggerScenarios":"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).","commonSituations":"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.","solutions":["Supply a non-empty `prompt` for text_to_video","If you meant to animate an image, set `operation: 'image_to_video'` with exactly one reference image","If you meant multi-reference, set `operation: 'reference_to_video'`"],"exampleFix":"# before\ninputs = {\"operation\": \"text_to_video\", \"image_url\": \"https://...png\"}\n# after\ninputs = {\"operation\": \"image_to_video\", \"image_url\": \"https://...png\", \"prompt\": \"slow zoom in, cinematic\"}","handlingStrategy":"validation","validationCode":"operation = str(inputs.get(\"operation\", \"text_to_video\"))\nprompt = str(inputs.get(\"prompt\") or \"\").strip()\nif operation == \"text_to_video\" and not prompt:\n    if has_reference_media(inputs):\n        raise ValueError(\"image supplied but no prompt: did you mean image_to_video?\")\n    raise ValueError(\"text_to_video requires a prompt\")","typeGuard":"def ready_for_text_to_video(inputs: dict) -> bool:\n    return bool(str(inputs.get(\"prompt\") or \"\").strip()) and not has_any_media(inputs)","tryCatchPattern":"try:\n    result = ark.execute(inputs)\nexcept ValueError as e:\n    if \"prompt is required\" in str(e) and inputs.get(\"image_url\"):\n        inputs[\"operation\"] = \"image_to_video\"\n        inputs[\"prompt\"] = DEFAULT_MOTION_PROMPT\n        result = ark.execute(inputs)\n    else:\n        raise","preventionTips":["operation defaults to text_to_video — always set it explicitly when supplying media","Validate prompt presence in the input builder next to where the prompt string is produced"],"tags":["seedance","ark","input-validation","prompt","video-generation"],"backgroundTag":null,"analyzedSha":"95e1c3d0ab93482159818560f6a8c8e866b9139f","analyzedAt":"2026-08-15T06:31:20.014Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}