对工作流和模板支持索引值参数输入

This commit is contained in:
puke
2025-11-27 11:40:32 +08:00
parent d64ab06977
commit 5423b77ae8

View File

@@ -153,6 +153,7 @@ class FrameProcessor:
"text": frame.narration,
"inference_mode": config.tts_inference_mode,
"output_path": output_path,
"index": frame.index + 1, # 1-based index for workflow
}
if config.tts_inference_mode == "local":
@@ -203,7 +204,8 @@ class FrameProcessor:
"workflow": config.media_workflow, # Pass workflow from config (None = use default)
"media_type": media_type,
"width": config.media_width,
"height": config.media_height
"height": config.media_height,
"index": frame.index + 1, # 1-based index for workflow
}
# For video workflows: pass audio duration as target video duration
@@ -298,6 +300,9 @@ class FrameProcessor:
ext["content_subtitle"] = content_metadata.subtitle or ""
ext["content_genre"] = content_metadata.genre or ""
# Add frame index (1-based)
ext["index"] = frame.index + 1
# Add custom template parameters
if config.template_params:
ext.update(config.template_params)