ATH-MaaS/Pixelle-Video · error · FileNotFoundError
输入图片不存在: {image_path}
Error message
输入图片不存在: {image_path} What it means
generate_video validates all input file paths up front and raises FileNotFoundError if the primary input image does not exist. This fail-fast check avoids sending a bad request to the API. Only raised when image_path was provided and os.path.exists returns False.
Source
Thrown at pixelle_video/services/api_services/video_dashscope.py:180
first_clip_path: 可选首段视频本地路径(wan2.7 视频续写)
reference_image_path: 可选参考图片路径(videoedit)
reference_image_paths: 可选参考图片列表(r2v)
reference_video_paths: 可选参考视频列表(r2v)
reference_audio_path: 可选参考音频/音色路径(r2v)
audio_path: 可选驱动音频本地路径(wan2.7)
Returns:
video_url: 远端视频 URL
Raises:
FileNotFoundError: 输入图片不存在
RuntimeError: API 调用或下载失败
"""
if VideoSynthesis is None:
raise RuntimeError("dashscope package not installed. Run: pip install dashscope")
if image_path and not os.path.exists(image_path):
raise FileNotFoundError(f"输入图片不存在: {image_path}")
if last_image_path and not os.path.exists(last_image_path):
raise FileNotFoundError(f"尾帧图片不存在: {last_image_path}")
if first_clip_path and not os.path.exists(first_clip_path):
raise FileNotFoundError(f"输入视频片段不存在: {first_clip_path}")
if reference_image_path and not os.path.exists(reference_image_path):
raise FileNotFoundError(f"参考图片不存在: {reference_image_path}")
for ref_image_path in reference_image_paths or []:
if ref_image_path and not os.path.exists(ref_image_path):
raise FileNotFoundError(f"参考图片不存在: {ref_image_path}")
for ref_video_path in reference_video_paths or []:
if ref_video_path and not os.path.exists(ref_video_path):
raise FileNotFoundError(f"参考视频不存在: {ref_video_path}")
if reference_audio_path and not os.path.exists(reference_audio_path):
raise FileNotFoundError(f"参考音频不存在: {reference_audio_path}")
if audio_path and not os.path.exists(audio_path):
raise FileNotFoundError(f"驱动音频不存在: {audio_path}")
logger.info(f"DashscopeVideoClient: model={model}, prompt={prompt[:60]}...")View on GitHub (pinned to 848b054e4f)
Solutions
- os.path.exists(image_path) check before calling and correct/resolve the path
- Convert to absolute path (os.path.abspath / pathlib.Path.resolve) to avoid cwd mismatch
- Ensure the upstream step that produces the image completed successfully
- In containers, verify the directory is volume-mounted and readable
Example fix
// before
client.generate_video(prompt, image_path='outputs/img.png') # FileNotFoundError
// after
from pathlib import Path
img = Path('outputs/img.png').resolve()
assert img.exists(), f"missing {img}"
client.generate_video(prompt, image_path=str(img)) Defensive patterns
Strategy: validation
Validate before calling
import os
if image_path and not os.path.exists(image_path):
raise FileNotFoundError(f'输入图片不存在: {image_path}') Type guard
def is_existing_file(path) -> bool:
return isinstance(path, str) and os.path.isfile(path) Try / catch
try:
video = client.generate_video(prompt, image_path=image_path)
except FileNotFoundError as e:
logging.error(f'Input image missing: {e}')
video = None # or regenerate the image first Prevention
- Use absolute paths (pathlib.Path.resolve) to avoid cwd surprises
- Verify upstream image-generation steps succeeded before video generation
- Mount required volumes in containers and check permissions
- Add pre-flight file existence assertions in pipelines
When it happens
Trigger: generate_video(image_path='/path/img.png', ...) where that file does not exist — deleted file, wrong relative path, or path built from user input.
Common situations: Relative vs absolute path confusion (working directory differs in production); file generated by a previous pipeline step that failed silently; image uploaded later than the video call; container not mounting the volume containing the image.
Understand the failure class
Background: "File not found" and ENOENT errors: why libraries can't find a file that should exist — this error's family across 50 libraries.
Related errors
- 尾帧图片不存在: {last_image_path}
- 输入视频片段不存在: {first_clip_path}
- 参考图片不存在: {reference_image_path}
- 参考图片不存在: {ref_image_path}
- 输入图片不存在: {image_path}
AI-assisted analysis of ATH-MaaS/Pixelle-Video@848b054e4f (2026-08-30).
Data as JSON: /api/errors/c419bb750f37125d.
Report an issue: GitHub.