From 93b6c10e6b6222f67f81eb17cfd44a7b33e5e040 Mon Sep 17 00:00:00 2001 From: "sdk-github-actions[bot]" Date: Fri, 20 Nov 2026 06:47:16 +0000 Subject: [PATCH 1/2] chore(release): auto --- .sdk.json | 2 +- magic_hour/environment.py | 2 +- .../resources/v1/character_replace/README.md | 30 +++++++++---------- .../resources/v1/character_replace/client.py | 18 +++++++---- .../v1_character_replace_create_body.py | 9 +++--- .../v1_character_replace_create_body_style.py | 2 +- pyproject.toml | 2 +- 7 files changed, 36 insertions(+), 29 deletions(-) diff --git a/.sdk.json b/.sdk.json index 73eaa44..2644e77 100644 --- a/.sdk.json +++ b/.sdk.json @@ -1,5 +1,5 @@ { - "id": "4b61b700-10e9-475a-aa03-c2cf9488f9bd", + "id": "e02520db-ece6-46e6-baee-c209b0871330", "tracked_paths": [ { "editable": true, diff --git a/magic_hour/environment.py b/magic_hour/environment.py index 3aa2af9..714df91 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.99.0" + MOCK_SERVER = "https://api.sideko.dev/v1/mock/magichour/magic-hour/0.100.0" def _get_base_url( diff --git a/magic_hour/resources/v1/character_replace/README.md b/magic_hour/resources/v1/character_replace/README.md index cf00320..748c828 100644 --- a/magic_hour/resources/v1/character_replace/README.md +++ b/magic_hour/resources/v1/character_replace/README.md @@ -106,21 +106,21 @@ For detailed examples, see the [product page](https://magichour.ai/products/char #### Parameters -| Parameter | Required | Description | Example | -| -------------------- | :------: | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -| `assets` | ✓ | Source video and reference character image for the job. | `{"image_file_path": "api-assets/id/5678.png", "video_file_path": "api-assets/id/1234.mp4"}` | -| `└─ image_file_path` | ✓ | Reference character image used as the replacement or animation target. This value is either - a direct URL to the file. The URL path must end in a supported file extension. - `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 file. The URL path must end in a supported file extension. - `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. | `5.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. * **`minimax-h3`**: 480p, 720p, 1080p. Clips of 1–30 seconds in `replace` mode or 1–60 seconds in `animate` mode. Subject `points` are `replace`-only; `animate` with `selection_mode` `point` returns 422, and with `auto` or no `selection_mode` the points are ignored. | `"wan-animate"` | -| `name` | ✗ | Give your video a custom name for easy identification. | `"My Character Replace video"` | -| `resolution` | ✗ | Output video resolution. Must be supported by `model`. Defaults to the lowest resolution available on your plan for that model. | `"480p"` | -| `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. Rejected for models without subject selection (supported by `wan-animate`, `minimax-h3`). `minimax-h3` subject `points` are `replace`-only; `animate` with `selection_mode` `point` returns 422, and with `auto` or no `selection_mode` the points are ignored. MiniMax H3 manual replacement accepts 1 to 10 points; each must satisfy `start_seconds <= time_seconds < end_seconds`. | `[{"position_x": 320, "position_y": 180, "time_seconds": 2.5}]` | -| `└─ prompt` | ✗ | Optional direction. Supported by kling-3.0, minimax-h3. For MiniMax H3 in replace mode, ignored and not saved when `selection_mode` is `point`; applies only to automatic person selection. | `"string"` | -| `└─ 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`, `minimax-h3`. `minimax-h3` subject `points` are `replace`-only; `animate` with `selection_mode` `point` returns 422, and with `auto` or no `selection_mode` the points are ignored. Defaults to `auto`. | `"auto"` | +| Parameter | Required | Description | Example | +| -------------------- | :------: | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | +| `assets` | ✓ | Source video and reference character image for the job. | `{"image_file_path": "api-assets/id/5678.png", "video_file_path": "api-assets/id/1234.mp4"}` | +| `└─ image_file_path` | ✓ | Reference character image used as the replacement or animation target. This value is either - a direct URL to the file. The URL path must end in a supported file extension. - `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 file. The URL path must end in a supported file extension. - `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. | `5.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–30 seconds in `animate` mode or 3–10 seconds in `replace` mode. Picks the main person automatically, so `points` are rejected. * **`kling-4.0`**: 720p, 1080p. Clips of 3–30 seconds in `replace` mode. Picks the main person automatically, so `points` are rejected. * **`minimax-h3`**: 480p, 720p, 1080p. Clips of 1–60 seconds in `animate` mode or 1–30 seconds in `replace` mode. Subject `points` are `replace`-only; `animate` with `selection_mode` `point` returns 422, and with `auto` or no `selection_mode` the points are ignored. | `"wan-animate"` | +| `name` | ✗ | Give your video a custom name for easy identification. | `"My Character Replace video"` | +| `resolution` | ✗ | Output video resolution. Must be supported by `model`. Defaults to the lowest resolution available on your plan for that model. | `"480p"` | +| `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. Rejected for models without subject selection (supported by `wan-animate`, `minimax-h3`). `minimax-h3` subject `points` are `replace`-only; `animate` with `selection_mode` `point` returns 422, and with `auto` or no `selection_mode` the points are ignored. MiniMax H3 manual replacement accepts 1 to 10 points; each must satisfy `start_seconds <= time_seconds < end_seconds`. | `[{"position_x": 320, "position_y": 180, "time_seconds": 2.5}]` | +| `└─ prompt` | ✗ | Optional direction. Supported by kling-3.0, kling-4.0, minimax-h3. For MiniMax H3 in replace mode, ignored and not saved when `selection_mode` is `point`; applies only to automatic person selection. | `"string"` | +| `└─ 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`, `minimax-h3`. `minimax-h3` subject `points` are `replace`-only; `animate` with `selection_mode` `point` returns 422, and with `auto` or no `selection_mode` the points are ignored. Defaults to `auto`. | `"auto"` | #### Synchronous Client diff --git a/magic_hour/resources/v1/character_replace/client.py b/magic_hour/resources/v1/character_replace/client.py index f55de13..9c319ea 100644 --- a/magic_hour/resources/v1/character_replace/client.py +++ b/magic_hour/resources/v1/character_replace/client.py @@ -135,7 +135,9 @@ def create( end_seconds: float, model: typing.Union[ typing.Optional[ - typing_extensions.Literal["kling-3.0", "minimax-h3", "wan-animate"] + typing_extensions.Literal[ + "kling-3.0", "kling-4.0", "minimax-h3", "wan-animate" + ] ], type_utils.NotGiven, ] = type_utils.NOT_GIVEN, @@ -187,8 +189,9 @@ def create( 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. - * **`minimax-h3`**: 480p, 720p, 1080p. Clips of 1–30 seconds in `replace` mode or 1–60 seconds in `animate` mode. Subject `points` are `replace`-only; `animate` with `selection_mode` `point` returns 422, and with `auto` or no `selection_mode` the points are ignored. + * **`kling-3.0`**: 720p, 1080p. Clips of 3–30 seconds in `animate` mode or 3–10 seconds in `replace` mode. Picks the main person automatically, so `points` are rejected. + * **`kling-4.0`**: 720p, 1080p. Clips of 3–30 seconds in `replace` mode. Picks the main person automatically, so `points` are rejected. + * **`minimax-h3`**: 480p, 720p, 1080p. Clips of 1–60 seconds in `animate` mode or 1–30 seconds in `replace` mode. Subject `points` are `replace`-only; `animate` with `selection_mode` `point` returns 422, and with `auto` or no `selection_mode` the points are ignored. name: Give your video a custom name for easy identification. 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. @@ -356,7 +359,9 @@ async def create( end_seconds: float, model: typing.Union[ typing.Optional[ - typing_extensions.Literal["kling-3.0", "minimax-h3", "wan-animate"] + typing_extensions.Literal[ + "kling-3.0", "kling-4.0", "minimax-h3", "wan-animate" + ] ], type_utils.NotGiven, ] = type_utils.NOT_GIVEN, @@ -408,8 +413,9 @@ async def create( 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. - * **`minimax-h3`**: 480p, 720p, 1080p. Clips of 1–30 seconds in `replace` mode or 1–60 seconds in `animate` mode. Subject `points` are `replace`-only; `animate` with `selection_mode` `point` returns 422, and with `auto` or no `selection_mode` the points are ignored. + * **`kling-3.0`**: 720p, 1080p. Clips of 3–30 seconds in `animate` mode or 3–10 seconds in `replace` mode. Picks the main person automatically, so `points` are rejected. + * **`kling-4.0`**: 720p, 1080p. Clips of 3–30 seconds in `replace` mode. Picks the main person automatically, so `points` are rejected. + * **`minimax-h3`**: 480p, 720p, 1080p. Clips of 1–60 seconds in `animate` mode or 1–30 seconds in `replace` mode. Subject `points` are `replace`-only; `animate` with `selection_mode` `point` returns 422, and with `auto` or no `selection_mode` the points are ignored. name: Give your video a custom name for easy identification. 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. 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 3fe0f7f..9ce95b8 100644 --- a/magic_hour/types/params/v1_character_replace_create_body.py +++ b/magic_hour/types/params/v1_character_replace_create_body.py @@ -28,14 +28,15 @@ class V1CharacterReplaceCreateBody(typing_extensions.TypedDict): """ model: typing_extensions.NotRequired[ - typing_extensions.Literal["kling-3.0", "minimax-h3", "wan-animate"] + typing_extensions.Literal["kling-3.0", "kling-4.0", "minimax-h3", "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. - * **`minimax-h3`**: 480p, 720p, 1080p. Clips of 1–30 seconds in `replace` mode or 1–60 seconds in `animate` mode. Subject `points` are `replace`-only; `animate` with `selection_mode` `point` returns 422, and with `auto` or no `selection_mode` the points are ignored. + * **`kling-3.0`**: 720p, 1080p. Clips of 3–30 seconds in `animate` mode or 3–10 seconds in `replace` mode. Picks the main person automatically, so `points` are rejected. + * **`kling-4.0`**: 720p, 1080p. Clips of 3–30 seconds in `replace` mode. Picks the main person automatically, so `points` are rejected. + * **`minimax-h3`**: 480p, 720p, 1080p. Clips of 1–60 seconds in `animate` mode or 1–30 seconds in `replace` mode. Subject `points` are `replace`-only; `animate` with `selection_mode` `point` returns 422, and with `auto` or no `selection_mode` the points are ignored. """ name: typing_extensions.NotRequired[str] @@ -78,7 +79,7 @@ class _SerializerV1CharacterReplaceCreateBody(pydantic.BaseModel): alias="end_seconds", ) model: typing.Optional[ - typing_extensions.Literal["kling-3.0", "minimax-h3", "wan-animate"] + typing_extensions.Literal["kling-3.0", "kling-4.0", "minimax-h3", "wan-animate"] ] = pydantic.Field(alias="model", default=None) name: typing.Optional[str] = pydantic.Field(alias="name", default=None) resolution: typing.Optional[typing_extensions.Literal["1080p", "480p", "720p"]] = ( 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 59c8c98..8aaf428 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 @@ -27,7 +27,7 @@ class V1CharacterReplaceCreateBodyStyle(typing_extensions.TypedDict): prompt: typing_extensions.NotRequired[str] """ - Optional direction. Supported by kling-3.0, minimax-h3. For MiniMax H3 in replace mode, ignored and not saved when `selection_mode` is `point`; applies only to automatic person selection. + Optional direction. Supported by kling-3.0, kling-4.0, minimax-h3. For MiniMax H3 in replace mode, ignored and not saved when `selection_mode` is `point`; applies only to automatic person selection. """ selection_mode: typing_extensions.NotRequired[ diff --git a/pyproject.toml b/pyproject.toml index 25882c5..101e427 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "magic_hour" -version = "0.99.0" +version = "0.100.0" description = "Python SDK for Magic Hour API" readme = "README.md" authors = ["Magic Hour "] From 46165c8d214fcb699b2950ab6c5d32445a810c01 Mon Sep 17 00:00:00 2001 From: David Hu Date: Fri, 20 Nov 2026 06:48:50 +0000 Subject: [PATCH 2/2] fix: add kling-4.0 to character_replace generate() model param Co-Authored-By: Claude Opus 5.5 --- magic_hour/resources/v1/character_replace/client.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/magic_hour/resources/v1/character_replace/client.py b/magic_hour/resources/v1/character_replace/client.py index 9c319ea..4dbca59 100644 --- a/magic_hour/resources/v1/character_replace/client.py +++ b/magic_hour/resources/v1/character_replace/client.py @@ -46,7 +46,9 @@ def generate( ] = type_utils.NOT_GIVEN, model: typing.Union[ typing.Optional[ - typing_extensions.Literal["kling-3.0", "minimax-h3", "wan-animate"] + typing_extensions.Literal[ + "kling-3.0", "kling-4.0", "minimax-h3", "wan-animate" + ] ], type_utils.NotGiven, ] = type_utils.NOT_GIVEN, @@ -270,7 +272,9 @@ async def generate( ] = type_utils.NOT_GIVEN, model: typing.Union[ typing.Optional[ - typing_extensions.Literal["kling-3.0", "minimax-h3", "wan-animate"] + typing_extensions.Literal[ + "kling-3.0", "kling-4.0", "minimax-h3", "wan-animate" + ] ], type_utils.NotGiven, ] = type_utils.NOT_GIVEN,