fix: correct per-model video API field names and remove non-existent models

Each video model uses a different image input field:
- kling-o1-pro/std: first_frame (not image)
- kling-elements-pro/std: images (array)
- minimax-hailuo: image, duration fixed at "6"

Also:
- kling-elements requires slug aspect ratios (square_1_1, etc.)
- Remove wan-2.5 and runway-gen4 which return 404

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-04-10 18:15:59 +02:00
parent 209a4840db
commit 0de3f7d6bc
3 changed files with 55 additions and 14 deletions
+7 -2
View File
@@ -161,7 +161,11 @@ def generate_video(
] = None,
duration: Annotated[
int,
typer.Option("--duration", "-d", help="Video duration in seconds: [cyan]5[/cyan] or [cyan]10[/cyan]", min=5, max=10),
typer.Option(
"--duration", "-d",
help="Duration in seconds: [cyan]5[/cyan] or [cyan]10[/cyan] (minimax-hailuo is fixed at 6s)",
min=5, max=10,
),
] = 5,
aspect_ratio: Annotated[
str,
@@ -189,7 +193,8 @@ def generate_video(
[dim]Examples:[/dim]
freepik generate-video photo.jpg --prompt "gentle ocean waves" --model kling-o1-pro
freepik generate-video portrait.png --model minimax-hailuo --duration 10 --aspect-ratio 9:16
freepik generate-video portrait.png --model kling-elements-pro --aspect-ratio 9:16
freepik generate-video photo.jpg --model minimax-hailuo --aspect-ratio 16:9
"""
config = FreepikConfig.load()
key = _get_api_key(api_key, config)