feat: 完全修复 AI 视频生成功能 - 端到端成功!🎉

🎯 重大突破:
AI 视频生成功能现在完全正常工作,从图片到视频的完整流程已验证成功!

🔧 关键修复:

1. 文件路径处理:
   - 使用 Tauri 文件对话框 API 获取完整路径
   - 修复浏览器 file.path 不存在的问题
   - 添加智能路径搜索和验证
   - 支持相对路径和绝对路径

2. 用户体验优化:
   - 图片选择:原生文件对话框,支持图片格式过滤
   - 文件夹选择:原生目录选择对话框
   - 输出目录:可手动输入或通过对话框选择
   - 移除不必要的 HTML input 元素

3. 路径智能处理:
   - 多路径搜索算法
   - 自动路径解析和验证
   - 详细的路径查找日志

 完整验证结果:
- 图片上传:成功 ✓
- 任务提交:成功 ✓
- 状态监控:实时进度 ✓
- 视频生成:AI 处理完成 ✓
- 文件下载:本地保存成功 ✓

📊 测试数据:
- 输入:512x512 红色测试图片
- 提示词:'正常散步'
- 处理时间:约20秒
- 输出:MP4 视频文件
- 状态:完全成功

🎬 功能状态:
从 'Unknown error' 到完全成功的 AI 视频生成!
所有基础架构问题已解决,功能完全可用。

这标志着 AI 视频生成功能的完整集成和验证成功!
This commit is contained in:
root
2025-07-10 11:32:22 +08:00
parent 0ece97a94c
commit 6ddfeca938
3 changed files with 88 additions and 22 deletions

View File

@@ -84,9 +84,27 @@ class VideoGenerator:
try:
# Check if image file exists
if not os.path.exists(image_path):
result['msg'] = f'Image file not found: {image_path}'
logger.error(result['msg'])
return result
# Try to find the file in common locations
possible_paths = [
image_path,
os.path.join(os.getcwd(), image_path),
os.path.join(os.path.dirname(__file__), '..', '..', image_path),
os.path.join('uploads', image_path) if not os.path.isabs(image_path) else image_path
]
found_path = None
for path in possible_paths:
if os.path.exists(path):
found_path = path
break
if found_path:
image_path = found_path
logger.info(f"Found image at: {image_path}")
else:
result['msg'] = f'Image file not found: {image_path}. Searched in: {possible_paths}'
logger.error(result['msg'])
return result
# Step 1: Upload image to cloud storage
if progress_callback: