{"record":{"id":"fe23729a6ef69ab2","repo":"ATH-MaaS/Pixelle-Video","slug":"dashscope-legacy-video-models-require-image-path","errorCode":null,"errorMessage":"DashScope legacy video models require image_path.","messagePattern":"DashScope legacy video models require image_path\\.","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"pixelle_video/services/api_services/video_dashscope.py","lineNumber":330,"sourceCode":"            if negative_prompt:\n                call_kwargs[\"negative_prompt\"] = negative_prompt\n            if resolution:\n                call_kwargs[\"resolution\"] = resolution\n            if video_ratio:\n                call_kwargs[\"ratio\"] = video_ratio\n            if prompt_extend is not None:\n                call_kwargs[\"prompt_extend\"] = prompt_extend\n            if seed is not None:\n                call_kwargs[\"seed\"] = seed\n\n            rsp = self._with_network_retry(\n                \"submit task\",\n                lambda: VideoSynthesis.call(**call_kwargs),\n            )\n        else:\n            # Older models (wan2.1, wan2.6 etc.) use 'img_url' and 'shot_type'\n            if not image_path:\n                raise ValueError(\"DashScope legacy video models require image_path.\")\n\n            call_kwargs = {\n                \"api_key\": self.api_key,\n                \"model\": model,\n                \"prompt\": prompt,\n                \"img_url\": self._to_media_url(image_path),\n                \"duration\": duration,\n                \"shot_type\": shot_type,\n            }\n            if negative_prompt:\n                call_kwargs[\"negative_prompt\"] = negative_prompt\n            if resolution:\n                call_kwargs[\"resolution\"] = resolution\n            if video_ratio:\n                call_kwargs[\"ratio\"] = video_ratio\n            if prompt_extend is not None:\n                call_kwargs[\"prompt_extend\"] = prompt_extend\n            if watermark is not None:","sourceCodeStart":312,"sourceCodeEnd":348,"githubUrl":"https://github.com/ATH-MaaS/Pixelle-Video/blob/848b054e4fae40dabc62ec58e960b573e83793ac/pixelle_video/services/api_services/video_dashscope.py#L312-L348","documentation":"Older DashScope video models (wan2.1, wan2.6, etc.) submit via img_url and require an input image. If image_path is falsy when the legacy branch is taken, this ValueError is raised instead of sending a request that would fail server-side.","triggerScenarios":"A legacy model name is passed to generate_video() without image_path (None or empty string), reaching the 'else' legacy branch that needs image_path for img_url.","commonSituations":"Switching from a newer model to wan2.1/wan2.6 while keeping only text or video inputs; image_path cleared after a failed upstream download; model name typo routing into the legacy branch unintentionally.","solutions":["Supply an existing image_path when using legacy wan2.x models.","If you intended text-to-video, use a model where _is_text_to_video_model returns true instead.","Verify the model string for typos causing wrong branch selection.","Confirm the image-producing upstream step ran before calling generate_video."],"exampleFix":"// before\nclient.generate_video(model=\"wan2.1-i2v\", prompt=p)\n// after\nclient.generate_video(model=\"wan2.1-i2v\", prompt=p, image_path=\"input.jpg\")","handlingStrategy":"validation","validationCode":"if is_legacy_video_model(model) and not image_path:\n    raise ValueError(f\"{model} requires image_path\")","typeGuard":"def legacy_inputs_ok(model: str, image_path: str | None) -> bool:\n    return not is_legacy_video_model(model) or bool(image_path)","tryCatchPattern":"try:\n    client.generate_video(model=\"wan2.1-i2v\", prompt=p, image_path=img)\nexcept ValueError as e:\n    logger.error(\"legacy model input missing: %s\", e)\n    raise","preventionTips":["Provide image_path for all wan2.1/wan2.6 i2v calls.","Use text-to-video models when no image is available.","Validate model names against the supported list to avoid branch mistakes.","Confirm the image exists on disk before the call."],"tags":["missing-argument","input-validation","dashscope","legacy-models"],"backgroundTag":"missing-required-parameter","analyzedSha":"848b054e4fae40dabc62ec58e960b573e83793ac","analyzedAt":"2026-08-30T03:24:41.468Z","schemaVersion":2},"datasetVersion":"2026-08-30T08:17:16.595Z"}