diff --git a/apps/api/app/services/edit_plan_service.py b/apps/api/app/services/edit_plan_service.py index 81a962b3b..6f2a4949d 100755 --- a/apps/api/app/services/edit_plan_service.py +++ b/apps/api/app/services/edit_plan_service.py @@ -913,12 +913,12 @@ class EditPlanService: plan_ids: list[str] = [] # #1855 P0:先确定片段数 clip_count(用于节奏模板生成长度匹配) - from packages.domain.voice_duration_planner import RHYTHM_TEMPLATES, adapt_template_length from packages.domain.bgm_pool import allocate_bgm_pool_for_variants from packages.domain.variant_plan_selector import ( - generate_visual_perturbation, generate_pixel_perturbation, + generate_visual_perturbation, ) + from packages.domain.voice_duration_planner import RHYTHM_TEMPLATES, adapt_template_length clip_count = 0 # 从源 plan 获取片段数(分页读,避免关系加载问题) @@ -939,9 +939,7 @@ class EditPlanService: for _idx in range(count): if clip_count > 0: variant_seed = rng.randint(0, 999999) - _tpl = adapt_template_length( - RHYTHM_TEMPLATES[variant_seed % len(RHYTHM_TEMPLATES)], clip_count - ) + _tpl = adapt_template_length(RHYTHM_TEMPLATES[variant_seed % len(RHYTHM_TEMPLATES)], clip_count) rhythm_templates_for_variants.append(_tpl) else: rhythm_templates_for_variants.append(None)