{"record":{"id":"dc081752774a5a09","repo":"ATH-MaaS/Pixelle-Video","slug":"dashscope-reference-to-video-models-require-at-lea","errorCode":null,"errorMessage":"DashScope reference-to-video models require at least one reference_image or reference_video input.","messagePattern":"DashScope reference-to-video models require at least one reference_image or reference_video input\\.","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"pixelle_video/services/api_services/video_dashscope.py","lineNumber":234,"sourceCode":"            if seed is not None:\n                call_kwargs[\"seed\"] = seed\n            if audio is not None:\n                call_kwargs[\"audio\"] = audio\n\n            rsp = self._with_network_retry(\n                \"submit task\",\n                lambda: VideoSynthesis.call(**call_kwargs),\n            )\n        elif self._is_reference_to_video_model(model):\n            media = self._build_reference_to_video_media(\n                image_path=image_path,\n                reference_image_path=reference_image_path,\n                reference_image_paths=reference_image_paths,\n                reference_video_paths=reference_video_paths,\n                reference_audio_path=None if \"happyhorse\" in model.lower() else reference_audio_path,\n            )\n            if not media:\n                raise ValueError(\"DashScope reference-to-video models require at least one reference_image or reference_video 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 audio is not None:\n                call_kwargs[\"audio\"] = audio\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:","sourceCodeStart":216,"sourceCodeEnd":252,"githubUrl":"https://github.com/ATH-MaaS/Pixelle-Video/blob/848b054e4fae40dabc62ec58e960b573e83793ac/pixelle_video/services/api_services/video_dashscope.py#L216-L252","documentation":"For reference-to-video DashScope models, _build_reference_to_video_media assembles media inputs from reference images/videos. If it returns an empty/None media list, the client refuses to submit an empty request and raises this ValueError. The API would reject such a call anyway, so the client fails fast.","triggerScenarios":"A model classified by _is_reference_to_video_model is used, but reference_image_path, reference_image_paths, and reference_video_paths all resolve to no usable media (None, empty lists, or only falsy entries).","commonSituations":"Calling a reference-driven model with only a text prompt (forgot image/video); variable holding the reference path is None because an earlier step failed; passing empty list reference_image_paths=[]; code path refactor dropped the reference argument.","solutions":["Pass at least one existing reference_image_path or a non-empty reference_video_paths list.","Verify the model name actually requires references; if you want pure text-to-video, switch to a text-to-video model.","Log/inspect the reference arguments right before the call to confirm they are populated.","Fix upstream code that was supposed to supply the reference asset."],"exampleFix":"// before\nclient.generate_video(model=\"wan2.6-ref-to-video\", prompt=p)  # no refs\n// after\nclient.generate_video(model=\"wan2.6-ref-to-video\", prompt=p,\n                      reference_image_path=\"assets/ref.jpg\")","handlingStrategy":"validation","validationCode":"if not (reference_image_path or reference_image_paths or reference_video_paths):\n    raise ValueError(\"reference-to-video model needs at least one reference image/video\")","typeGuard":"def has_reference_media(image, images, videos) -> bool:\n    return bool(image or [i for i in (images or []) if i] or [v for v in (videos or []) if v])","tryCatchPattern":"try:\n    client.generate_video(model=model, prompt=p, reference_image_paths=refs)\nexcept ValueError as e:\n    logger.error(\"invalid input combo: %s\", e)\n    raise","preventionTips":["Match the model family to available inputs: references for ref-to-video, none for text-to-video.","Guard upstream steps that produce reference assets; default to failing loudly if they yield nothing.","Log the resolved reference arguments before calling generate_video.","Centralize model->required-inputs mapping in one config to avoid drift."],"tags":["missing-argument","input-validation","dashscope"],"backgroundTag":"missing-required-parameter","analyzedSha":"848b054e4fae40dabc62ec58e960b573e83793ac","analyzedAt":"2026-08-30T03:24:41.468Z","schemaVersion":2},"datasetVersion":"2026-08-30T08:17:16.595Z"}