更新TTS相关配置,调整语音ID格式,优化工作流参数,确保一致性和可读性。
This commit is contained in:
@@ -124,11 +124,12 @@ class FrameProcessor:
|
||||
from reelforge.utils.os_util import get_task_frame_path
|
||||
output_path = get_task_frame_path(config.task_id, frame.index, "audio")
|
||||
|
||||
# Call TTS with specific output path
|
||||
# Call TTS with specific output path and workflow
|
||||
audio_path = await self.core.tts(
|
||||
text=frame.narration,
|
||||
workflow=config.tts_workflow, # Use workflow from config
|
||||
voice=config.voice_id,
|
||||
rate="+20%",
|
||||
speed=config.tts_speed, # Use speed (not rate) from config
|
||||
output_path=output_path,
|
||||
)
|
||||
|
||||
|
||||
@@ -116,8 +116,8 @@ class ImagePromptGeneratorService:
|
||||
# 5. Apply prompt prefix to each prompt
|
||||
from reelforge.utils.prompt_helper import build_image_prompt
|
||||
|
||||
# Get prompt prefix from config
|
||||
image_config = self.core.config.get("image", {})
|
||||
# Get prompt prefix from config (fix: correct path is comfyui.image.prompt_prefix)
|
||||
image_config = self.core.config.get("comfyui", {}).get("image", {})
|
||||
prompt_prefix = image_config.get("prompt_prefix", "")
|
||||
|
||||
# Apply prefix to each base prompt
|
||||
|
||||
@@ -52,8 +52,8 @@ class TTSService(ComfyBaseService):
|
||||
comfyui_url: Optional[str] = None,
|
||||
runninghub_api_key: Optional[str] = None,
|
||||
# TTS parameters
|
||||
voice: Optional[str] = None,
|
||||
speed: float = 1.0,
|
||||
voice: str = "[Chinese] zh-CN Yunjian",
|
||||
speed: float = 1.2,
|
||||
# Output path
|
||||
output_path: Optional[str] = None,
|
||||
**params
|
||||
@@ -88,7 +88,7 @@ class TTSService(ComfyBaseService):
|
||||
audio_path = await reelforge.tts(
|
||||
text="Hello",
|
||||
workflow="tts_edge.json",
|
||||
voice="zh-CN-XiaoxiaoNeural",
|
||||
voice="[Chinese] zh-CN Xiaoxiao",
|
||||
speed=1.2
|
||||
)
|
||||
|
||||
|
||||
@@ -54,7 +54,9 @@ class VideoGeneratorService:
|
||||
|
||||
# === Basic Config ===
|
||||
n_scenes: int = 5, # Only used in generate mode; ignored in fixed mode
|
||||
voice_id: str = "zh-CN-YunjianNeural",
|
||||
voice_id: str = "[Chinese] zh-CN Yunjian",
|
||||
tts_workflow: Optional[str] = None,
|
||||
tts_speed: float = 1.2,
|
||||
output_path: Optional[str] = None,
|
||||
|
||||
# === LLM Parameters ===
|
||||
@@ -111,7 +113,9 @@ class VideoGeneratorService:
|
||||
n_scenes: Number of storyboard scenes (default 5)
|
||||
Only effective in generate mode; ignored in fixed mode
|
||||
|
||||
voice_id: TTS voice ID (default "zh-CN-YunjianNeural")
|
||||
voice_id: TTS voice ID (default "[Chinese] zh-CN Yunjian")
|
||||
tts_workflow: TTS workflow filename (e.g., "tts_edge.json", None = use default)
|
||||
tts_speed: TTS speed multiplier (1.0 = normal, 1.2 = 20% faster, default 1.2)
|
||||
output_path: Output video path (auto-generated if None)
|
||||
|
||||
min_narration_words: Min narration length (generate mode only)
|
||||
@@ -219,6 +223,8 @@ class VideoGeneratorService:
|
||||
video_height=video_height,
|
||||
video_fps=video_fps,
|
||||
voice_id=voice_id,
|
||||
tts_workflow=tts_workflow,
|
||||
tts_speed=tts_speed,
|
||||
image_width=image_width,
|
||||
image_height=image_height,
|
||||
image_workflow=image_workflow,
|
||||
@@ -259,7 +265,8 @@ class VideoGeneratorService:
|
||||
# Override prompt_prefix if provided (temporarily modify config)
|
||||
original_prefix = None
|
||||
if prompt_prefix is not None:
|
||||
image_config = self.core.config.get("image", {})
|
||||
# Fix: image config is under comfyui.image, not directly under config
|
||||
image_config = self.core.config.get("comfyui", {}).get("image", {})
|
||||
original_prefix = image_config.get("prompt_prefix")
|
||||
image_config["prompt_prefix"] = prompt_prefix
|
||||
logger.info(f"Using custom prompt_prefix: '{prompt_prefix}'")
|
||||
|
||||
Reference in New Issue
Block a user