{"record":{"id":"df2c1db69f47494c","repo":"ATH-MaaS/Pixelle-Video","slug":"model","errorCode":null,"errorMessage":"未知的视频生成模型: {model}","messagePattern":"未知的视频生成模型: (.+?)","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"pixelle_video/services/api_services/video_client.py","lineNumber":229,"sourceCode":"                duration,\n                shot_type,\n                video_ratio,\n                last_image_path,\n                first_clip_path,\n                reference_image_path,\n                reference_image_paths,\n                reference_video_paths,\n                reference_audio_path,\n                audio_path,\n                negative_prompt,\n                resolution,\n                prompt_extend,\n                watermark if watermark is not None else False,\n                seed,\n                audio,\n            )\n        else:\n            raise ValueError(f\"未知的视频生成模型: {model}\")\n\n    def _generate_wan(\n        self,\n        prompt: str,\n        image_path: Optional[str],\n        save_path: str,\n        model: str,\n        duration: int,\n        shot_type: str,\n        video_ratio: str,\n        last_image_path: Optional[str],\n        first_clip_path: Optional[str],\n        reference_image_path: Optional[str],\n        reference_image_paths: Optional[list[str]],\n        reference_video_paths: Optional[list[str]],\n        reference_audio_path: Optional[str],\n        audio_path: Optional[str],\n        negative_prompt: Optional[str],","sourceCodeStart":211,"sourceCodeEnd":247,"githubUrl":"https://github.com/ATH-MaaS/Pixelle-Video/blob/848b054e4fae40dabc62ec58e960b573e83793ac/pixelle_video/services/api_services/video_client.py#L211-L247","documentation":"VideoClient.generate_video dispatches to model-specific backends (_generate_wan, _generate_kling, _generate_seedance). If the model string matches none of the known branches, it raises ValueError listing the unknown model. This is a client-side guard against unsupported model names, typically caused by typos or renamed model IDs.","triggerScenarios":"Calling generate_video(prompt, model='<name>', ...) with a model string that does not match any known model (e.g. 'wan2.0', 'kling-v2', 'seedance-pro' variants not in the dispatch table).","commonSituations":"Typo or wrong casing in the model name; copying a model ID from vendor docs that this wrapper hasn't mapped; using an old model name after a rename; dynamically chosen model from UI config not in the supported list.","solutions":["Check the exact supported model names in video_client.py's dispatch logic and use one verbatim","If the model was renamed, use the new canonical name or a normalize_model_name-supported alias","Update video_client.py to add a branch for the new model if it is genuinely supported by the backend","Print/inspect the model value being passed — often it comes from config with trailing whitespace or wrong case"],"exampleFix":"// before\nclient.generate_video(prompt, model='wan2-t2v')  # ValueError: 未知的视频生成模型\n// after\nclient.generate_video(prompt, model='wan2.2-t2v-plus')  # use a name the dispatcher knows","handlingStrategy":"validation","validationCode":"SUPPORTED_MODELS = {'wan2.2-t2v-plus', 'kling-v1', 'seedance-...' }  # verify against video_client.py\nif model not in SUPPORTED_MODELS:\n    raise ValueError(f'Unsupported model: {model!r}; supported: {sorted(SUPPORTED_MODELS)}')","typeGuard":"def is_known_model(model: object) -> bool:\n    return isinstance(model, str) and model in SUPPORTED_MODELS","tryCatchPattern":"try:\n    client.generate_video(prompt, model=model)\nexcept ValueError as e:\n    logging.error(f'{e} — check supported model names in video_client.py')\n    model = 'wan2.2-t2v-plus'  # safe default","preventionTips":["Keep model names in a single config constant list, not inline strings","Trim/normalize model strings (strip whitespace, lowercase) before dispatch","Add unit tests covering every model name offered by your UI/config","When vendors rename models, update the dispatcher and aliases together"],"tags":["configuration","invalid-argument","model-name"],"backgroundTag":"unsupported-model-name","analyzedSha":"848b054e4fae40dabc62ec58e960b573e83793ac","analyzedAt":"2026-08-30T03:24:41.468Z","schemaVersion":2},"datasetVersion":"2026-08-30T08:17:16.595Z"}