Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .sdk.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"id": "79b6b8f9-cd15-4aec-ac0f-cd16313a0353",
"id": "c90fe09f-b516-4af0-b41b-381e051eba94",
"tracked_paths": [
{
"editable": true,
Expand Down
2 changes: 1 addition & 1 deletion magic_hour/environment.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.55.1"
MOCK_SERVER = "https://api.sideko.dev/v1/mock/magichour/magic-hour/0.56.0"


def _get_base_url(
Expand Down
41 changes: 24 additions & 17 deletions magic_hour/resources/v1/image_to_video/README.md

Large diffs are not rendered by default.

10 changes: 8 additions & 2 deletions magic_hour/resources/v1/image_to_video/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,10 @@ def create(
Examples:
```py
client.v1.image_to_video.create(
assets={"image_file_path": "api-assets/id/1234.png"},
assets={
"end_image_file_path": "api-assets/id/1234.png",
"image_file_path": "api-assets/id/1234.png",
},
end_seconds=5.0,
audio=True,
model="kling-2.5-audio",
Expand Down Expand Up @@ -558,7 +561,10 @@ async def create(
Examples:
```py
await client.v1.image_to_video.create(
assets={"image_file_path": "api-assets/id/1234.png"},
assets={
"end_image_file_path": "api-assets/id/1234.png",
"image_file_path": "api-assets/id/1234.png",
},
end_seconds=5.0,
audio=True,
model="kling-2.5-audio",
Expand Down
19 changes: 19 additions & 0 deletions magic_hour/types/params/v1_image_to_video_create_body_assets.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import pydantic
import typing
import typing_extensions


Expand All @@ -7,6 +8,21 @@ class V1ImageToVideoCreateBodyAssets(typing_extensions.TypedDict):
Provide the assets for image-to-video. Sora 2 only supports images with an aspect ratio of `9:16` or `16:9`.
"""

end_image_file_path: typing_extensions.NotRequired[str]
"""
The image to use as the last frame of the video.

* **`ltx-2`**: Not supported
* **`seedance`**: Supports 480p, 720p, 1080p.
* **`kling-2.5`**: Supports 1080p.
* **`kling-3.0`**: Supports 1080p.
* **`sora-2`**: Not supported
* **`veo3.1`**: Not supported

Legacy models:
* **`kling-1.6`**: Not supported
"""

image_file_path: typing_extensions.Required[str]
"""
The path of the image file. This value is either
Expand All @@ -28,6 +44,9 @@ class _SerializerV1ImageToVideoCreateBodyAssets(pydantic.BaseModel):
populate_by_name=True,
)

end_image_file_path: typing.Optional[str] = pydantic.Field(
alias="end_image_file_path", default=None
)
image_file_path: str = pydantic.Field(
alias="image_file_path",
)
17 changes: 17 additions & 0 deletions magic_hour/types/params/v1_image_to_video_generate_body_assets.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,23 @@ class V1ImageToVideoGenerateBodyAssets(typing_extensions.TypedDict):
Provide the assets for image-to-video.
"""

end_image_file_path: typing_extensions.NotRequired[str]
"""
The path of the image to use as the last frame of the video. This value is either
- a direct URL to the image file
- a path to a local file

* **`ltx-2`**: Not supported
* **`seedance`**: Supports 480p, 720p, 1080p.
* **`kling-2.5`**: Supports 1080p.
* **`kling-3.0`**: Supports 1080p.
* **`sora-2`**: Not supported
* **`veo3.1`**: Not supported

Legacy models:
* **`kling-1.6`**: Not supported
"""

image_file_path: typing_extensions.Required[str]
"""
The path of the image file. This value is either
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "magic_hour"
version = "0.55.1"
version = "0.56.0"
description = "Python SDK for Magic Hour API"
readme = "README.md"
authors = []
Expand Down
10 changes: 8 additions & 2 deletions tests/test_v1_image_to_video_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,10 @@ def test_create_200_success_all_params() -> None:
# tests calling sync method with example data
client = Client(token="API_TOKEN", environment=Environment.MOCK_SERVER)
response = client.v1.image_to_video.create(
assets={"image_file_path": "api-assets/id/1234.png"},
assets={
"end_image_file_path": "api-assets/id/1234.png",
"image_file_path": "api-assets/id/1234.png",
},
end_seconds=5.0,
audio=True,
height=123,
Expand Down Expand Up @@ -73,7 +76,10 @@ async def test_await_create_200_success_all_params() -> None:
# tests calling async method with example data
client = AsyncClient(token="API_TOKEN", environment=Environment.MOCK_SERVER)
response = await client.v1.image_to_video.create(
assets={"image_file_path": "api-assets/id/1234.png"},
assets={
"end_image_file_path": "api-assets/id/1234.png",
"image_file_path": "api-assets/id/1234.png",
},
end_seconds=5.0,
audio=True,
height=123,
Expand Down
Loading