배경음악 기능 추가

This commit is contained in:
skkim committed 2026-05-12 15:18:35 +09:00
1 parent 2c8c16c288
commit ec3e0159e8
7 files changed
+166 -74

No files matched your search

+18 -10
View File
@@ -356,18 +356,26 @@ async def generate_lyric(
step4_start = time.perf_counter()
logger.debug(f"[generate_lyric] Step 4: 백그라운드 태스크 스케줄링...")
orientation = request_body.orientation
background_tasks.add_task(
generate_lyric_background,
task_id=task_id,
prompt=lyric_prompt,
lyric_input_data=lyric_input_data,
lyric_id=lyric.id,
)
if request_body.instrumental:
# BGM 모드: ChatGPT 가사 생성 없이 Lyric을 즉시 completed로 마무리
lyric.status = "completed"
lyric.lyric_result = ""
await session.commit()
logger.info(f"[generate_lyric] BGM 모드 - 가사 생성 스킵, lyric_id: {lyric.id}")
else:
background_tasks.add_task(
generate_lyric_background,
task_id=task_id,
prompt=lyric_prompt,
lyric_input_data=lyric_input_data,
lyric_id=lyric.id,
)
background_tasks.add_task(
generate_subtitle_background,
orientation = orientation,
task_id=task_id
orientation=orientation,
task_id=task_id,
)
step4_elapsed = (time.perf_counter() - step4_start) * 1000
+1
View File
@@ -76,6 +76,7 @@ class GenerateLyricRequest(BaseModel):
description="영상 방향 (horizontal: 가로형, vertical: 세로형)",
),
m_id : Optional[int] = Field(None, description="마케팅 인텔리전스 ID 값")
instrumental: bool = Field(default=False, description="BGM 전용 모드 (가사 생성 안 함)")
class GenerateLyricResponse(BaseModel):