From 024ce11aab9a3beafbea082d91ab551296bffe75 Mon Sep 17 00:00:00 2001 From: puke <1129090915@qq.com> Date: Fri, 7 Nov 2025 11:33:24 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8DComfyUI=E6=96=B9=E5=BC=8Ftts?= =?UTF-8?q?=E4=BC=A0=E5=8F=82=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pixelle_video/services/tts_service.py | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/pixelle_video/services/tts_service.py b/pixelle_video/services/tts_service.py index cef60d3..0432e28 100644 --- a/pixelle_video/services/tts_service.py +++ b/pixelle_video/services/tts_service.py @@ -219,10 +219,10 @@ class TTSService(ComfyBaseService): # 2. Build workflow parameters workflow_params = {"text": text} - # Add optional TTS parameters + # Add optional TTS parameters (only if explicitly provided and not None) if voice is not None: workflow_params["voice"] = voice - if speed != 1.0: + if speed is not None and speed != 1.0: workflow_params["speed"] = speed # Add any additional parameters @@ -259,19 +259,28 @@ class TTSService(ComfyBaseService): # Check for audio files in result.audios (if available) if hasattr(result, 'audios') and result.audios: audio_path = result.audios[0] + logger.debug(f"✅ Found audio in result.audios: {audio_path}") # Check for files in result.files elif hasattr(result, 'files') and result.files: audio_path = result.files[0] + logger.debug(f"✅ Found audio in result.files: {audio_path}") # Check in outputs dictionary elif hasattr(result, 'outputs') and result.outputs: + logger.debug(f"Searching for audio file in result.outputs: {result.outputs}") # Try to find audio file in outputs for key, value in result.outputs.items(): if isinstance(value, str) and any(value.endswith(ext) for ext in ['.mp3', '.wav', '.flac']): audio_path = value + logger.debug(f"✅ Found audio in result.outputs[{key}]: {audio_path}") break if not audio_path: logger.error("No audio file generated") + logger.error(f"❌ Result analysis:") + logger.error(f" - result.audios: {getattr(result, 'audios', 'NOT_FOUND')}") + logger.error(f" - result.files: {getattr(result, 'files', 'NOT_FOUND')}") + logger.error(f" - result.outputs: {getattr(result, 'outputs', 'NOT_FOUND')}") + logger.error(f" - Full __dict__: {result.__dict__}") raise Exception("No audio file generated by workflow") # If output_path provided and audio_path is URL, download to local