diff --git a/app/ktv_adapter.py b/app/ktv_adapter.py index 1182666..9f043a9 100644 --- a/app/ktv_adapter.py +++ b/app/ktv_adapter.py @@ -197,7 +197,7 @@ async def handle_video_preparing(tenant_id, task_id, step_name, input_data, conf # ── Demucs ───────────────────────────────────────────────────────── async def handle_demucs_separating(tenant_id, task_id, step_name, input_data, config): - """通过 API 调 ky-demucs-separate。""" + """通过 API 调 ky-demucs-separate。固定使用 separate_full 模式。""" work_dir = _task_dir(task_id) audio_path = None for dep_output in input_data.values(): @@ -209,21 +209,25 @@ async def handle_demucs_separating(tenant_id, task_id, step_name, input_data, co client = get_ktv_client() result = await client.call(STEP_MODELS["demucs_separating"], - {"audio_file": audio_path}) + {"audio_file": audio_path, + "task_type": "separate_full"}) if result.get("error"): raise ValueError(f"Demucs 分离失败: {result['error']}") # 下载结果文件 vocals_local = os.path.join(work_dir, "vocals.wav") - no_vocals_local = os.path.join(work_dir, "no_vocals.wav") + accompaniment_local = os.path.join(work_dir, "accompaniment.wav") if result.get("vocals_url"): await _download(result["vocals_url"], vocals_local) if result.get("accompaniment_url"): - await _download(result["accompaniment_url"], no_vocals_local) + await _download(result["accompaniment_url"], accompaniment_local) - return {"vocals_path": vocals_local, "no_vocals_path": no_vocals_local, - "mode": "2stem", "usage": result.get("usage", {})} + return {"vocals_path": vocals_local, + "no_vocals_path": accompaniment_local, + "accompaniment_path": accompaniment_local, + "mode": "separate_full", + "usage": result.get("usage", {})} # ── Lyric Calibration ──────────────────────────────────────────────