테스트 파일 정리 및 일부 함수 재구조화, playreel analyze까지
This commit is contained in:
1 parent
5c84733a8b
commit
53f308eac2
35 files changed
+1019
-49
No files matched your search
@@ -11,11 +11,10 @@ from models.detect import Regions
|
||||
from models.i2v import I2vResult
|
||||
from services.title_gate import check_title
|
||||
from settings import settings
|
||||
from utils.higgsfield import assert_account, parse_credits, parse_result_url, run_cli
|
||||
from utils.higgsfield import (KLING_3_0, assert_account, parse_credits, parse_result_url,
|
||||
run_cli)
|
||||
|
||||
# 프로덕션 표준은 Kling 3.0 pro. veo3_1은 저작권 콜백·실패 과금 사례로 제외.
|
||||
DEFAULT_MODEL = "kling3_0"
|
||||
VEO_QUALITY = "high"
|
||||
VEO_QUALITY = "high" # veo 전용
|
||||
CLIP_SECONDS = 8
|
||||
ASPECT_RATIO = "9:16"
|
||||
MAX_CREDITS = 60.0
|
||||
@@ -35,19 +34,19 @@ def reject_low_resolution(poster: Path) -> None:
|
||||
def cli_args(prompt: str, poster: Path, model: str) -> list[str]:
|
||||
args = ["--prompt", prompt, "--start-image", str(poster),
|
||||
"--duration", str(CLIP_SECONDS), "--aspect_ratio", ASPECT_RATIO]
|
||||
if model == "kling3_0":
|
||||
if model == KLING_3_0:
|
||||
# Kling은 9:16을 지정해도 포스터 비율로 출력한다 — 합성 단계에서 맞춘다
|
||||
return args + ["--mode", "pro", "--sound", "off"]
|
||||
return args + ["--quality", VEO_QUALITY]
|
||||
|
||||
|
||||
async def estimate_credits(prompt: str, poster: Path, model: str = DEFAULT_MODEL) -> float:
|
||||
async def estimate_credits(prompt: str, poster: Path, model: str = KLING_3_0) -> float:
|
||||
return parse_credits(await run_cli(
|
||||
"generate", "cost", model, *cli_args(prompt, poster, model), "--json", timeout=300))
|
||||
|
||||
|
||||
async def animate(prompt: str, poster: Path, regions: Regions, *,
|
||||
model: str = DEFAULT_MODEL,
|
||||
model: str = KLING_3_0,
|
||||
max_credits: float = MAX_CREDITS) -> I2vResult:
|
||||
if not prompt.strip():
|
||||
raise ValueError("i2v 프롬프트가 비어 있다 — motion 단계를 먼저 돌릴 것")
|
||||
|
||||
Reference in new issue
Block a user