{"record":{"id":"b41c9b52db718546","repo":"ATH-MaaS/Pixelle-Video","slug":"last-image-path","errorCode":null,"errorMessage":"尾帧图片不存在: {last_image_path}","messagePattern":"尾帧图片不存在: (.+?)","errorType":"validation","errorClass":"FileNotFoundError","httpStatus":null,"severity":"error","filePath":"pixelle_video/services/api_services/video_dashscope.py","lineNumber":182,"sourceCode":"            reference_image_paths: 可选参考图片列表（r2v）\n            reference_video_paths: 可选参考视频列表（r2v）\n            reference_audio_path: 可选参考音频/音色路径（r2v）\n            audio_path: 可选驱动音频本地路径（wan2.7）\n\n        Returns:\n            video_url: 远端视频 URL\n\n        Raises:\n            FileNotFoundError: 输入图片不存在\n            RuntimeError: API 调用或下载失败\n        \"\"\"\n        if VideoSynthesis is None:\n            raise RuntimeError(\"dashscope package not installed. Run: pip install dashscope\")\n\n        if image_path and not os.path.exists(image_path):\n            raise FileNotFoundError(f\"输入图片不存在: {image_path}\")\n        if last_image_path and not os.path.exists(last_image_path):\n            raise FileNotFoundError(f\"尾帧图片不存在: {last_image_path}\")\n        if first_clip_path and not os.path.exists(first_clip_path):\n            raise FileNotFoundError(f\"输入视频片段不存在: {first_clip_path}\")\n        if reference_image_path and not os.path.exists(reference_image_path):\n            raise FileNotFoundError(f\"参考图片不存在: {reference_image_path}\")\n        for ref_image_path in reference_image_paths or []:\n            if ref_image_path and not os.path.exists(ref_image_path):\n                raise FileNotFoundError(f\"参考图片不存在: {ref_image_path}\")\n        for ref_video_path in reference_video_paths or []:\n            if ref_video_path and not os.path.exists(ref_video_path):\n                raise FileNotFoundError(f\"参考视频不存在: {ref_video_path}\")\n        if reference_audio_path and not os.path.exists(reference_audio_path):\n            raise FileNotFoundError(f\"参考音频不存在: {reference_audio_path}\")\n        if audio_path and not os.path.exists(audio_path):\n            raise FileNotFoundError(f\"驱动音频不存在: {audio_path}\")\n\n        logger.info(f\"DashscopeVideoClient: model={model}, prompt={prompt[:60]}...\")\n\n        if self._is_text_to_video_model(model):","sourceCodeStart":164,"sourceCodeEnd":200,"githubUrl":"https://github.com/ATH-MaaS/Pixelle-Video/blob/848b054e4fae40dabc62ec58e960b573e83793ac/pixelle_video/services/api_services/video_dashscope.py#L164-L200","documentation":"generate_video validates the optional last_image_path (used for first/last-frame video generation) and raises FileNotFoundError if the file does not exist. Raised only when a last frame was supplied but is missing on disk.","triggerScenarios":"generate_video(..., last_image_path='end.png', ...) with a non-existent end-frame file; stale path after a temp directory cleanup.","commonSituations":"First/last-frame workflows where the end image was deleted or written with a different name; temp files cleaned between steps; typo in filename; cross-OS path separators in shared config.","solutions":["Verify the file exists with os.path.exists(last_image_path) before the call and fix the path","Regenerate the last-frame image if it was produced by an earlier step","Use pathlib to build paths consistently across platforms","Pass None if you do not actually intend last-frame mode"],"exampleFix":"// before\nclient.generate_video(prompt, image_path='a.png', last_image_path='end.png')  # FileNotFoundError\n// after\nif not os.path.exists('end.png'):\n    generate_end_frame('end.png')  # create it first\nclient.generate_video(prompt, image_path='a.png', last_image_path='end.png')","handlingStrategy":"validation","validationCode":"import os\nif last_image_path and not os.path.isfile(last_image_path):\n    raise FileNotFoundError(f'尾帧图片不存在: {last_image_path}')","typeGuard":"def is_existing_file(path) -> bool:\n    return isinstance(path, str) and os.path.isfile(path)","tryCatchPattern":"try:\n    video = client.generate_video(prompt, image_path='a.png', last_image_path='end.png')\nexcept FileNotFoundError as e:\n    logging.error(f'Last-frame image missing: {e}')\n    video = None","preventionTips":["Generate/confirm the last-frame file before first/last-frame calls","Avoid temp-dir paths that get cleaned between pipeline steps","Build filenames with pathlib to prevent separator/casing mistakes","Pass None explicitly when last-frame mode is not intended"],"tags":["file-not-found","input-validation","path"],"backgroundTag":"file-not-found","analyzedSha":"848b054e4fae40dabc62ec58e960b573e83793ac","analyzedAt":"2026-08-30T03:24:41.468Z","schemaVersion":2},"datasetVersion":"2026-08-30T08:17:16.595Z"}