支持生成耗时统计
This commit is contained in:
@@ -1072,6 +1072,10 @@ def main():
|
|||||||
progress_bar = st.progress(0)
|
progress_bar = st.progress(0)
|
||||||
status_text = st.empty()
|
status_text = st.empty()
|
||||||
|
|
||||||
|
# Record start time for generation
|
||||||
|
import time
|
||||||
|
start_time = time.time()
|
||||||
|
|
||||||
try:
|
try:
|
||||||
# Progress callback to update UI
|
# Progress callback to update UI
|
||||||
def update_progress(event: ProgressEvent):
|
def update_progress(event: ProgressEvent):
|
||||||
@@ -1137,6 +1141,9 @@ def main():
|
|||||||
|
|
||||||
result = run_async(pixelle_video.generate_video(**video_params))
|
result = run_async(pixelle_video.generate_video(**video_params))
|
||||||
|
|
||||||
|
# Calculate total generation time
|
||||||
|
total_generation_time = time.time() - start_time
|
||||||
|
|
||||||
progress_bar.progress(100)
|
progress_bar.progress(100)
|
||||||
status_text.text(tr("status.success"))
|
status_text.text(tr("status.success"))
|
||||||
|
|
||||||
@@ -1154,7 +1161,7 @@ def main():
|
|||||||
video_width, video_height = parse_template_size(template_path)
|
video_width, video_height = parse_template_size(template_path)
|
||||||
|
|
||||||
info_text = (
|
info_text = (
|
||||||
f"⏱️ {result.duration:.1f}s "
|
f"⏱️ {tr('info.generation_time')} {total_generation_time:.1f}s "
|
||||||
f"📦 {file_size_mb:.2f}MB "
|
f"📦 {file_size_mb:.2f}MB "
|
||||||
f"🎬 {len(result.storyboard.frames)}{tr('info.scenes_unit')} "
|
f"🎬 {len(result.storyboard.frames)}{tr('info.scenes_unit')} "
|
||||||
f"📐 {video_width}x{video_height}"
|
f"📐 {video_width}x{video_height}"
|
||||||
|
|||||||
@@ -160,6 +160,7 @@
|
|||||||
"info.resolution": "Resolution",
|
"info.resolution": "Resolution",
|
||||||
"info.video_information": "📊 Video Information",
|
"info.video_information": "📊 Video Information",
|
||||||
"info.no_video_yet": "Video preview will appear here after generation",
|
"info.no_video_yet": "Video preview will appear here after generation",
|
||||||
|
"info.generation_time": "Generation Time",
|
||||||
|
|
||||||
"settings.title": "⚙️ System Configuration (Required)",
|
"settings.title": "⚙️ System Configuration (Required)",
|
||||||
"settings.not_configured": "⚠️ Please complete system configuration before generating videos",
|
"settings.not_configured": "⚠️ Please complete system configuration before generating videos",
|
||||||
|
|||||||
@@ -160,6 +160,7 @@
|
|||||||
"info.resolution": "分辨率",
|
"info.resolution": "分辨率",
|
||||||
"info.video_information": "📊 视频信息",
|
"info.video_information": "📊 视频信息",
|
||||||
"info.no_video_yet": "生成视频后,预览将显示在这里",
|
"info.no_video_yet": "生成视频后,预览将显示在这里",
|
||||||
|
"info.generation_time": "生成耗时",
|
||||||
|
|
||||||
"settings.title": "⚙️ 系统配置(必需)",
|
"settings.title": "⚙️ 系统配置(必需)",
|
||||||
"settings.not_configured": "⚠️ 请先完成系统配置才能生成视频",
|
"settings.not_configured": "⚠️ 请先完成系统配置才能生成视频",
|
||||||
|
|||||||
Reference in New Issue
Block a user