{"record":{"id":"8cfe6a6f5b59bd20","repo":"ATH-MaaS/Pixelle-Video","slug":"dashscope-video-edit-models-require-video-input-an","errorCode":null,"errorMessage":"DashScope video edit models require video input and may use reference_image input.","messagePattern":"DashScope video edit models require video input and may use reference_image input\\.","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"pixelle_video/services/api_services/video_dashscope.py","lineNumber":267,"sourceCode":"                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        elif self._is_video_edit_model(model):\n            media = self._build_video_edit_media(\n                video_path=first_clip_path,\n                reference_image_path=reference_image_path or last_image_path or image_path,\n            )\n            if not media:\n                raise ValueError(\"DashScope video edit models require video input and may use reference_image input.\")\n\n            call_kwargs = {\n                \"api_key\": self.api_key,\n                \"model\": model,\n                \"prompt\": prompt,\n                \"media\": media,\n                \"duration\": duration,\n                \"watermark\": watermark,\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 seed is not None:","sourceCodeStart":249,"sourceCodeEnd":285,"githubUrl":"https://github.com/ATH-MaaS/Pixelle-Video/blob/848b054e4fae40dabc62ec58e960b573e83793ac/pixelle_video/services/api_services/video_dashscope.py#L249-L285","documentation":"For video-edit DashScope models, _build_video_edit_media needs a source video (first_clip_path) and optionally a reference image. If it returns no media, this ValueError is raised. The edit model cannot operate without a video to edit.","triggerScenarios":"_is_video_edit_model(model) is true but first_clip_path is None/empty (no video input supplied), so media ends up empty.","commonSituations":"Using an edit model but passing frames as image_path only; first_clip_path variable unset because the prior clip-generation step was skipped or failed; wrong model name routing a normal generation into the edit branch.","solutions":["Provide a valid video via first_clip_path.","Add a reference image via reference_image_path/image_path/last_image_path only as a complement — the video input is mandatory.","Confirm the model name; if you meant first/last-frame image-to-video, pick the matching model class.","Ensure the clip-producing step ran and set first_clip_path before this call."],"exampleFix":"// before\nclient.generate_video(model=\"wan-video-edit\", prompt=p, image_path=\"f.jpg\")\n// after\nclient.generate_video(model=\"wan-video-edit\", prompt=p,\n                      first_clip_path=\"clips/in.mp4\",\n                      reference_image_path=\"f.jpg\")","handlingStrategy":"validation","validationCode":"if model_requires_edit(model) and not first_clip_path:\n    raise ValueError(\"video edit model requires first_clip_path\")","typeGuard":"def video_edit_inputs_ok(model: str, first_clip_path: str | None) -> bool:\n    return not model_requires_edit(model) or bool(first_clip_path)","tryCatchPattern":"try:\n    client.generate_video(model=model, prompt=p, first_clip_path=clip)\nexcept ValueError as e:\n    logger.error(\"video edit input missing: %s\", e)\n    raise","preventionTips":["Keep a table of model families and their required inputs.","Ensure the clip-generation stage always runs before the edit stage.","Verify model names to avoid accidental routing into the edit branch.","Check first_clip_path is set and the file exists before invoking."],"tags":["missing-argument","input-validation","dashscope","video-edit"],"backgroundTag":"missing-required-parameter","analyzedSha":"848b054e4fae40dabc62ec58e960b573e83793ac","analyzedAt":"2026-08-30T03:24:41.468Z","schemaVersion":2},"datasetVersion":"2026-08-30T08:17:16.595Z"}