From 825fa87443755bf8ce8c201ffad4d9eda3dcf5f8 Mon Sep 17 00:00:00 2001 From: "sdk-github-actions[bot]" Date: Mon, 28 Sep 2026 20:01:55 +0000 Subject: [PATCH 1/2] chore(release): auto --- .sdk.json | 2 +- README.md | 1 + magic_hour/environment.py | 2 +- .../resources/v1/ai_video_editor/README.md | 2 +- .../resources/v1/ai_video_editor/client.py | 4 +-- .../resources/v1/character_replace/README.md | 9 ++++-- .../resources/v1/character_replace/client.py | 28 ++++++++++++++++--- .../models/v1_video_projects_get_response.py | 2 +- magic_hour/types/params/__init__.py | 4 ++- .../params/v1_ai_video_editor_create_body.py | 2 +- .../v1_character_replace_create_body.py | 21 ++++++++++++-- .../v1_character_replace_create_body_style.py | 4 +-- pyproject.toml | 2 +- tests/test_v1_character_replace_client.py | 2 ++ 14 files changed, 64 insertions(+), 21 deletions(-) diff --git a/.sdk.json b/.sdk.json index 346bd23..5e74b20 100644 --- a/.sdk.json +++ b/.sdk.json @@ -1,5 +1,5 @@ { - "id": "824c8e76-3377-4969-99f1-7054db429172", + "id": "90092907-f79c-4e34-9056-c96300cedb96", "tracked_paths": [ { "editable": true, diff --git a/README.md b/README.md index db078b3..e690abe 100644 --- a/README.md +++ b/README.md @@ -225,6 +225,7 @@ download_urls = result.downloads ### [v1.ai_video_translator](magic_hour/resources/v1/ai_video_translator/README.md) - [create](magic_hour/resources/v1/ai_video_translator/README.md#create) - AI Video Translator +- [generate](magic_hour/resources/v1/ai_video_translator/README.md#generate) - Generate video translation ### [v1.ai_voice_cloner](magic_hour/resources/v1/ai_voice_cloner/README.md) diff --git a/magic_hour/environment.py b/magic_hour/environment.py index a67aac0..fe89fad 100644 --- a/magic_hour/environment.py +++ b/magic_hour/environment.py @@ -6,7 +6,7 @@ class Environment(enum.Enum): """Pre-defined base URLs for the API""" ENVIRONMENT = "https://api.magichour.ai" - MOCK_SERVER = "https://api.sideko.dev/v1/mock/magichour/magic-hour/0.84.0" + MOCK_SERVER = "https://api.sideko.dev/v1/mock/magichour/magic-hour/0.85.0" def _get_base_url( diff --git a/magic_hour/resources/v1/ai_video_editor/README.md b/magic_hour/resources/v1/ai_video_editor/README.md index 6433fe5..5ae63d6 100644 --- a/magic_hour/resources/v1/ai_video_editor/README.md +++ b/magic_hour/resources/v1/ai_video_editor/README.md @@ -100,7 +100,7 @@ For detailed examples, see the [product page](https://magichour.ai/products/ai-v | -------------------- | :------: | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ----------------------------------------------- | | `assets` | ✓ | Provide the assets for video editing. | `{"video_file_path": "api-assets/id/1234.mp4"}` | | `└─ video_file_path` | ✓ | The video to edit. This value is either - a direct URL to the video file - `file_path` field from the response of the [upload urls API](https://docs.magichour.ai/api-reference/files/generate-asset-upload-urls). See the [file upload guide](https://docs.magichour.ai/api-reference/files/generate-asset-upload-urls#input-file) for details. | `"api-assets/id/1234.mp4"` | -| `end_seconds` | ✓ | End time of your clip in seconds. Must be greater than `start_seconds`. Minimum duration depends on model: `gemini-omni-1.1`: 3s, LTX 2.5: 0.5s. Maximum duration depends on model: `gemini-omni-1.1`: 10s, LTX 2.5: 45s. | `5.0` | +| `end_seconds` | ✓ | End time of your clip in seconds. Must be greater than `start_seconds`. Minimum duration depends on model: `gemini-omni-1.1`: 3s, LTX 2.5: 0.5s. Maximum duration depends on model: `gemini-omni-1.1`: 10s, LTX 2.5: 20s. | `5.0` | | `style` | ✓ | | `{"prompt": "Change the car color to blue"}` | | `└─ prompt` | ✓ | The prompt used to edit the video. | `"Change the car color to blue"` | | `model` | ✗ | Editing model. Defaults to LTX 2.5 for free tier and `gemini-omni-1.1` for paid. `gemini-omni` is deprecated; use `gemini-omni-1.1` instead. | `"gemini-omni-1.1"` | diff --git a/magic_hour/resources/v1/ai_video_editor/client.py b/magic_hour/resources/v1/ai_video_editor/client.py index 2ea7252..314703e 100644 --- a/magic_hour/resources/v1/ai_video_editor/client.py +++ b/magic_hour/resources/v1/ai_video_editor/client.py @@ -175,7 +175,7 @@ def create( resolution: Output resolution. Defaults to `480p` for free tier and `720p` for paid. `gemini-omni-1.1` and deprecated `gemini-omni` support 720p and 1080p; LTX 2.5 supports 480p, 720p, and 1080p. start_seconds: Start time of your clip (seconds). Must be ≥ 0. assets: Provide the assets for video editing. - end_seconds: End time of your clip in seconds. Must be greater than `start_seconds`. Minimum duration depends on model: `gemini-omni-1.1`: 3s, LTX 2.5: 0.5s. Maximum duration depends on model: `gemini-omni-1.1`: 10s, LTX 2.5: 45s. + end_seconds: End time of your clip in seconds. Must be greater than `start_seconds`. Minimum duration depends on model: `gemini-omni-1.1`: 3s, LTX 2.5: 0.5s. Maximum duration depends on model: `gemini-omni-1.1`: 10s, LTX 2.5: 20s. style: V1AiVideoEditorCreateBodyStyle request_options: Additional options to customize the HTTP request @@ -375,7 +375,7 @@ async def create( resolution: Output resolution. Defaults to `480p` for free tier and `720p` for paid. `gemini-omni-1.1` and deprecated `gemini-omni` support 720p and 1080p; LTX 2.5 supports 480p, 720p, and 1080p. start_seconds: Start time of your clip (seconds). Must be ≥ 0. assets: Provide the assets for video editing. - end_seconds: End time of your clip in seconds. Must be greater than `start_seconds`. Minimum duration depends on model: `gemini-omni-1.1`: 3s, LTX 2.5: 0.5s. Maximum duration depends on model: `gemini-omni-1.1`: 10s, LTX 2.5: 45s. + end_seconds: End time of your clip in seconds. Must be greater than `start_seconds`. Minimum duration depends on model: `gemini-omni-1.1`: 3s, LTX 2.5: 0.5s. Maximum duration depends on model: `gemini-omni-1.1`: 10s, LTX 2.5: 20s. style: V1AiVideoEditorCreateBodyStyle request_options: Additional options to customize the HTTP request diff --git a/magic_hour/resources/v1/character_replace/README.md b/magic_hour/resources/v1/character_replace/README.md index 9336018..dd3d6ef 100644 --- a/magic_hour/resources/v1/character_replace/README.md +++ b/magic_hour/resources/v1/character_replace/README.md @@ -110,13 +110,14 @@ For detailed examples, see the [product page](https://magichour.ai/products/char | `└─ image_file_path` | ✓ | Reference character image used as the replacement or animation target. This value is either - a direct URL to the video file - `file_path` field from the response of the [upload urls API](https://docs.magichour.ai/api-reference/files/generate-asset-upload-urls). See the [file upload guide](https://docs.magichour.ai/api-reference/files/generate-asset-upload-urls#input-file) for details. | `"api-assets/id/5678.png"` | | `└─ video_file_path` | ✓ | Source video containing the subject to replace or animate. This value is either - a direct URL to the video file - `file_path` field from the response of the [upload urls API](https://docs.magichour.ai/api-reference/files/generate-asset-upload-urls). See the [file upload guide](https://docs.magichour.ai/api-reference/files/generate-asset-upload-urls#input-file) for details. | `"api-assets/id/1234.mp4"` | | `end_seconds` | ✓ | End time of your clip (seconds). Must be greater than start_seconds. | `15.0` | +| `model` | ✗ | Model to use. Defaults to `wan-animate`. * **`wan-animate`**: 480p, 720p. Supports `points` subject selection. * **`kling-3.0`**: 720p, 1080p. Clips of 3–10 seconds in `replace` mode or 3–30 seconds in `animate` mode. Picks the main person automatically, so `points` are rejected. | `"wan-animate"` | | `name` | ✗ | Give your video a custom name for easy identification. | `"My Character Replace video"` | -| `resolution` | ✗ | Output video resolution. Defaults to 480p, the lowest resolution available on your plan. | `"720p"` | +| `resolution` | ✗ | Output video resolution. Must be supported by `model`. Defaults to the lowest resolution available on your plan for that model. | `"720p"` | | `start_seconds` | ✗ | Start time of your clip (seconds). Must be ≥ 0. | `0.0` | | `style` | ✗ | Optional style controls for replace vs animate mode and subject selection. | `{"mode": "replace", "selection_mode": "auto"}` | | `└─ mode` | ✗ | Processing mode. `replace` swaps the detected subject with your reference character. `animate` transfers motion from the video onto your character image. | `"replace"` | -| `└─ points` | ✗ | On-frame markers for manual subject selection. Required when `selection_mode` is `point`. Ignored when `selection_mode` is `auto` or omitted. | `[{"position_x": 320, "position_y": 180, "time_seconds": 2.5}]` | -| `└─ selection_mode` | ✗ | How to locate the subject in the source video. `auto` detects a person automatically. `point` uses your `points` to mark the subject. Defaults to `auto`. | `"auto"` | +| `└─ points` | ✗ | On-frame markers for manual subject selection. Required when `selection_mode` is `point`. Ignored when `selection_mode` is `auto` or omitted. Rejected for models without subject selection (supported by `wan-animate`). | `[{"position_x": 320, "position_y": 180, "time_seconds": 2.5}]` | +| `└─ selection_mode` | ✗ | How to locate the subject in the source video. `auto` detects a person automatically. `point` uses your `points` to mark the subject and is supported by `wan-animate`. Defaults to `auto`. | `"auto"` | #### Synchronous Client @@ -131,6 +132,7 @@ res = client.v1.character_replace.create( "video_file_path": "api-assets/id/1234.mp4", }, end_seconds=15.0, + model="wan-animate", name="My Character Replace video", resolution="720p", start_seconds=0.0, @@ -151,6 +153,7 @@ res = await client.v1.character_replace.create( "video_file_path": "api-assets/id/1234.mp4", }, end_seconds=15.0, + model="wan-animate", name="My Character Replace video", resolution="720p", start_seconds=0.0, diff --git a/magic_hour/resources/v1/character_replace/client.py b/magic_hour/resources/v1/character_replace/client.py index 7761556..6723017 100644 --- a/magic_hour/resources/v1/character_replace/client.py +++ b/magic_hour/resources/v1/character_replace/client.py @@ -121,11 +121,15 @@ def create( *, assets: params.V1CharacterReplaceCreateBodyAssets, end_seconds: float, + model: typing.Union[ + typing.Optional[typing_extensions.Literal["kling-3.0", "wan-animate"]], + type_utils.NotGiven, + ] = type_utils.NOT_GIVEN, name: typing.Union[ typing.Optional[str], type_utils.NotGiven ] = type_utils.NOT_GIVEN, resolution: typing.Union[ - typing.Optional[typing_extensions.Literal["480p", "720p"]], + typing.Optional[typing_extensions.Literal["1080p", "480p", "720p"]], type_utils.NotGiven, ] = type_utils.NOT_GIVEN, start_seconds: typing.Union[ @@ -166,8 +170,12 @@ def create( POST /v1/character-replace Args: + model: Model to use. Defaults to `wan-animate`. + + * **`wan-animate`**: 480p, 720p. Supports `points` subject selection. + * **`kling-3.0`**: 720p, 1080p. Clips of 3–10 seconds in `replace` mode or 3–30 seconds in `animate` mode. Picks the main person automatically, so `points` are rejected. name: Give your video a custom name for easy identification. - resolution: Output video resolution. Defaults to 480p, the lowest resolution available on your plan. + resolution: Output video resolution. Must be supported by `model`. Defaults to the lowest resolution available on your plan for that model. start_seconds: Start time of your clip (seconds). Must be ≥ 0. style: Optional style controls for replace vs animate mode and subject selection. assets: Source video and reference character image for the job. @@ -189,6 +197,7 @@ def create( "video_file_path": "api-assets/id/1234.mp4", }, end_seconds=15.0, + model="wan-animate", name="My Character Replace video", resolution="720p", start_seconds=0.0, @@ -198,6 +207,7 @@ def create( """ _json = to_encodable( item={ + "model": model, "name": name, "resolution": resolution, "start_seconds": start_seconds, @@ -317,11 +327,15 @@ async def create( *, assets: params.V1CharacterReplaceCreateBodyAssets, end_seconds: float, + model: typing.Union[ + typing.Optional[typing_extensions.Literal["kling-3.0", "wan-animate"]], + type_utils.NotGiven, + ] = type_utils.NOT_GIVEN, name: typing.Union[ typing.Optional[str], type_utils.NotGiven ] = type_utils.NOT_GIVEN, resolution: typing.Union[ - typing.Optional[typing_extensions.Literal["480p", "720p"]], + typing.Optional[typing_extensions.Literal["1080p", "480p", "720p"]], type_utils.NotGiven, ] = type_utils.NOT_GIVEN, start_seconds: typing.Union[ @@ -362,8 +376,12 @@ async def create( POST /v1/character-replace Args: + model: Model to use. Defaults to `wan-animate`. + + * **`wan-animate`**: 480p, 720p. Supports `points` subject selection. + * **`kling-3.0`**: 720p, 1080p. Clips of 3–10 seconds in `replace` mode or 3–30 seconds in `animate` mode. Picks the main person automatically, so `points` are rejected. name: Give your video a custom name for easy identification. - resolution: Output video resolution. Defaults to 480p, the lowest resolution available on your plan. + resolution: Output video resolution. Must be supported by `model`. Defaults to the lowest resolution available on your plan for that model. start_seconds: Start time of your clip (seconds). Must be ≥ 0. style: Optional style controls for replace vs animate mode and subject selection. assets: Source video and reference character image for the job. @@ -385,6 +403,7 @@ async def create( "video_file_path": "api-assets/id/1234.mp4", }, end_seconds=15.0, + model="wan-animate", name="My Character Replace video", resolution="720p", start_seconds=0.0, @@ -394,6 +413,7 @@ async def create( """ _json = to_encodable( item={ + "model": model, "name": name, "resolution": resolution, "start_seconds": start_seconds, diff --git a/magic_hour/types/models/v1_video_projects_get_response.py b/magic_hour/types/models/v1_video_projects_get_response.py index 709a95a..55117a4 100644 --- a/magic_hour/types/models/v1_video_projects_get_response.py +++ b/magic_hour/types/models/v1_video_projects_get_response.py @@ -116,7 +116,7 @@ class V1VideoProjectsGetResponse(pydantic.BaseModel): alias="type", ) """ - The type of the video project. Possible values are ANIMATION, AUTO_SUBTITLE, VIDEO_TO_VIDEO, FACE_SWAP, TEXT_TO_VIDEO, IMAGE_TO_VIDEO, LIP_SYNC, TALKING_PHOTO, AVATAR, VIDEO_UPSCALER, VIDEO_EDITOR, CHARACTER_REPLACE, VIDEO_COLORIZER, VIDEO_COLOR_GRADER, VIDEO_TRANSLATOR, MUSIC_VIDEO, EXTEND, AUDIO_TO_VIDEO, VIDEO_EXPANDER, UGC_AD + The type of the video project. Possible values are ANIMATION, AUTO_SUBTITLE, VIDEO_TO_VIDEO, FACE_SWAP, TEXT_TO_VIDEO, IMAGE_TO_VIDEO, LIP_SYNC, TALKING_PHOTO, AVATAR, VIDEO_UPSCALER, VIDEO_EDITOR, CHARACTER_REPLACE, VIDEO_COLORIZER, VIDEO_WATERMARK_REMOVER, VIDEO_COLOR_GRADER, VIDEO_TRANSLATOR, MUSIC_VIDEO, EXTEND, AUDIO_TO_VIDEO, VIDEO_EXPANDER, UGC_AD """ width: int = pydantic.Field( alias="width", diff --git a/magic_hour/types/params/__init__.py b/magic_hour/types/params/__init__.py index 4301a8b..ff6b10b 100644 --- a/magic_hour/types/params/__init__.py +++ b/magic_hour/types/params/__init__.py @@ -132,7 +132,9 @@ V1AiVideoTranslatorCreateBodyAssets, _SerializerV1AiVideoTranslatorCreateBodyAssets, ) -from .v1_ai_video_translator_generate_body_assets import V1AiVideoTranslatorGenerateBodyAssets +from .v1_ai_video_translator_generate_body_assets import ( + V1AiVideoTranslatorGenerateBodyAssets, +) from .v1_ai_voice_cloner_create_body import ( V1AiVoiceClonerCreateBody, _SerializerV1AiVoiceClonerCreateBody, diff --git a/magic_hour/types/params/v1_ai_video_editor_create_body.py b/magic_hour/types/params/v1_ai_video_editor_create_body.py index 1db7714..8de08f0 100644 --- a/magic_hour/types/params/v1_ai_video_editor_create_body.py +++ b/magic_hour/types/params/v1_ai_video_editor_create_body.py @@ -24,7 +24,7 @@ class V1AiVideoEditorCreateBody(typing_extensions.TypedDict): end_seconds: typing_extensions.Required[float] """ - End time of your clip in seconds. Must be greater than `start_seconds`. Minimum duration depends on model: `gemini-omni-1.1`: 3s, LTX 2.5: 0.5s. Maximum duration depends on model: `gemini-omni-1.1`: 10s, LTX 2.5: 45s. + End time of your clip in seconds. Must be greater than `start_seconds`. Minimum duration depends on model: `gemini-omni-1.1`: 3s, LTX 2.5: 0.5s. Maximum duration depends on model: `gemini-omni-1.1`: 10s, LTX 2.5: 20s. """ model: typing_extensions.NotRequired[ diff --git a/magic_hour/types/params/v1_character_replace_create_body.py b/magic_hour/types/params/v1_character_replace_create_body.py index fbfeacd..0631f91 100644 --- a/magic_hour/types/params/v1_character_replace_create_body.py +++ b/magic_hour/types/params/v1_character_replace_create_body.py @@ -27,14 +27,26 @@ class V1CharacterReplaceCreateBody(typing_extensions.TypedDict): End time of your clip (seconds). Must be greater than start_seconds. """ + model: typing_extensions.NotRequired[ + typing_extensions.Literal["kling-3.0", "wan-animate"] + ] + """ + Model to use. Defaults to `wan-animate`. + + * **`wan-animate`**: 480p, 720p. Supports `points` subject selection. + * **`kling-3.0`**: 720p, 1080p. Clips of 3–10 seconds in `replace` mode or 3–30 seconds in `animate` mode. Picks the main person automatically, so `points` are rejected. + """ + name: typing_extensions.NotRequired[str] """ Give your video a custom name for easy identification. """ - resolution: typing_extensions.NotRequired[typing_extensions.Literal["480p", "720p"]] + resolution: typing_extensions.NotRequired[ + typing_extensions.Literal["1080p", "480p", "720p"] + ] """ - Output video resolution. Defaults to 480p, the lowest resolution available on your plan. + Output video resolution. Must be supported by `model`. Defaults to the lowest resolution available on your plan for that model. """ start_seconds: typing_extensions.NotRequired[float] @@ -64,8 +76,11 @@ class _SerializerV1CharacterReplaceCreateBody(pydantic.BaseModel): end_seconds: float = pydantic.Field( alias="end_seconds", ) + model: typing.Optional[typing_extensions.Literal["kling-3.0", "wan-animate"]] = ( + pydantic.Field(alias="model", default=None) + ) name: typing.Optional[str] = pydantic.Field(alias="name", default=None) - resolution: typing.Optional[typing_extensions.Literal["480p", "720p"]] = ( + resolution: typing.Optional[typing_extensions.Literal["1080p", "480p", "720p"]] = ( pydantic.Field(alias="resolution", default=None) ) start_seconds: typing.Optional[float] = pydantic.Field( diff --git a/magic_hour/types/params/v1_character_replace_create_body_style.py b/magic_hour/types/params/v1_character_replace_create_body_style.py index d1df0eb..67b0674 100644 --- a/magic_hour/types/params/v1_character_replace_create_body_style.py +++ b/magic_hour/types/params/v1_character_replace_create_body_style.py @@ -22,14 +22,14 @@ class V1CharacterReplaceCreateBodyStyle(typing_extensions.TypedDict): typing.List[V1CharacterReplaceCreateBodyStylePointsItem] ] """ - On-frame markers for manual subject selection. Required when `selection_mode` is `point`. Ignored when `selection_mode` is `auto` or omitted. + On-frame markers for manual subject selection. Required when `selection_mode` is `point`. Ignored when `selection_mode` is `auto` or omitted. Rejected for models without subject selection (supported by `wan-animate`). """ selection_mode: typing_extensions.NotRequired[ typing_extensions.Literal["auto", "point"] ] """ - How to locate the subject in the source video. `auto` detects a person automatically. `point` uses your `points` to mark the subject. Defaults to `auto`. + How to locate the subject in the source video. `auto` detects a person automatically. `point` uses your `points` to mark the subject and is supported by `wan-animate`. Defaults to `auto`. """ diff --git a/pyproject.toml b/pyproject.toml index 1c0702c..b5003b0 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "magic_hour" -version = "0.84.0" +version = "0.85.0" description = "Python SDK for Magic Hour API" readme = "README.md" authors = [] diff --git a/tests/test_v1_character_replace_client.py b/tests/test_v1_character_replace_client.py index 4a954a2..13e4544 100644 --- a/tests/test_v1_character_replace_client.py +++ b/tests/test_v1_character_replace_client.py @@ -32,6 +32,7 @@ def test_create_200_success_all_params() -> None: "video_file_path": "api-assets/id/1234.mp4", }, end_seconds=15.0, + model="wan-animate", name="My Character Replace video", resolution="720p", start_seconds=0.0, @@ -78,6 +79,7 @@ async def test_await_create_200_success_all_params() -> None: "video_file_path": "api-assets/id/1234.mp4", }, end_seconds=15.0, + model="wan-animate", name="My Character Replace video", resolution="720p", start_seconds=0.0, From bf0aab155c4f048cebeb53dec4f261f5cf813cac Mon Sep 17 00:00:00 2001 From: David Hu Date: Mon, 28 Sep 2026 13:10:49 -0700 Subject: [PATCH 2/2] fix: sync character_replace generate() with create() Add model param and 1080p resolution to generate() in sync and async clients. Co-Authored-By: Claude Opus 5.5 (1M context) --- .../resources/v1/character_replace/client.py | 28 ++++++++++++++++--- 1 file changed, 24 insertions(+), 4 deletions(-) diff --git a/magic_hour/resources/v1/character_replace/client.py b/magic_hour/resources/v1/character_replace/client.py index 6723017..381bad6 100644 --- a/magic_hour/resources/v1/character_replace/client.py +++ b/magic_hour/resources/v1/character_replace/client.py @@ -34,7 +34,7 @@ def generate( typing.Optional[str], type_utils.NotGiven ] = type_utils.NOT_GIVEN, resolution: typing.Union[ - typing.Optional[typing_extensions.Literal["480p", "720p"]], + typing.Optional[typing_extensions.Literal["1080p", "480p", "720p"]], type_utils.NotGiven, ] = type_utils.NOT_GIVEN, start_seconds: typing.Union[ @@ -44,6 +44,10 @@ def generate( typing.Optional[params.V1CharacterReplaceCreateBodyStyle], type_utils.NotGiven, ] = type_utils.NOT_GIVEN, + model: typing.Union[ + typing.Optional[typing_extensions.Literal["kling-3.0", "wan-animate"]], + type_utils.NotGiven, + ] = type_utils.NOT_GIVEN, wait_for_completion: bool = True, download_outputs: bool = True, download_directory: typing.Optional[str] = None, @@ -55,8 +59,12 @@ def generate( Create a Character Replace video. Credits are only charged for the frames that actually render. Args: + model: Model to use. Defaults to `wan-animate`. + + * **`wan-animate`**: 480p, 720p. Supports `points` subject selection. + * **`kling-3.0`**: 720p, 1080p. Clips of 3–10 seconds in `replace` mode or 3–30 seconds in `animate` mode. Picks the main person automatically, so `points` are rejected. name: Give your video a custom name for easy identification. - resolution: Output video resolution. Defaults to 480p, the lowest resolution available on your plan. + resolution: Output video resolution. Must be supported by `model`. Defaults to the lowest resolution available on your plan for that model. start_seconds: Start time of your clip (seconds). Must be ≥ 0. style: Optional style controls for replace vs animate mode and subject selection. assets: Source video and reference character image for the job. @@ -77,6 +85,7 @@ def generate( "video_file_path": "path/to/video.mp4", }, end_seconds=15.0, + model="wan-animate", name="My Character Replace video", resolution="720p", start_seconds=0.0, @@ -102,6 +111,7 @@ def generate( resolution=resolution, start_seconds=start_seconds, style=style, + model=model, request_options=request_options, ) logger.info(f"Character Replace response: {create_response}") @@ -240,7 +250,7 @@ async def generate( typing.Optional[str], type_utils.NotGiven ] = type_utils.NOT_GIVEN, resolution: typing.Union[ - typing.Optional[typing_extensions.Literal["480p", "720p"]], + typing.Optional[typing_extensions.Literal["1080p", "480p", "720p"]], type_utils.NotGiven, ] = type_utils.NOT_GIVEN, start_seconds: typing.Union[ @@ -250,6 +260,10 @@ async def generate( typing.Optional[params.V1CharacterReplaceCreateBodyStyle], type_utils.NotGiven, ] = type_utils.NOT_GIVEN, + model: typing.Union[ + typing.Optional[typing_extensions.Literal["kling-3.0", "wan-animate"]], + type_utils.NotGiven, + ] = type_utils.NOT_GIVEN, wait_for_completion: bool = True, download_outputs: bool = True, download_directory: typing.Optional[str] = None, @@ -261,8 +275,12 @@ async def generate( Create a Character Replace video. Credits are only charged for the frames that actually render. Args: + model: Model to use. Defaults to `wan-animate`. + + * **`wan-animate`**: 480p, 720p. Supports `points` subject selection. + * **`kling-3.0`**: 720p, 1080p. Clips of 3–10 seconds in `replace` mode or 3–30 seconds in `animate` mode. Picks the main person automatically, so `points` are rejected. name: Give your video a custom name for easy identification. - resolution: Output video resolution. Defaults to 480p, the lowest resolution available on your plan. + resolution: Output video resolution. Must be supported by `model`. Defaults to the lowest resolution available on your plan for that model. start_seconds: Start time of your clip (seconds). Must be ≥ 0. style: Optional style controls for replace vs animate mode and subject selection. assets: Source video and reference character image for the job. @@ -283,6 +301,7 @@ async def generate( "video_file_path": "path/to/video.mp4", }, end_seconds=15.0, + model="wan-animate", name="My Character Replace video", resolution="720p", start_seconds=0.0, @@ -308,6 +327,7 @@ async def generate( resolution=resolution, start_seconds=start_seconds, style=style, + model=model, request_options=request_options, ) logger.info(f"Character Replace response: {create_response}")