diff --git a/.sdk.json b/.sdk.json index 39e8f88..95504eb 100644 --- a/.sdk.json +++ b/.sdk.json @@ -1,5 +1,5 @@ { - "id": "0270e04f-dd51-4f01-9578-99d683c4ee44", + "id": "2db416fc-d566-4b6b-a6a2-d7d8e5e2be0e", "tracked_paths": [ { "editable": true, @@ -197,6 +197,18 @@ "editable": true, "path": "magic_hour/resources/v1/audio_projects/client.py" }, + { + "editable": true, + "path": "magic_hour/resources/v1/audio_to_video/README.md" + }, + { + "editable": true, + "path": "magic_hour/resources/v1/audio_to_video/__init__.py" + }, + { + "editable": true, + "path": "magic_hour/resources/v1/audio_to_video/client.py" + }, { "editable": true, "path": "magic_hour/resources/v1/auto_subtitle_generator/README.md" @@ -461,6 +473,10 @@ "editable": false, "path": "magic_hour/types/models/v1_audio_projects_get_response_error.py" }, + { + "editable": false, + "path": "magic_hour/types/models/v1_audio_to_video_create_response.py" + }, { "editable": false, "path": "magic_hour/types/models/v1_auto_subtitle_generator_create_response.py" @@ -689,6 +705,18 @@ "editable": false, "path": "magic_hour/types/params/v1_animation_create_body_style.py" }, + { + "editable": false, + "path": "magic_hour/types/params/v1_audio_to_video_create_body.py" + }, + { + "editable": false, + "path": "magic_hour/types/params/v1_audio_to_video_create_body_assets.py" + }, + { + "editable": false, + "path": "magic_hour/types/params/v1_audio_to_video_create_body_style.py" + }, { "editable": false, "path": "magic_hour/types/params/v1_auto_subtitle_generator_create_body.py" @@ -885,6 +913,10 @@ "editable": false, "path": "tests/test_v1_audio_projects_client.py" }, + { + "editable": false, + "path": "tests/test_v1_audio_to_video_client.py" + }, { "editable": false, "path": "tests/test_v1_auto_subtitle_generator_client.py" diff --git a/README.md b/README.md index 9996b3a..3641684 100644 --- a/README.md +++ b/README.md @@ -233,6 +233,10 @@ download_urls = result.downloads - [delete](magic_hour/resources/v1/audio_projects/README.md#delete) - Delete audio - [get](magic_hour/resources/v1/audio_projects/README.md#get) - Get audio details +### [v1.audio_to_video](magic_hour/resources/v1/audio_to_video/README.md) + +- [create](magic_hour/resources/v1/audio_to_video/README.md#create) - Audio-to-Video + ### [v1.auto_subtitle_generator](magic_hour/resources/v1/auto_subtitle_generator/README.md) - [create](magic_hour/resources/v1/auto_subtitle_generator/README.md#create) - Auto Subtitle Generator diff --git a/magic_hour/README.md b/magic_hour/README.md index f3746b6..51345ff 100644 --- a/magic_hour/README.md +++ b/magic_hour/README.md @@ -16,6 +16,7 @@ - [ai_voice_generator](resources/v1/ai_voice_generator/README.md) - ai_voice_generator - [animation](resources/v1/animation/README.md) - animation - [audio_projects](resources/v1/audio_projects/README.md) - audio_projects +- [audio_to_video](resources/v1/audio_to_video/README.md) - audio_to_video - [auto_subtitle_generator](resources/v1/auto_subtitle_generator/README.md) - auto_subtitle_generator - [body_swap](resources/v1/body_swap/README.md) - body_swap - [face_detection](resources/v1/face_detection/README.md) - face_detection diff --git a/magic_hour/environment.py b/magic_hour/environment.py index feec9a0..a33601c 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.63.0" + MOCK_SERVER = "https://api.sideko.dev/v1/mock/magichour/magic-hour/0.64.0" def _get_base_url( diff --git a/magic_hour/resources/v1/README.md b/magic_hour/resources/v1/README.md index eb6ab8e..45cfed3 100644 --- a/magic_hour/resources/v1/README.md +++ b/magic_hour/resources/v1/README.md @@ -16,6 +16,7 @@ - [ai_voice_generator](ai_voice_generator/README.md) - ai_voice_generator - [animation](animation/README.md) - animation - [audio_projects](audio_projects/README.md) - audio_projects +- [audio_to_video](audio_to_video/README.md) - audio_to_video - [auto_subtitle_generator](auto_subtitle_generator/README.md) - auto_subtitle_generator - [body_swap](body_swap/README.md) - body_swap - [face_detection](face_detection/README.md) - face_detection diff --git a/magic_hour/resources/v1/ai_image_editor/README.md b/magic_hour/resources/v1/ai_image_editor/README.md index 17c0205..e197a59 100644 --- a/magic_hour/resources/v1/ai_image_editor/README.md +++ b/magic_hour/resources/v1/ai_image_editor/README.md @@ -68,19 +68,19 @@ Edit images with AI. #### Parameters -| Parameter | Required | Description | Example | -| --------------------- | :------: | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | -| `assets` | ✓ | Provide the assets for image edit | `{"image_file_paths": ["api-assets/id/1234.png", "api-assets/id/1235.png"]}` | -| `└─ image_file_path` | ✗ | Deprecated: Please use `image_file_paths` instead as edits with multiple images are now supported. The image used in the 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. | `"string"` | -| `└─ image_file_paths` | ✗ | The image(s) used in the edit, maximum of 10 images. 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.png", "api-assets/id/1235.png"]` | -| `style` | ✓ | | `{"prompt": "Give me sunglasses"}` | -| `└─ model` | ✗ | Deprecated: Please use `model` instead. The AI model to use for image editing. * `Nano Banana` - Precise, realistic edits with consistent results * `Seedream` - Creative, imaginative images with artistic freedom * `default` - Use the model we recommend, which will change over time. This is recommended unless you need a specific model. This is the default behavior. | `"Nano Banana"` | -| `└─ prompt` | ✓ | The prompt used to edit the image. | `"Give me sunglasses"` | -| `aspect_ratio` | ✗ | The aspect ratio of the output image(s). If not specified, defaults to `auto`. | `"1:1"` | -| `image_count` | ✗ | Number of images to generate. Maximum varies by model. Defaults to 1 if not specified. | `1.0` | -| `model` | ✗ | The AI model to use for image editing. Each model has different capabilities and costs. **Models:** - `default` - Use the model we recommend, which will change over time. This is recommended unless you need a specific model. This is the default behavior. - `qwen-edit` - from 10 credits/image - Supported resolutions: 640px, 1k, 2k - Available for tiers: free, creator, pro, business - Max additional input images: 2 - `nano-banana` - from 50 credits/image - Supported resolutions: 640px, 1k - Available for tiers: free, creator, pro, business - Max additional input images: 9 - `nano-banana-2` - from 100 credits/image - Supported resolutions: 640px, 1k, 2k, 4k - Available for tiers: free, creator, pro, business - Max additional input images: 9 - `seedream-v4` - from 40 credits/image - Supported resolutions: 640px, 1k, 2k, 4k - Available for tiers: free, creator, pro, business - Max additional input images: 9 - `nano-banana-pro` - from 150 credits/image - Supported resolutions: 1k, 2k, 4k - Available for tiers: creator, pro, business - Max additional input images: 9 - `seedream-v4.5` - from 50 credits/image - Supported resolutions: 640px, 1k, 2k, 4k - Available for tiers: creator, pro, business - Max additional input images: 9 - `gpt-image-2` - from 50 credits/image - Supported resolutions: 640px, 1k, 2k, 4k - Available for tiers: creator, pro, business - Max additional input images: 9 | `"default"` | -| `name` | ✗ | Give your image a custom name for easy identification. | `"My Ai Image Editor image"` | -| `resolution` | ✗ | Maximum resolution (longest edge) for the output image. **Options:** - `640px` — up to 640px - `1k` — up to 1024px - `2k` — up to 2048px - `4k` — up to 4096px - `auto` — **Deprecated.** Mapped server-side from your subscription tier to the best matching resolution the model supports **Per-model support:** - `qwen-edit` - 640px, 1k, 2k - `nano-banana` - 640px, 1k - `nano-banana-2` - 640px, 1k, 2k, 4k - `seedream-v4` - 640px, 1k, 2k, 4k - `nano-banana-pro` - 1k, 2k, 4k - `seedream-v4.5` - 640px, 1k, 2k, 4k - `gpt-image-2` - 640px, 1k, 2k, 4k Note: Resolution availability depends on the model and your subscription tier. | `"1k"` | +| Parameter | Required | Description | Example | +| --------------------- | :------: | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | +| `assets` | ✓ | Provide the assets for image edit | `{"image_file_paths": ["api-assets/id/1234.png", "api-assets/id/1235.png"]}` | +| `└─ image_file_path` | ✗ | Deprecated: Please use `image_file_paths` instead as edits with multiple images are now supported. The image used in the 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. | `"string"` | +| `└─ image_file_paths` | ✗ | The image(s) used in the edit, maximum of 10 images. 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.png", "api-assets/id/1235.png"]` | +| `style` | ✓ | | `{"prompt": "Give me sunglasses"}` | +| `└─ model` | ✗ | Deprecated: Please use `model` instead. The AI model to use for image editing. * `Nano Banana` - Precise, realistic edits with consistent results * `Seedream` - Creative, imaginative images with artistic freedom * `default` - Use the model we recommend, which will change over time. This is recommended unless you need a specific model. This is the default behavior. | `"Nano Banana"` | +| `└─ prompt` | ✓ | The prompt used to edit the image. | `"Give me sunglasses"` | +| `aspect_ratio` | ✗ | The aspect ratio of the output image(s). If not specified, defaults to `auto`. | `"1:1"` | +| `image_count` | ✗ | Number of images to generate. Maximum varies by model. Defaults to 1 if not specified. | `1.0` | +| `model` | ✗ | The AI model to use for image editing. Each model has different capabilities and costs. **Models:** - `default` - Use the model we recommend, which will change over time. This is recommended unless you need a specific model. This is the default behavior. - `qwen-edit` - from 10 credits/image - Supported resolutions: 640px, 1k, 2k - Available for tiers: free, creator, pro, business - Max additional input images: 2 - `nano-banana` - from 50 credits/image - Supported resolutions: 640px, 1k - Available for tiers: creator, pro, business - Max additional input images: 9 - `nano-banana-2` - from 100 credits/image - Supported resolutions: 640px, 1k, 2k, 4k - Available for tiers: creator, pro, business - Max additional input images: 9 - `seedream-v4` - from 40 credits/image - Supported resolutions: 640px, 1k, 2k, 4k - Available for tiers: creator, pro, business - Max additional input images: 9 - `nano-banana-pro` - from 150 credits/image - Supported resolutions: 1k, 2k, 4k - Available for tiers: creator, pro, business - Max additional input images: 9 - `seedream-v4.5` - from 50 credits/image - Supported resolutions: 640px, 1k, 2k, 4k - Available for tiers: creator, pro, business - Max additional input images: 9 - `gpt-image-2` - from 50 credits/image - Supported resolutions: 640px, 1k, 2k, 4k - Available for tiers: creator, pro, business - Max additional input images: 9 | `"default"` | +| `name` | ✗ | Give your image a custom name for easy identification. | `"My Ai Image Editor image"` | +| `resolution` | ✗ | Maximum resolution (longest edge) for the output image. **Options:** - `640px` — up to 640px - `1k` — up to 1024px - `2k` — up to 2048px - `4k` — up to 4096px - `auto` — **Deprecated.** Mapped server-side from your subscription tier to the best matching resolution the model supports **Per-model support:** - `qwen-edit` - 640px, 1k, 2k - `nano-banana` - 640px, 1k - `nano-banana-2` - 640px, 1k, 2k, 4k - `seedream-v4` - 640px, 1k, 2k, 4k - `nano-banana-pro` - 1k, 2k, 4k - `seedream-v4.5` - 640px, 1k, 2k, 4k - `gpt-image-2` - 640px, 1k, 2k, 4k Note: Resolution availability depends on the model and your subscription tier. | `"1k"` | #### Synchronous Client diff --git a/magic_hour/resources/v1/ai_image_editor/client.py b/magic_hour/resources/v1/ai_image_editor/client.py index 1fdd9c8..82514b9 100644 --- a/magic_hour/resources/v1/ai_image_editor/client.py +++ b/magic_hour/resources/v1/ai_image_editor/client.py @@ -193,15 +193,15 @@ def create( - Max additional input images: 2 - `nano-banana` - from 50 credits/image - Supported resolutions: 640px, 1k - - Available for tiers: free, creator, pro, business + - Available for tiers: creator, pro, business - Max additional input images: 9 - `nano-banana-2` - from 100 credits/image - Supported resolutions: 640px, 1k, 2k, 4k - - Available for tiers: free, creator, pro, business + - Available for tiers: creator, pro, business - Max additional input images: 9 - `seedream-v4` - from 40 credits/image - Supported resolutions: 640px, 1k, 2k, 4k - - Available for tiers: free, creator, pro, business + - Available for tiers: creator, pro, business - Max additional input images: 9 - `nano-banana-pro` - from 150 credits/image - Supported resolutions: 1k, 2k, 4k @@ -458,15 +458,15 @@ async def create( - Max additional input images: 2 - `nano-banana` - from 50 credits/image - Supported resolutions: 640px, 1k - - Available for tiers: free, creator, pro, business + - Available for tiers: creator, pro, business - Max additional input images: 9 - `nano-banana-2` - from 100 credits/image - Supported resolutions: 640px, 1k, 2k, 4k - - Available for tiers: free, creator, pro, business + - Available for tiers: creator, pro, business - Max additional input images: 9 - `seedream-v4` - from 40 credits/image - Supported resolutions: 640px, 1k, 2k, 4k - - Available for tiers: free, creator, pro, business + - Available for tiers: creator, pro, business - Max additional input images: 9 - `nano-banana-pro` - from 150 credits/image - Supported resolutions: 1k, 2k, 4k diff --git a/magic_hour/resources/v1/ai_image_generator/README.md b/magic_hour/resources/v1/ai_image_generator/README.md index fd326d2..0ff6c6c 100644 --- a/magic_hour/resources/v1/ai_image_generator/README.md +++ b/magic_hour/resources/v1/ai_image_generator/README.md @@ -75,18 +75,18 @@ Create an AI image with advanced model selection and quality controls. #### Parameters -| Parameter | Required | Deprecated | Description | Example | -| ----------------- | :------: | :--------: | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------- | -| `image_count` | ✓ | ✗ | Number of images to generate. Maximum varies by model. | `1` | -| `style` | ✓ | ✗ | The art style to use for image generation. | `{"prompt": "Cool image", "tool": "ai-anime-generator"}` | -| `└─ prompt` | ✓ | — | The prompt used for the image(s). | `"Cool image"` | -| `└─ quality_mode` | ✗ | ✓ | DEPRECATED: Use `model` field instead for explicit model selection. Legacy quality mode mapping: - `standard` → `z-image-turbo` model - `pro` → `seedream-v4` model If model is specified, it will take precedence over the legacy quality_mode field. | `"pro"` | -| `└─ tool` | ✗ | — | The art style to use for image generation. Defaults to 'general' if not provided. | `"ai-anime-generator"` | -| `aspect_ratio` | ✗ | ✗ | The aspect ratio of the output image(s). If not specified, defaults to `1:1` (square). | `"1:1"` | -| `model` | ✗ | ✗ | The AI model to use for image generation. Each model has different capabilities and costs. **Models:** - `default` - Use the model we recommend, which will change over time. This is recommended unless you need a specific model. This is the default behavior. - `flux-schnell` - from 5 credits/image - Supported resolutions: 640px, 1k, 2k - Available for tiers: free, creator, pro, business - Image count allowed: 1, 2, 3, 4 - `z-image-turbo` - from 5 credits/image - Supported resolutions: 640px, 1k, 2k - Available for tiers: free, creator, pro, business - Image count allowed: 1, 2, 3, 4 - `seedream-v4` - from 40 credits/image - Supported resolutions: 640px, 1k, 2k, 4k - Available for tiers: free, creator, pro, business - Image count allowed: 1, 2, 3, 4 - `nano-banana` - from 50 credits/image - Supported resolutions: 640px, 1k - Available for tiers: free, creator, pro, business - Image count allowed: 1, 2, 3, 4 - `nano-banana-2` - from 100 credits/image - Supported resolutions: 640px, 1k, 2k, 4k - Available for tiers: free, creator, pro, business - Image count allowed: 1, 4, 9, 16 - `nano-banana-pro` - from 150 credits/image - Supported resolutions: 1k, 2k, 4k - Available for tiers: creator, pro, business - Image count allowed: 1, 4, 9, 16 - `gpt-image-2` - from 50 credits/image - Supported resolutions: 640px, 1k, 2k, 4k - Available for tiers: creator, pro, business - Image count allowed: 1, 2, 3, 4 **Deprecated Enum Values:** - `seedream` - Use `seedream-v4` instead. | `"default"` | -| `name` | ✗ | ✗ | Give your image a custom name for easy identification. | `"My Ai Image image"` | -| `orientation` | ✗ | ✓ | DEPRECATED: Use `aspect_ratio` instead. The orientation of the output image(s). `aspect_ratio` takes precedence when `orientation` if both are provided. | `"landscape"` | -| `resolution` | ✗ | ✗ | Maximum resolution (longest edge) for the output image. **Options:** - `640px` — up to 640px - `1k` — up to 1024px - `2k` — up to 2048px - `4k` — up to 4096px - `auto` — **Deprecated.** Mapped server-side from your subscription tier to the best matching resolution the model supports **Per-model support:** - `flux-schnell` - 640px, 1k, 2k - `z-image-turbo` - 640px, 1k, 2k - `seedream-v4` - 640px, 1k, 2k, 4k - `nano-banana` - 640px, 1k - `nano-banana-2` - 640px, 1k, 2k, 4k - `nano-banana-pro` - 1k, 2k, 4k - `gpt-image-2` - 640px, 1k, 2k, 4k Note: Resolution availability depends on the model and your subscription tier. | `"auto"` | +| Parameter | Required | Deprecated | Description | Example | +| ----------------- | :------: | :--------: | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------- | +| `image_count` | ✓ | ✗ | Number of images to generate. Maximum varies by model. | `1` | +| `style` | ✓ | ✗ | The art style to use for image generation. | `{"prompt": "Cool image", "tool": "ai-anime-generator"}` | +| `└─ prompt` | ✓ | — | The prompt used for the image(s). | `"Cool image"` | +| `└─ quality_mode` | ✗ | ✓ | DEPRECATED: Use `model` field instead for explicit model selection. Legacy quality mode mapping: - `standard` → `z-image-turbo` model - `pro` → `seedream-v4` model If model is specified, it will take precedence over the legacy quality_mode field. | `"pro"` | +| `└─ tool` | ✗ | — | The art style to use for image generation. Defaults to 'general' if not provided. | `"ai-anime-generator"` | +| `aspect_ratio` | ✗ | ✗ | The aspect ratio of the output image(s). If not specified, defaults to `1:1` (square). | `"1:1"` | +| `model` | ✗ | ✗ | The AI model to use for image generation. Each model has different capabilities and costs. **Models:** - `default` - Use the model we recommend, which will change over time. This is recommended unless you need a specific model. This is the default behavior. - `flux-schnell` - from 5 credits/image - Supported resolutions: 640px, 1k, 2k - Available for tiers: free, creator, pro, business - Image count allowed: 1, 2, 3, 4 - `z-image-turbo` - from 5 credits/image - Supported resolutions: 640px, 1k, 2k - Available for tiers: free, creator, pro, business - Image count allowed: 1, 2, 3, 4 - `seedream-v4` - from 40 credits/image - Supported resolutions: 640px, 1k, 2k, 4k - Available for tiers: creator, pro, business - Image count allowed: 1, 2, 3, 4 - `nano-banana` - from 50 credits/image - Supported resolutions: 640px, 1k - Available for tiers: creator, pro, business - Image count allowed: 1, 2, 3, 4 - `nano-banana-2` - from 100 credits/image - Supported resolutions: 640px, 1k, 2k, 4k - Available for tiers: creator, pro, business - Image count allowed: 1, 4, 9, 16 - `nano-banana-pro` - from 150 credits/image - Supported resolutions: 1k, 2k, 4k - Available for tiers: creator, pro, business - Image count allowed: 1, 4, 9, 16 - `gpt-image-2` - from 50 credits/image - Supported resolutions: 640px, 1k, 2k, 4k - Available for tiers: creator, pro, business - Image count allowed: 1, 2, 3, 4 **Deprecated Enum Values:** - `seedream` - Use `seedream-v4` instead. | `"default"` | +| `name` | ✗ | ✗ | Give your image a custom name for easy identification. | `"My Ai Image image"` | +| `orientation` | ✗ | ✓ | DEPRECATED: Use `aspect_ratio` instead. The orientation of the output image(s). `aspect_ratio` takes precedence when `orientation` if both are provided. | `"landscape"` | +| `resolution` | ✗ | ✗ | Maximum resolution (longest edge) for the output image. **Options:** - `640px` — up to 640px - `1k` — up to 1024px - `2k` — up to 2048px - `4k` — up to 4096px - `auto` — **Deprecated.** Mapped server-side from your subscription tier to the best matching resolution the model supports **Per-model support:** - `flux-schnell` - 640px, 1k, 2k - `z-image-turbo` - 640px, 1k, 2k - `seedream-v4` - 640px, 1k, 2k, 4k - `nano-banana` - 640px, 1k - `nano-banana-2` - 640px, 1k, 2k, 4k - `nano-banana-pro` - 1k, 2k, 4k - `gpt-image-2` - 640px, 1k, 2k, 4k Note: Resolution availability depends on the model and your subscription tier. | `"auto"` | #### Synchronous Client diff --git a/magic_hour/resources/v1/ai_image_generator/client.py b/magic_hour/resources/v1/ai_image_generator/client.py index 4ab004f..be2a45c 100644 --- a/magic_hour/resources/v1/ai_image_generator/client.py +++ b/magic_hour/resources/v1/ai_image_generator/client.py @@ -183,15 +183,15 @@ def create( - Image count allowed: 1, 2, 3, 4 - `seedream-v4` - from 40 credits/image - Supported resolutions: 640px, 1k, 2k, 4k - - Available for tiers: free, creator, pro, business + - Available for tiers: creator, pro, business - Image count allowed: 1, 2, 3, 4 - `nano-banana` - from 50 credits/image - Supported resolutions: 640px, 1k - - Available for tiers: free, creator, pro, business + - Available for tiers: creator, pro, business - Image count allowed: 1, 2, 3, 4 - `nano-banana-2` - from 100 credits/image - Supported resolutions: 640px, 1k, 2k, 4k - - Available for tiers: free, creator, pro, business + - Available for tiers: creator, pro, business - Image count allowed: 1, 4, 9, 16 - `nano-banana-pro` - from 150 credits/image - Supported resolutions: 1k, 2k, 4k @@ -430,15 +430,15 @@ async def create( - Image count allowed: 1, 2, 3, 4 - `seedream-v4` - from 40 credits/image - Supported resolutions: 640px, 1k, 2k, 4k - - Available for tiers: free, creator, pro, business + - Available for tiers: creator, pro, business - Image count allowed: 1, 2, 3, 4 - `nano-banana` - from 50 credits/image - Supported resolutions: 640px, 1k - - Available for tiers: free, creator, pro, business + - Available for tiers: creator, pro, business - Image count allowed: 1, 2, 3, 4 - `nano-banana-2` - from 100 credits/image - Supported resolutions: 640px, 1k, 2k, 4k - - Available for tiers: free, creator, pro, business + - Available for tiers: creator, pro, business - Image count allowed: 1, 4, 9, 16 - `nano-banana-pro` - from 150 credits/image - Supported resolutions: 1k, 2k, 4k diff --git a/magic_hour/resources/v1/ai_voice_generator/README.md b/magic_hour/resources/v1/ai_voice_generator/README.md index 2a71c5e..51a2ebf 100644 --- a/magic_hour/resources/v1/ai_voice_generator/README.md +++ b/magic_hour/resources/v1/ai_voice_generator/README.md @@ -66,12 +66,12 @@ Generate speech from text. Each character costs 0.05 credits. The cost is rounde #### Parameters -| Parameter | Required | Description | Example | -| --------------- | :------: | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------- | -| `style` | ✓ | The content used to generate speech. | `{"prompt": "Hello, how are you?", "voice_name": "Elon Musk"}` | -| `└─ prompt` | ✓ | Text used to generate speech. The character limit is 1000 characters. | `"Hello, how are you?"` | -| `└─ voice_name` | ✓ | The voice to use for the speech. Available voices: Elon Musk, Mark Zuckerberg, Joe Rogan, Barack Obama, Morgan Freeman, Kanye West, Donald Trump, Joe Biden, Kim Kardashian, Taylor Swift, James Earl Jones, Samuel L. Jackson, Jeff Goldblum, David Attenborough, Sean Connery, Cillian Murphy, Anne Hathaway, Julia Roberts, Natalie Portman, Steve Carell, Amy Poehler, Stephen Colbert, Jimmy Fallon, David Letterman, Alex Trebek, Katy Perry, Prince, Kevin Bacon, Tom Hiddleston, Adam Driver, Alan Rickman, Alexz Johnson, Ana Gasteyer, Andrew Rannells, Arden Cho, Bear Grylls, Ben McKenzie, Ben Stiller, Ben Whishaw, Billie Joe Armstrong, Bingbing Li, Booboo Stewart, Bradley Steven Perry, Bruno Mars, Caity Lotz, Cameron Boyce, Candice Accola, Carrie Underwood, Casey Affleck, Caterina Scorsone, Cedric the Entertainer, Chace Crawford, Chadwick Boseman, Charlie Day, Chris Hemsworth, Chris Martin, Christopher Mintz-Plasse, Dan Fogler, Dan Stevens, Daniel Dae Kim, Danielle Panabaker, Dave Bautista, David Schwimmer, Denis Leary, Derek Mears, Diego Luna, Donald Glover, Donnie Yen, Doutzen Kroes, Dove Cameron, Dr. Dre, Drake Bell, Elle Fanning, Ernie Hudson, Fergie, Forest Whitaker, Francia Raisa, Freddie Highmore, Gillian Jacobs, Gina Carano, Ginnifer Goodwin, Gordon Ramsay, Guy Pearce, Gwendoline Christie, Hailee Steinfeld, Howie Mandel, Hugh Jackman, Hugh Laurie, J. K. Simmons, Jack Black, Jared Leto, Jennifer Carpenter, Kesha, Kris Jenner, Kristen Bell, Lorde, Matt Smith, Marilyn Monroe, Charlie Chaplin, Albert Einstein, Abraham Lincoln, John F. Kennedy, Lucille Ball, A.R. Rahman, Aamir Khan, Ajay Devgn, Akshay Kumar, Alain Delon, Alan Alda, Alan Cumming, Amitabh Bachchan, Ang Lee, Ansel Elgort, Anthony Anderson, Anthony Mackie, Armie Hammer, Asa Butterfield, B.J. Novak, Barbara Eden, Betty White, Bill Nighy, Bill Pullman, Blake Shelton, Bonnie Wright, Brad Paisley, Brendan Gleeson, Brian Cox, Bruno Ganz, Burt Reynolds, Carrie Fisher, Charles Dance, Chiwetel Ejiofor, Chris Pine, Christina Hendricks, Christina Ricci, Cyndi Lauper, Dakota Fanning, Damian Lewis, Dan Aykroyd, Daniel Craig, David Oyelowo, David Tennant, Diane Keaton, Diane Kruger, Dick Van Dyke, Domhnall Gleeson, Dominic Cooper, Donald Sutherland, Drew Carey, Eartha Kitt, Eddie Izzard, Edward Asner, Eli Roth, Elisabeth Moss, Ellen Burstyn, Emile Hirsch, Ezra Miller, Felicity Jones, Fiona Shaw, Florence Henderson, Freida Pinto, Geena Davis, Gemma Arterton, Geri Halliwell, Glenn Close, Gloria Steinem, Greta Gerwig, Gugu Mbatha-Raw, Hans Zimmer, Harry Connick Jr., Harvey Keitel, Helena Bonham Carter, Henry Cavill, Hilary Swank, Hugh Bonneville, Idina Menzel, Imelda Staunton, Ingrid Bergman, Irrfan Khan, Isla Fisher, Iwan Rheon, Jack Lemmon, Janet Jackson, Jason Bateman, Jason Segel, Jennifer Coolidge, Johnny Galecki, Jon Favreau, Joseph Gordon-Levitt, Josh Brolin, Josh Gad, Josh Groban, Julia Louis-Dreyfus, Kristen Stewart, Kristen Wiig, Rooney Mara, Caitriona Balfe, J.J. Abrams, Zoe Saldana | `"Elon Musk"` | -| `name` | ✗ | Give your audio a custom name for easy identification. | `"My Voice Generator audio"` | +| Parameter | Required | Description | Example | +| --------------- | :------: | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------- | +| `style` | ✓ | The content used to generate speech. | `{"prompt": "Hello, how are you?", "voice_name": "Elon Musk"}` | +| `└─ prompt` | ✓ | Text used to generate speech. The character limit is 1000 characters. | `"Hello, how are you?"` | +| `└─ voice_name` | ✓ | The voice to use for the speech. Available voices: Elon Musk, Mark Zuckerberg, Joe Rogan, Barack Obama, Morgan Freeman, Kanye West, Donald Trump, Joe Biden, Kim Kardashian, Taylor Swift, James Earl Jones, Samuel L. Jackson, Jeff Goldblum, David Attenborough, Sean Connery, Cillian Murphy, Anne Hathaway, Julia Roberts, Natalie Portman, Steve Carell, Amy Poehler, Stephen Colbert, Jimmy Fallon, David Letterman, Alex Trebek, Katy Perry, Prince, Kevin Bacon, Tom Hiddleston, Adam Driver, Alan Rickman, Alexz Johnson, Ana Gasteyer, Andrew Rannells, Arden Cho, Bear Grylls, Ben McKenzie, Ben Stiller, Ben Whishaw, Billie Joe Armstrong, Bingbing Li, Booboo Stewart, Bradley Steven Perry, Bruno Mars, Caity Lotz, Cameron Boyce, Candice Accola, Carrie Underwood, Casey Affleck, Caterina Scorsone, Cedric the Entertainer, Chace Crawford, Chadwick Boseman, Charlie Day, Chris Hemsworth, Chris Martin, Christopher Mintz-Plasse, Dan Fogler, Dan Stevens, Daniel Dae Kim, Danielle Panabaker, Dave Bautista, David Schwimmer, Denis Leary, Derek Mears, Diego Luna, Donald Glover, Donnie Yen, Doutzen Kroes, Dove Cameron, Dr. Dre, Drake Bell, Elle Fanning, Ernie Hudson, Fergie, Forest Whitaker, Francia Raisa, Freddie Highmore, Gillian Jacobs, Gina Carano, Ginnifer Goodwin, Gordon Ramsay, Guy Pearce, Gwendoline Christie, Hailee Steinfeld, Howie Mandel, Hugh Jackman, Hugh Laurie, J. K. Simmons, Jack Black, Jared Leto, Jennifer Carpenter, Kesha, Kris Jenner, Kristen Bell, Lorde, Matt Smith, Marilyn Monroe, Charlie Chaplin, Albert Einstein, Abraham Lincoln, John F. Kennedy, Lucille Ball, A.R. Rahman, Aamir Khan, Ajay Devgn, Akshay Kumar, Alain Delon, Alan Alda, Alan Cumming, Amitabh Bachchan, Ang Lee, Ansel Elgort, Anthony Anderson, Anthony Mackie, Armie Hammer, Asa Butterfield, B.J. Novak, Barbara Eden, Betty White, Bill Nighy, Bill Pullman, Blake Shelton, Bonnie Wright, Brad Paisley, Brendan Gleeson, Brian Cox, Bruno Ganz, Burt Reynolds, Carrie Fisher, Charles Dance, Chiwetel Ejiofor, Chris Pine, Christina Hendricks, Christina Ricci, Cyndi Lauper, Dakota Fanning, Damian Lewis, Dan Aykroyd, Daniel Craig, David Oyelowo, David Tennant, Diane Keaton, Diane Kruger, Dick Van Dyke, Domhnall Gleeson, Dominic Cooper, Donald Sutherland, Drew Carey, Eartha Kitt, Eddie Izzard, Edward Asner, Eli Roth, Elisabeth Moss, Ellen Burstyn, Emile Hirsch, Ezra Miller, Felicity Jones, Fiona Shaw, Florence Henderson, Freida Pinto, Geena Davis, Gemma Arterton, Geri Halliwell, Glenn Close, Gloria Steinem, Greta Gerwig, Gugu Mbatha-Raw, Hans Zimmer, Harry Connick Jr., Harvey Keitel, Helena Bonham Carter, Henry Cavill, Hilary Swank, Hugh Bonneville, Idina Menzel, Imelda Staunton, Ingrid Bergman, Irrfan Khan, Isla Fisher, Iwan Rheon, Jack Lemmon, Janet Jackson, Jason Bateman, Jason Segel, Jennifer Coolidge, Johnny Galecki, Jon Favreau, Joseph Gordon-Levitt, Josh Brolin, Josh Gad, Josh Groban, Julia Louis-Dreyfus, Kristen Stewart, Kristen Wiig, Rooney Mara, Caitriona Balfe, J.J. Abrams, Zoe Saldana, SpongeBob SquarePants, Patrick Star, Squidward Tentacles, Homer Simpson, Bart Simpson, Peter Griffin, Stewie Griffin, Eric Cartman, Rick Sanchez, Bugs Bunny, Mickey Mouse, Donald Duck, Shrek, Donkey (Shrek), Elsa (Frozen), Woody (Toy Story), Buzz Lightyear, Scooby-Doo, Shaggy Rogers, Bender (Futurama), Optimus Prime, Batman (Animated), The Joker (Animated), Darth Vader, Yoda, Gollum Smeagol, Gandalf, Winnie the Pooh, Kermit the Frog, Elmo, SpiderMan (Tom Holland ver.), Mario, Luigi, Sonic the Hedgehog, Naruto Uzumaki, Goku, Vegeta, Light Yagami, Luffy (One Piece), Edward Elric, Eren Jaeger, Levi Ackerman, Tanjiro Kamado, All Might, GLaDOS, Master Chief, Kratos, Arthur Morgan, Geralt of Rivia, Dwayne 'The Rock' Johnson, LeBron James, Shaquille O'Neal, Conor McGregor, Mike Tyson, Kobe Bryant, Floyd Mayweather, Cristiano Ronaldo, Lionel Messi, Serena Williams, Tom Brady, Stephen Curry, John Cena, Hulk Hogan, Stone Cold Steve Austin, The Undertaker, Nate Diaz, Charles Barkley, Shannon Sharpe, Drake, Beyonce, Rihanna, Eminem, Snoop Dogg, Jay-Z, Ed Sheeran, Billie Eilish, Ariana Grande, Adele, Post Malone, Travis Scott, Nicki Minaj, Cardi B, Doja Cat, Bad Bunny, Shakira, Justin Bieber, Sabrina Carpenter, Chappell Roan, Dua Lipa, The Weeknd, Miley Cyrus, Lady Gaga, Kendrick Lamar, Ozzy Osbourne, Freddie Mercury, Elvis Presley, Bob Marley, Frank Sinatra, MrBeast, PewDiePie, Kai Cenat, IShowSpeed, Markiplier, Jacksepticeye, KSI, Logan Paul, Jake Paul, Dream (Minecraft), Corpse Husband, xQc, Pokimane, Valkyrae, Ninja, Joe Scott, Linus (LTT), Ryan Reynolds, Tom Hanks, Robert Downey Jr., Will Smith, Denzel Washington, Leonardo DiCaprio, Brad Pitt, Keanu Reeves, Nicolas Cage, Al Pacino, Robert De Niro, Arnold Schwarzenegger, Sylvester Stallone, Vin Diesel, Jason Statham, Tom Cruise, Johnny Depp, Scarlett Johansson, Angelina Jolie, Jennifer Aniston, Emma Watson, Margot Robbie, Sydney Sweeney, Zendaya, Timothee Chalamet, Pedro Pascal, Oscar Isaac, Benedict Cumberbatch, Ian McKellen, Patrick Stewart, Christopher Walken, Matthew McConaughey, Harrison Ford, Mark Wahlberg, Owen Wilson, Seth Rogen, Kevin Hart, Adam Sandler, Jim Carrey, Eddie Murphy, Robin Williams, Will Ferrell, Melissa McCarthy, Awkwafina, Jason Momoa, Idris Elba, Tom Hardy, Michael B. Jordan, Austin Butler, Glen Powell, Paul Giamatti, Bryan Cranston, Bob Odenkirk, Vladimir Putin, Queen Elizabeth II, Winston Churchill, Martin Luther King Jr., Kamala Harris, Bernie Sanders, Alexandria Ocasio-Cortez, Narendra Modi, Oprah Winfrey, Ellen DeGeneres, Dr. Phil, Steve Harvey, Trevor Noah, John Oliver, James Corden, Ryan Seacrest, Howard Stern, Conan O'Brien, Seth Meyers, Bill Nye, Neil deGrasse Tyson, Guy Fieri, Dave Chappelle, Chris Rock, Jerry Seinfeld, Ali Wong, John Mulaney, Hasan Minhaj, Nikki Glaser, Matt Rife, Gabriel Iglesias, Bo Burnham, Jeff Bezos, Bill Gates, Steve Jobs, Tim Cook, Sam Altman, Jensen Huang, Gilbert Gottfried, James May, Jeremy Clarkson, Richard Hammond, Bob Ross, Anthony Bourdain, David Goggins, Jordan Peterson, Joe Pesci, Danny DeVito, Seth MacFarlane, Patrick Warburton, Keith David, Mark Hamill, Liam Neeson, Antonio Banderas, Sofia Vergara, Penelope Cruz, Gal Gadot, Cate Blanchett, Viola Davis, Meryl Streep, Sandra Bullock, Reese Witherspoon, Salma Hayek, Lupita Nyong'o, Florence Pugh, Jenna Ortega, Ana de Armas, Jacob Elordi, Barry White, Dolly Parton, Willie Nelson, Lil Wayne, 50 Cent, Ice Cube, Tupac Shakur, Notorious B.I.G., Bob Dylan, David Bowie, Michael Jackson, Whitney Houston, Amy Winehouse, SZA, Tyler, The Creator, Thanos, Tony Stark, Captain Jack Sparrow, Walter White, Tommy Shelby, Michael Scott, Dwight Schrute, Bowser, Usain Bolt, Tyson Fury, Dana White, Pat McAfee, Giannis Antetokounmpo, Lex Fridman, Ben Shapiro, Tucker Carlson, Martha Stewart, Gordon Lightfoot, Lizzo, Megan Thee Stallion, Ice Spice, 21 Savage, Metro Boomin, Jack Harlow, Peso Pluma, BTS Jungkook, Quentin Tarantino, Werner Herzog, Anderson Cooper, Rachel Maddow, Mahatma Gandhi, Muhammad Ali, Princess Diana, Nelson Mandela, Steve Irwin, Morty Smith, Andrew Huberman, Willem Dafoe, Mike Rowe, Terminator, Deadpool, Plankton, Mr. Krabs, Picard | `"Elon Musk"` | +| `name` | ✗ | Give your audio a custom name for easy identification. | `"My Voice Generator audio"` | #### Synchronous Client diff --git a/magic_hour/resources/v1/audio_to_video/README.md b/magic_hour/resources/v1/audio_to_video/README.md new file mode 100644 index 0000000..920a028 --- /dev/null +++ b/magic_hour/resources/v1/audio_to_video/README.md @@ -0,0 +1,167 @@ +# v1.audio_to_video + +## Module Functions + + + +### Audio To Video Generate Workflow + +The workflow performs the following action + +1. upload local assets to Magic Hour storage. So you can pass in a local path instead of having to upload files yourself +2. trigger a generation +3. poll for a completion status. This is configurable +4. if success, download the output to local directory + +> [!TIP] +> This is the recommended way to use the SDK unless you have specific needs where it is necessary to split up the actions. + +#### Parameters + +In Additional to the parameters listed in the `.create` section below, `.generate` introduces 3 new parameters: + +- `wait_for_completion` (bool, default True): Whether to wait for the project to complete. +- `download_outputs` (bool, default True): Whether to download the generated files +- `download_directory` (str, optional): Directory to save downloaded files (defaults to current directory) + +#### Synchronous Client + +```python +from magic_hour import Client +from os import getenv + +client = Client(token=getenv("API_TOKEN")) +res = client.v1.audio_to_video.generate( + assets={ + "audio_file_path": "/path/to/1234.mp3", + "image_file_path": "/path/to/1234.png", + }, + end_seconds=15.0, + name="My Audio To Video video", + resolution="720p", + start_seconds=0.0, + style={"prompt": "Car driving through a city"}, + wait_for_completion=True, + download_outputs=True, + download_directory="." +) +``` + +#### Asynchronous Client + +```python +from magic_hour import AsyncClient +from os import getenv + +client = AsyncClient(token=getenv("API_TOKEN")) +res = await client.v1.audio_to_video.generate( + assets={ + "audio_file_path": "/path/to/1234.mp3", + "image_file_path": "/path/to/1234.png", + }, + end_seconds=15.0, + name="My Audio To Video video", + resolution="720p", + start_seconds=0.0, + style={"prompt": "Car driving through a city"}, + wait_for_completion=True, + download_outputs=True, + download_directory="." +) +``` + + + +### Audio-to-Video + +**What this API does** + +Create the same Audio To Video you can make in the browser, but programmatically, so you can automate it, run it at scale, or connect it to your own app or workflow. + +**Good for** + +- Automation and batch processing +- Adding audio to video into apps, pipelines, or tools + +**How it works (3 steps)** + +1. Upload your inputs (video, image, or audio) with [Generate Upload URLs](https://docs.magichour.ai/api-reference/files/generate-asset-upload-urls) and copy the `file_path`. +2. Send a request to create a audio to video job with the basic fields. +3. Check the job status until it's `complete`, then download the result from `downloads`. + +**Key options** + +- Inputs: usually a file, sometimes a YouTube link, depending on project type +- Resolution: free users are limited to 576px; higher plans unlock HD and larger sizes +- Extra fields: e.g. `face_swap_mode`, `start_seconds`/`end_seconds`, or a text prompt + +**Cost**\ +Credits are only charged for the frames that actually render. You'll see an estimate when the job is queued, and the final total after it's done. + +For detailed examples, see the [product page](https://magichour.ai/products/audio-to-video). + +**API Endpoint**: `POST /v1/audio-to-video` + +#### Parameters + +| Parameter | Required | Description | Example | +| -------------------- | :------: | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | +| `assets` | ✓ | Provide the audio file and an optional reference image. | `{"audio_file_path": "api-assets/id/1234.mp3", "image_file_path": "api-assets/id/1234.png"}` | +| `└─ audio_file_path` | ✓ | The path of the audio file. 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.mp3"` | +| `└─ image_file_path` | ✗ | Reference image for the initial frame of the video. 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.png"` | +| `end_seconds` | ✓ | End time of your clip (seconds). Must be greater than start_seconds. | `15.0` | +| `name` | ✗ | Give your video a custom name for easy identification. | `"My Audio To Video video"` | +| `resolution` | ✗ | Output video resolution. Defaults to `720p` on paid tiers and `480p` on free tiers. | `"720p"` | +| `start_seconds` | ✗ | Start time of your clip (seconds). Must be ≥ 0. | `0.0` | +| `style` | ✗ | Attributes used to dictate the style of the output | `{"prompt": "Car driving through a city"}` | +| `└─ prompt` | ✗ | Prompt to guide the visual style of the video. | `"Car driving through a city"` | + +#### Synchronous Client + +```python +from magic_hour import Client +from os import getenv + +client = Client(token=getenv("API_TOKEN")) +res = client.v1.audio_to_video.create( + assets={ + "audio_file_path": "api-assets/id/1234.mp3", + "image_file_path": "api-assets/id/1234.png", + }, + end_seconds=15.0, + name="My Audio To Video video", + resolution="720p", + start_seconds=0.0, +) +``` + +#### Asynchronous Client + +```python +from magic_hour import AsyncClient +from os import getenv + +client = AsyncClient(token=getenv("API_TOKEN")) +res = await client.v1.audio_to_video.create( + assets={ + "audio_file_path": "api-assets/id/1234.mp3", + "image_file_path": "api-assets/id/1234.png", + }, + end_seconds=15.0, + name="My Audio To Video video", + resolution="720p", + start_seconds=0.0, +) +``` + +#### Response + +##### Type + +[V1AudioToVideoCreateResponse](/magic_hour/types/models/v1_audio_to_video_create_response.py) + +##### Example + +```python +{"credits_charged": 450, "estimated_frame_cost": 450, "id": "cuid-example"} +``` diff --git a/magic_hour/resources/v1/audio_to_video/__init__.py b/magic_hour/resources/v1/audio_to_video/__init__.py new file mode 100644 index 0000000..46a50d9 --- /dev/null +++ b/magic_hour/resources/v1/audio_to_video/__init__.py @@ -0,0 +1,4 @@ +from .client import AsyncAudioToVideoClient, AudioToVideoClient + + +__all__ = ["AsyncAudioToVideoClient", "AudioToVideoClient"] diff --git a/magic_hour/resources/v1/audio_to_video/client.py b/magic_hour/resources/v1/audio_to_video/client.py new file mode 100644 index 0000000..770d4b6 --- /dev/null +++ b/magic_hour/resources/v1/audio_to_video/client.py @@ -0,0 +1,411 @@ +import typing +import typing_extensions + +from magic_hour.helpers.logger import get_sdk_logger +from magic_hour.resources.v1.files.client import AsyncFilesClient, FilesClient +from magic_hour.resources.v1.video_projects.client import ( + AsyncVideoProjectsClient, + VideoProjectsClient, +) +from magic_hour.types import models, params +from make_api_request import ( + AsyncBaseClient, + RequestOptions, + SyncBaseClient, + default_request_options, + to_encodable, + type_utils, +) + + +logger = get_sdk_logger(__name__) + + +class AudioToVideoClient: + def __init__(self, *, base_client: SyncBaseClient): + self._base_client = base_client + + def generate( + self, + *, + assets: params.V1AudioToVideoGenerateBodyAssets, + end_seconds: float, + name: typing.Union[ + typing.Optional[str], type_utils.NotGiven + ] = type_utils.NOT_GIVEN, + resolution: typing.Union[ + typing.Optional[typing_extensions.Literal["1080p", "480p", "720p"]], + type_utils.NotGiven, + ] = type_utils.NOT_GIVEN, + start_seconds: typing.Union[ + typing.Optional[float], type_utils.NotGiven + ] = type_utils.NOT_GIVEN, + style: typing.Union[ + typing.Optional[params.V1AudioToVideoCreateBodyStyle], type_utils.NotGiven + ] = type_utils.NOT_GIVEN, + wait_for_completion: bool = True, + download_outputs: bool = True, + download_directory: typing.Optional[str] = None, + request_options: typing.Optional[RequestOptions] = None, + ): + """ + Generate audio-to-video (alias for create with additional functionality). + + Create an Audio To Video video. Credits are only charged for the frames that actually render. + + Args: + name: Give your video a custom name for easy identification. + resolution: Output video resolution. Defaults to `720p` on paid tiers and `480p` on free tiers. + start_seconds: Start time of your clip (seconds). Must be ≥ 0. + style: Attributes used to dictate the style of the output + assets: Provide the audio file and an optional reference image. + end_seconds: End time of your clip (seconds). Must be greater than start_seconds. + wait_for_completion: Whether to wait for the video project to complete + download_outputs: Whether to download the outputs + download_directory: The directory to download the outputs to. If not provided, the outputs will be downloaded to the current working directory + request_options: Additional options to customize the HTTP request + + Returns: + V1VideoProjectsGetResponseWithDownloads: The response from the Audio-to-Video API with the downloaded paths if `download_outputs` is True. + + Examples: + ```py + response = client.v1.audio_to_video.generate( + assets={ + "audio_file_path": "path/to/audio.mp3", + "image_file_path": "path/to/image.png", + }, + end_seconds=15.0, + name="My Audio To Video video", + resolution="720p", + start_seconds=0.0, + wait_for_completion=True, + download_outputs=True, + download_directory=".", + ) + ``` + """ + + file_client = FilesClient(base_client=self._base_client) + + audio_file_path = assets["audio_file_path"] + assets["audio_file_path"] = file_client.upload_file(file=audio_file_path) + + if "image_file_path" in assets and assets["image_file_path"]: + image_file_path = assets["image_file_path"] + assets["image_file_path"] = file_client.upload_file(file=image_file_path) + + create_response = self.create( + assets=assets, + end_seconds=end_seconds, + name=name, + resolution=resolution, + start_seconds=start_seconds, + style=style, + request_options=request_options, + ) + logger.info(f"Audio-to-Video response: {create_response}") + + video_projects_client = VideoProjectsClient(base_client=self._base_client) + response = video_projects_client.check_result( + id=create_response.id, + wait_for_completion=wait_for_completion, + download_outputs=download_outputs, + download_directory=download_directory, + ) + + return response + + def create( + self, + *, + assets: params.V1AudioToVideoCreateBodyAssets, + end_seconds: float, + name: typing.Union[ + typing.Optional[str], type_utils.NotGiven + ] = type_utils.NOT_GIVEN, + resolution: typing.Union[ + typing.Optional[typing_extensions.Literal["1080p", "480p", "720p"]], + type_utils.NotGiven, + ] = type_utils.NOT_GIVEN, + start_seconds: typing.Union[ + typing.Optional[float], type_utils.NotGiven + ] = type_utils.NOT_GIVEN, + style: typing.Union[ + typing.Optional[params.V1AudioToVideoCreateBodyStyle], type_utils.NotGiven + ] = type_utils.NOT_GIVEN, + request_options: typing.Optional[RequestOptions] = None, + ) -> models.V1AudioToVideoCreateResponse: + """ + Audio-to-Video + + **What this API does** + + Create the same Audio To Video you can make in the browser, but programmatically, so you can automate it, run it at scale, or connect it to your own app or workflow. + + **Good for** + - Automation and batch processing + - Adding audio to video into apps, pipelines, or tools + + **How it works (3 steps)** + 1) Upload your inputs (video, image, or audio) with [Generate Upload URLs](https://docs.magichour.ai/api-reference/files/generate-asset-upload-urls) and copy the `file_path`. + 2) Send a request to create a audio to video job with the basic fields. + 3) Check the job status until it's `complete`, then download the result from `downloads`. + + **Key options** + - Inputs: usually a file, sometimes a YouTube link, depending on project type + - Resolution: free users are limited to 576px; higher plans unlock HD and larger sizes + - Extra fields: e.g. `face_swap_mode`, `start_seconds`/`end_seconds`, or a text prompt + + **Cost** + Credits are only charged for the frames that actually render. You'll see an estimate when the job is queued, and the final total after it's done. + + For detailed examples, see the [product page](https://magichour.ai/products/audio-to-video). + + POST /v1/audio-to-video + + Args: + name: Give your video a custom name for easy identification. + resolution: Output video resolution. Defaults to `720p` on paid tiers and `480p` on free tiers. + start_seconds: Start time of your clip (seconds). Must be ≥ 0. + style: Attributes used to dictate the style of the output + assets: Provide the audio file and an optional reference image. + end_seconds: End time of your clip (seconds). Must be greater than start_seconds. + request_options: Additional options to customize the HTTP request + + Returns: + Success + + Raises: + ApiError: A custom exception class that provides additional context + for API errors, including the HTTP status code and response body. + + Examples: + ```py + client.v1.audio_to_video.create( + assets={ + "audio_file_path": "api-assets/id/1234.mp3", + "image_file_path": "api-assets/id/1234.png", + }, + end_seconds=15.0, + name="My Audio To Video video", + resolution="720p", + start_seconds=0.0, + ) + ``` + """ + _json = to_encodable( + item={ + "name": name, + "resolution": resolution, + "start_seconds": start_seconds, + "style": style, + "assets": assets, + "end_seconds": end_seconds, + }, + dump_with=params._SerializerV1AudioToVideoCreateBody, + ) + return self._base_client.request( + method="POST", + path="/v1/audio-to-video", + auth_names=["bearerAuth"], + json=_json, + cast_to=models.V1AudioToVideoCreateResponse, + request_options=request_options or default_request_options(), + ) + + +class AsyncAudioToVideoClient: + def __init__(self, *, base_client: AsyncBaseClient): + self._base_client = base_client + + async def generate( + self, + *, + assets: params.V1AudioToVideoGenerateBodyAssets, + end_seconds: float, + name: typing.Union[ + typing.Optional[str], type_utils.NotGiven + ] = type_utils.NOT_GIVEN, + resolution: typing.Union[ + typing.Optional[typing_extensions.Literal["1080p", "480p", "720p"]], + type_utils.NotGiven, + ] = type_utils.NOT_GIVEN, + start_seconds: typing.Union[ + typing.Optional[float], type_utils.NotGiven + ] = type_utils.NOT_GIVEN, + style: typing.Union[ + typing.Optional[params.V1AudioToVideoCreateBodyStyle], type_utils.NotGiven + ] = type_utils.NOT_GIVEN, + wait_for_completion: bool = True, + download_outputs: bool = True, + download_directory: typing.Optional[str] = None, + request_options: typing.Optional[RequestOptions] = None, + ): + """ + Generate audio-to-video (alias for create with additional functionality). + + Create an Audio To Video video. Credits are only charged for the frames that actually render. + + Args: + name: Give your video a custom name for easy identification. + resolution: Output video resolution. Defaults to `720p` on paid tiers and `480p` on free tiers. + start_seconds: Start time of your clip (seconds). Must be ≥ 0. + style: Attributes used to dictate the style of the output + assets: Provide the audio file and an optional reference image. + end_seconds: End time of your clip (seconds). Must be greater than start_seconds. + wait_for_completion: Whether to wait for the video project to complete + download_outputs: Whether to download the outputs + download_directory: The directory to download the outputs to. If not provided, the outputs will be downloaded to the current working directory + request_options: Additional options to customize the HTTP request + + Returns: + V1VideoProjectsGetResponseWithDownloads: The response from the Audio-to-Video API with the downloaded paths if `download_outputs` is True. + + Examples: + ```py + response = await client.v1.audio_to_video.generate( + assets={ + "audio_file_path": "path/to/audio.mp3", + "image_file_path": "path/to/image.png", + }, + end_seconds=15.0, + name="My Audio To Video video", + resolution="720p", + start_seconds=0.0, + wait_for_completion=True, + download_outputs=True, + download_directory=".", + ) + ``` + """ + + file_client = AsyncFilesClient(base_client=self._base_client) + + audio_file_path = assets["audio_file_path"] + assets["audio_file_path"] = await file_client.upload_file(file=audio_file_path) + + if "image_file_path" in assets and assets["image_file_path"]: + image_file_path = assets["image_file_path"] + assets["image_file_path"] = await file_client.upload_file( + file=image_file_path + ) + + create_response = await self.create( + assets=assets, + end_seconds=end_seconds, + name=name, + resolution=resolution, + start_seconds=start_seconds, + style=style, + request_options=request_options, + ) + logger.info(f"Audio-to-Video response: {create_response}") + + video_projects_client = AsyncVideoProjectsClient(base_client=self._base_client) + response = await video_projects_client.check_result( + id=create_response.id, + wait_for_completion=wait_for_completion, + download_outputs=download_outputs, + download_directory=download_directory, + ) + + return response + + async def create( + self, + *, + assets: params.V1AudioToVideoCreateBodyAssets, + end_seconds: float, + name: typing.Union[ + typing.Optional[str], type_utils.NotGiven + ] = type_utils.NOT_GIVEN, + resolution: typing.Union[ + typing.Optional[typing_extensions.Literal["1080p", "480p", "720p"]], + type_utils.NotGiven, + ] = type_utils.NOT_GIVEN, + start_seconds: typing.Union[ + typing.Optional[float], type_utils.NotGiven + ] = type_utils.NOT_GIVEN, + style: typing.Union[ + typing.Optional[params.V1AudioToVideoCreateBodyStyle], type_utils.NotGiven + ] = type_utils.NOT_GIVEN, + request_options: typing.Optional[RequestOptions] = None, + ) -> models.V1AudioToVideoCreateResponse: + """ + Audio-to-Video + + **What this API does** + + Create the same Audio To Video you can make in the browser, but programmatically, so you can automate it, run it at scale, or connect it to your own app or workflow. + + **Good for** + - Automation and batch processing + - Adding audio to video into apps, pipelines, or tools + + **How it works (3 steps)** + 1) Upload your inputs (video, image, or audio) with [Generate Upload URLs](https://docs.magichour.ai/api-reference/files/generate-asset-upload-urls) and copy the `file_path`. + 2) Send a request to create a audio to video job with the basic fields. + 3) Check the job status until it's `complete`, then download the result from `downloads`. + + **Key options** + - Inputs: usually a file, sometimes a YouTube link, depending on project type + - Resolution: free users are limited to 576px; higher plans unlock HD and larger sizes + - Extra fields: e.g. `face_swap_mode`, `start_seconds`/`end_seconds`, or a text prompt + + **Cost** + Credits are only charged for the frames that actually render. You'll see an estimate when the job is queued, and the final total after it's done. + + For detailed examples, see the [product page](https://magichour.ai/products/audio-to-video). + + POST /v1/audio-to-video + + Args: + name: Give your video a custom name for easy identification. + resolution: Output video resolution. Defaults to `720p` on paid tiers and `480p` on free tiers. + start_seconds: Start time of your clip (seconds). Must be ≥ 0. + style: Attributes used to dictate the style of the output + assets: Provide the audio file and an optional reference image. + end_seconds: End time of your clip (seconds). Must be greater than start_seconds. + request_options: Additional options to customize the HTTP request + + Returns: + Success + + Raises: + ApiError: A custom exception class that provides additional context + for API errors, including the HTTP status code and response body. + + Examples: + ```py + await client.v1.audio_to_video.create( + assets={ + "audio_file_path": "api-assets/id/1234.mp3", + "image_file_path": "api-assets/id/1234.png", + }, + end_seconds=15.0, + name="My Audio To Video video", + resolution="720p", + start_seconds=0.0, + ) + ``` + """ + _json = to_encodable( + item={ + "name": name, + "resolution": resolution, + "start_seconds": start_seconds, + "style": style, + "assets": assets, + "end_seconds": end_seconds, + }, + dump_with=params._SerializerV1AudioToVideoCreateBody, + ) + return await self._base_client.request( + method="POST", + path="/v1/audio-to-video", + auth_names=["bearerAuth"], + json=_json, + cast_to=models.V1AudioToVideoCreateResponse, + request_options=request_options or default_request_options(), + ) diff --git a/magic_hour/resources/v1/client.py b/magic_hour/resources/v1/client.py index b245ad7..0af3e1d 100644 --- a/magic_hour/resources/v1/client.py +++ b/magic_hour/resources/v1/client.py @@ -51,6 +51,10 @@ AsyncAudioProjectsClient, AudioProjectsClient, ) +from magic_hour.resources.v1.audio_to_video import ( + AsyncAudioToVideoClient, + AudioToVideoClient, +) from magic_hour.resources.v1.auto_subtitle_generator import ( AsyncAutoSubtitleGeneratorClient, AutoSubtitleGeneratorClient, @@ -140,6 +144,7 @@ def __init__(self, *, base_client: SyncBaseClient): self.ai_voice_cloner = AiVoiceClonerClient(base_client=self._base_client) self.head_swap = HeadSwapClient(base_client=self._base_client) self.body_swap = BodySwapClient(base_client=self._base_client) + self.audio_to_video = AudioToVideoClient(base_client=self._base_client) class AsyncV1Client: @@ -193,3 +198,4 @@ def __init__(self, *, base_client: AsyncBaseClient): self.ai_voice_cloner = AsyncAiVoiceClonerClient(base_client=self._base_client) self.head_swap = AsyncHeadSwapClient(base_client=self._base_client) self.body_swap = AsyncBodySwapClient(base_client=self._base_client) + self.audio_to_video = AsyncAudioToVideoClient(base_client=self._base_client) diff --git a/magic_hour/resources/v1/image_to_video/README.md b/magic_hour/resources/v1/image_to_video/README.md index 6d1503a..8eb56b3 100644 --- a/magic_hour/resources/v1/image_to_video/README.md +++ b/magic_hour/resources/v1/image_to_video/README.md @@ -94,22 +94,22 @@ For detailed examples, see the [product page](https://magichour.ai/products/imag #### Parameters -| Parameter | Required | Deprecated | Description | Example | -| ------------------------ | :------: | :--------: | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------ | -| `assets` | ✓ | ✗ | 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": "api-assets/id/1234.png", "image_file_path": "api-assets/id/1234.png"}` | -| `└─ end_image_file_path` | ✗ | — | The image to use as the last frame of the video. * **`ltx-2.3`**: Supports 480p, 720p, 1080p. * **`wan-2.2`**: Not supported * **`kling-2.5`**: Supports 1080p. * **`kling-3.0`**: Supports 720p, 1080p, 4k. * **`veo3.1-lite`**: Not supported * **`veo3.1`**: Not supported * **`seedance`**: Supports 480p, 720p, 1080p. * **`seedance-2.0`**: Supports 480p, 720p. * **`sora-2`**: Not supported | `"api-assets/id/1234.png"` | -| `└─ image_file_path` | ✓ | — | The path of the image file. 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.png"` | -| `end_seconds` | ✓ | ✗ | The total duration of the output video in seconds. Supported durations depend on the chosen model: * **`ltx-2.3`**: 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 15, 20, 25, 30 * **`wan-2.2`**: 3, 4, 5, 6, 7, 8, 9, 10, 15 * **`kling-2.5`**: 5, 10 * **`kling-3.0`**: 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 * **`veo3.1-lite`**: 8, 16, 24, 32, 40, 48, 56 * **`veo3.1`**: 4, 6, 8, 16, 24, 32, 40, 48, 56 * **`seedance`**: 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12 * **`seedance-2.0`**: 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 * **`sora-2`**: 4, 8, 12, 24, 36, 48, 60 | `5.0` | -| `audio` | ✗ | ✗ | Whether to include audio in the video. Defaults to `false` if not specified. Audio support varies by model: * **`ltx-2.3`**: Toggle-able: no additional credits for audio * **`wan-2.2`**: Not supported * **`kling-2.5`**: Toggle-able: no additional credits for audio * **`kling-3.0`**: Toggle-able: audio adds extra credits when enabled * **`veo3.1-lite`**: Toggle-able: audio adds extra credits when enabled * **`veo3.1`**: Toggle-able: audio adds extra credits when enabled * **`seedance`**: Not supported * **`seedance-2.0`**: Toggle-able: no additional credits for audio * **`sora-2`**: Toggle-able: no additional credits for audio | `True` | -| `height` | ✗ | ✓ | `height` is deprecated and no longer influences the output video's resolution. This field is retained only for backward compatibility and will be removed in a future release. | `123` | -| `model` | ✗ | ✗ | The AI model to use for video generation. * `default`: uses our currently recommended model for general use. For paid tiers, defaults to `kling-3.0`. For free tiers, it defaults to `ltx-2.3`. * `ltx-2.3`: Fast iteration with audio, lip-sync, and end frame * `wan-2.2`: Fast, strong visuals with effects * `kling-2.5`: Motion, action, and camera control * `kling-3.0`: Cinematic, multi-scene storytelling * `veo3.1-lite`: Fast, affordable, high-quality * `veo3.1`: Realistic visuals and prompt adherence * `seedance`: Fast iteration and start/end frames * `seedance-2.0`: State-of-the-art quality and consistency * `sora-2`: Story-first concepts and creativity If you specify the deprecated model value that includes the `-audio` suffix, this will be the same as included `audio` as `true`. | `"kling-3.0"` | -| `name` | ✗ | ✗ | Give your video a custom name for easy identification. | `"My Image To Video video"` | -| `resolution` | ✗ | ✗ | Controls the output video resolution. Defaults to `720p` on paid tiers and `480p` on free tiers. * **`ltx-2.3`**: Supports 480p, 720p, 1080p. * **`wan-2.2`**: Supports 480p, 720p, 1080p. * **`kling-2.5`**: Supports 720p, 1080p. * **`kling-3.0`**: Supports 720p, 1080p, 4k. * **`veo3.1-lite`**: Supports 720p, 1080p. * **`veo3.1`**: Supports 720p, 1080p. * **`seedance`**: Supports 480p, 720p, 1080p. * **`seedance-2.0`**: Supports 480p, 720p. * **`sora-2`**: Supports 720p. | `"720p"` | -| `style` | ✗ | ✗ | Attributed used to dictate the style of the output | `{"prompt": "a dog running"}` | -| `└─ high_quality` | ✗ | ✓ | Deprecated: Please use `resolution` instead. For backward compatibility, * `false` maps to 720p resolution * `true` maps to 1080p resolution This field will be removed in a future version. Use the `resolution` field to directly specify the resolution. | `True` | -| `└─ prompt` | ✗ | — | The prompt used for the video. | `"a dog running"` | -| `└─ quality_mode` | ✗ | ✓ | DEPRECATED: Please use `resolution` field instead. For backward compatibility: * `quick` maps to 720p resolution * `studio` maps to 1080p resolution This field will be removed in a future version. Use the `resolution` field to directly to specify the resolution. | `"quick"` | -| `width` | ✗ | ✓ | `width` is deprecated and no longer influences the output video's resolution. This field is retained only for backward compatibility and will be removed in a future release. | `123` | +| Parameter | Required | Deprecated | Description | Example | +| ------------------------ | :------: | :--------: | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------ | +| `assets` | ✓ | ✗ | 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": "api-assets/id/1234.png", "image_file_path": "api-assets/id/1234.png"}` | +| `└─ end_image_file_path` | ✗ | — | The image to use as the last frame of the video. * **`ltx-2.3`**: Supports 480p, 720p, 1080p. * **`wan-2.2`**: Not supported * **`kling-2.5`**: Supports 1080p. * **`kling-3.0`**: Supports 720p, 1080p, 4k. * **`veo3.1-lite`**: Not supported * **`veo3.1`**: Not supported * **`seedance`**: Supports 480p, 720p, 1080p. * **`seedance-2.0`**: Supports 480p, 720p. * **`sora-2`**: Not supported | `"api-assets/id/1234.png"` | +| `└─ image_file_path` | ✓ | — | The path of the image file. 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.png"` | +| `end_seconds` | ✓ | ✗ | The total duration of the output video in seconds. Supported durations depend on the chosen model: * **`ltx-2.3`**: 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 15, 20, 25, 30 * **`wan-2.2`**: 3, 4, 5, 6, 7, 8, 9, 10, 15 * **`kling-2.5`**: 5, 10 * **`kling-3.0`**: 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 * **`veo3.1-lite`**: 8, 16, 24, 32, 40, 48, 56 * **`veo3.1`**: 4, 6, 8, 16, 24, 32, 40, 48, 56 * **`seedance`**: 4, 5, 6, 7, 8, 9, 10, 11, 12 * **`seedance-2.0`**: 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 * **`sora-2`**: 4, 8, 12, 24, 36, 48, 60 | `5.0` | +| `audio` | ✗ | ✗ | Whether to include audio in the video. Defaults to `false` if not specified. Audio support varies by model: * **`ltx-2.3`**: Toggle-able: no additional credits for audio * **`wan-2.2`**: Not supported * **`kling-2.5`**: Toggle-able: no additional credits for audio * **`kling-3.0`**: Toggle-able: audio adds extra credits when enabled * **`veo3.1-lite`**: Toggle-able: audio adds extra credits when enabled * **`veo3.1`**: Toggle-able: audio adds extra credits when enabled * **`seedance`**: Not supported * **`seedance-2.0`**: Toggle-able: no additional credits for audio * **`sora-2`**: Toggle-able: no additional credits for audio | `True` | +| `height` | ✗ | ✓ | `height` is deprecated and no longer influences the output video's resolution. This field is retained only for backward compatibility and will be removed in a future release. | `123` | +| `model` | ✗ | ✗ | The AI model to use for video generation. * `default`: uses our currently recommended model for general use. For paid tiers, defaults to `kling-3.0`. For free tiers, it defaults to `ltx-2.3`. * `ltx-2.3`: Fast iteration with lip-sync & end frame * `wan-2.2`: Fast, strong visuals with effects * `kling-2.5`: Motion, action, and camera control * `kling-3.0`: Cinematic, multi-scene storytelling * `veo3.1-lite`: Fast, affordable, high-quality * `veo3.1`: Realistic visuals and prompt adherence * `seedance`: Fast iteration and start/end frames * `seedance-2.0`: State-of-the-art quality and consistency * `sora-2`: Story-first concepts and creativity If you specify the deprecated model value that includes the `-audio` suffix, this will be the same as included `audio` as `true`. | `"kling-3.0"` | +| `name` | ✗ | ✗ | Give your video a custom name for easy identification. | `"My Image To Video video"` | +| `resolution` | ✗ | ✗ | Controls the output video resolution. Defaults to `720p` on paid tiers and `480p` on free tiers. * **`ltx-2.3`**: Supports 480p, 720p, 1080p. * **`wan-2.2`**: Supports 480p, 720p, 1080p. * **`kling-2.5`**: Supports 720p, 1080p. * **`kling-3.0`**: Supports 720p, 1080p, 4k. * **`veo3.1-lite`**: Supports 720p, 1080p. * **`veo3.1`**: Supports 720p, 1080p. * **`seedance`**: Supports 480p, 720p, 1080p. * **`seedance-2.0`**: Supports 480p, 720p. * **`sora-2`**: Supports 720p. | `"720p"` | +| `style` | ✗ | ✗ | Attributed used to dictate the style of the output | `{"prompt": "a dog running"}` | +| `└─ high_quality` | ✗ | ✓ | Deprecated: Please use `resolution` instead. For backward compatibility, * `false` maps to 720p resolution * `true` maps to 1080p resolution This field will be removed in a future version. Use the `resolution` field to directly specify the resolution. | `True` | +| `└─ prompt` | ✗ | — | The prompt used for the video. | `"a dog running"` | +| `└─ quality_mode` | ✗ | ✓ | DEPRECATED: Please use `resolution` field instead. For backward compatibility: * `quick` maps to 720p resolution * `studio` maps to 1080p resolution This field will be removed in a future version. Use the `resolution` field to directly to specify the resolution. | `"quick"` | +| `width` | ✗ | ✓ | `width` is deprecated and no longer influences the output video's resolution. This field is retained only for backward compatibility and will be removed in a future release. | `123` | #### Synchronous Client diff --git a/magic_hour/resources/v1/image_to_video/client.py b/magic_hour/resources/v1/image_to_video/client.py index e38fb0c..ea4de27 100644 --- a/magic_hour/resources/v1/image_to_video/client.py +++ b/magic_hour/resources/v1/image_to_video/client.py @@ -227,7 +227,7 @@ def create( model: The AI model to use for video generation. * `default`: uses our currently recommended model for general use. For paid tiers, defaults to `kling-3.0`. For free tiers, it defaults to `ltx-2.3`. - * `ltx-2.3`: Fast iteration with audio, lip-sync, and end frame + * `ltx-2.3`: Fast iteration with lip-sync & end frame * `wan-2.2`: Fast, strong visuals with effects * `kling-2.5`: Motion, action, and camera control * `kling-3.0`: Cinematic, multi-scene storytelling @@ -264,7 +264,7 @@ def create( * **`kling-3.0`**: 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 * **`veo3.1-lite`**: 8, 16, 24, 32, 40, 48, 56 * **`veo3.1`**: 4, 6, 8, 16, 24, 32, 40, 48, 56 - * **`seedance`**: 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12 + * **`seedance`**: 4, 5, 6, 7, 8, 9, 10, 11, 12 * **`seedance-2.0`**: 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 * **`sora-2`**: 4, 8, 12, 24, 36, 48, 60 @@ -522,7 +522,7 @@ async def create( model: The AI model to use for video generation. * `default`: uses our currently recommended model for general use. For paid tiers, defaults to `kling-3.0`. For free tiers, it defaults to `ltx-2.3`. - * `ltx-2.3`: Fast iteration with audio, lip-sync, and end frame + * `ltx-2.3`: Fast iteration with lip-sync & end frame * `wan-2.2`: Fast, strong visuals with effects * `kling-2.5`: Motion, action, and camera control * `kling-3.0`: Cinematic, multi-scene storytelling @@ -559,7 +559,7 @@ async def create( * **`kling-3.0`**: 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 * **`veo3.1-lite`**: 8, 16, 24, 32, 40, 48, 56 * **`veo3.1`**: 4, 6, 8, 16, 24, 32, 40, 48, 56 - * **`seedance`**: 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12 + * **`seedance`**: 4, 5, 6, 7, 8, 9, 10, 11, 12 * **`seedance-2.0`**: 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 * **`sora-2`**: 4, 8, 12, 24, 36, 48, 60 diff --git a/magic_hour/resources/v1/text_to_video/README.md b/magic_hour/resources/v1/text_to_video/README.md index 5c8f385..c1d6280 100644 --- a/magic_hour/resources/v1/text_to_video/README.md +++ b/magic_hour/resources/v1/text_to_video/README.md @@ -96,18 +96,18 @@ For detailed examples, see the [product page](https://magichour.ai/products/text #### Parameters -| Parameter | Required | Deprecated | Description | Example | -| ----------------- | :------: | :--------: | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------- | -| `end_seconds` | ✓ | ✗ | The total duration of the output video in seconds. Supported durations depend on the chosen model: * **`ltx-2.3`**: 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 15, 20, 25, 30 * **`wan-2.2`**: 3, 4, 5, 6, 7, 8, 9, 10, 15 * **`kling-2.5`**: 5, 10 * **`kling-3.0`**: 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 * **`veo3.1-lite`**: 8, 16, 24, 32, 40, 48, 56 * **`veo3.1`**: 4, 6, 8, 16, 24, 32, 40, 48, 56 * **`seedance`**: 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12 * **`seedance-2.0`**: 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 * **`sora-2`**: 4, 8, 12, 24, 36, 48, 60 | `5.0` | -| `style` | ✓ | ✗ | | `{"prompt": "a dog running"}` | -| `└─ prompt` | ✓ | — | The prompt used for the video. | `"a dog running"` | -| `└─ quality_mode` | ✗ | ✓ | DEPRECATED: Please use `resolution` field instead. For backward compatibility: * `quick` maps to 720p resolution * `studio` maps to 1080p resolution This field will be removed in a future version. Use the `resolution` field to directly to specify the resolution. | `"quick"` | -| `aspect_ratio` | ✗ | ✗ | Determines the aspect ratio of the output video. * **`ltx-2.3`**: Supports 9:16, 16:9, 1:1. * **`wan-2.2`**: Supports 9:16, 16:9, 1:1. * **`kling-2.5`**: Supports 9:16, 16:9, 1:1. * **`kling-3.0`**: Supports 9:16, 16:9, 1:1. * **`veo3.1-lite`**: Supports 9:16, 16:9. * **`veo3.1`**: Supports 9:16, 16:9. * **`seedance`**: Supports 9:16, 16:9, 1:1. * **`seedance-2.0`**: Supports 9:16, 16:9, 1:1. * **`sora-2`**: Supports 9:16, 16:9. | `"16:9"` | -| `audio` | ✗ | ✗ | Whether to include audio in the video. Defaults to `false` if not specified. Audio support varies by model: * **`ltx-2.3`**: Toggle-able: no additional credits for audio * **`wan-2.2`**: Not supported * **`kling-2.5`**: Toggle-able: no additional credits for audio * **`kling-3.0`**: Toggle-able: audio adds extra credits when enabled * **`veo3.1-lite`**: Toggle-able: audio adds extra credits when enabled * **`veo3.1`**: Toggle-able: audio adds extra credits when enabled * **`seedance`**: Not supported * **`seedance-2.0`**: Toggle-able: no additional credits for audio * **`sora-2`**: Toggle-able: no additional credits for audio | `True` | -| `model` | ✗ | ✗ | The AI model to use for video generation. * `default`: uses our currently recommended model for general use. For paid tiers, defaults to `kling-3.0`. For free tiers, it defaults to `ltx-2.3`. * `ltx-2.3`: Fast iteration with audio, lip-sync, and end frame * `wan-2.2`: Fast, strong visuals with effects * `kling-2.5`: Motion, action, and camera control * `kling-3.0`: Cinematic, multi-scene storytelling * `veo3.1-lite`: Fast, affordable, high-quality * `veo3.1`: Realistic visuals and prompt adherence * `seedance`: Fast iteration and start/end frames * `seedance-2.0`: State-of-the-art quality and consistency * `sora-2`: Story-first concepts and creativity If you specify the deprecated model value that includes the `-audio` suffix, this will be the same as included `audio` as `true`. | `"kling-3.0"` | -| `name` | ✗ | ✗ | Give your video a custom name for easy identification. | `"My Text To Video video"` | -| `orientation` | ✗ | ✓ | Deprecated. Use `aspect_ratio` instead. | `"landscape"` | -| `resolution` | ✗ | ✗ | Controls the output video resolution. Defaults to `720p` on paid tiers and `480p` on free tiers. * **`ltx-2.3`**: Supports 480p, 720p, 1080p. * **`wan-2.2`**: Supports 480p, 720p, 1080p. * **`kling-2.5`**: Supports 720p, 1080p. * **`kling-3.0`**: Supports 720p, 1080p, 4k. * **`veo3.1-lite`**: Supports 720p, 1080p. * **`veo3.1`**: Supports 720p, 1080p. * **`seedance`**: Supports 480p, 720p, 1080p. * **`seedance-2.0`**: Supports 480p, 720p. * **`sora-2`**: Supports 720p. | `"720p"` | +| Parameter | Required | Deprecated | Description | Example | +| ----------------- | :------: | :--------: | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------- | +| `end_seconds` | ✓ | ✗ | The total duration of the output video in seconds. Supported durations depend on the chosen model: * **`ltx-2.3`**: 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 15, 20, 25, 30 * **`wan-2.2`**: 3, 4, 5, 6, 7, 8, 9, 10, 15 * **`kling-2.5`**: 5, 10 * **`kling-3.0`**: 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 * **`veo3.1-lite`**: 8, 16, 24, 32, 40, 48, 56 * **`veo3.1`**: 4, 6, 8, 16, 24, 32, 40, 48, 56 * **`seedance`**: 4, 5, 6, 7, 8, 9, 10, 11, 12 * **`seedance-2.0`**: 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 * **`sora-2`**: 4, 8, 12, 24, 36, 48, 60 | `5.0` | +| `style` | ✓ | ✗ | | `{"prompt": "a dog running"}` | +| `└─ prompt` | ✓ | — | The prompt used for the video. | `"a dog running"` | +| `└─ quality_mode` | ✗ | ✓ | DEPRECATED: Please use `resolution` field instead. For backward compatibility: * `quick` maps to 720p resolution * `studio` maps to 1080p resolution This field will be removed in a future version. Use the `resolution` field to directly to specify the resolution. | `"quick"` | +| `aspect_ratio` | ✗ | ✗ | Determines the aspect ratio of the output video. * **`ltx-2.3`**: Supports 9:16, 16:9, 1:1. * **`wan-2.2`**: Supports 9:16, 16:9, 1:1. * **`kling-2.5`**: Supports 9:16, 16:9, 1:1. * **`kling-3.0`**: Supports 9:16, 16:9, 1:1. * **`veo3.1-lite`**: Supports 9:16, 16:9. * **`veo3.1`**: Supports 9:16, 16:9. * **`seedance`**: Supports 9:16, 16:9, 1:1. * **`seedance-2.0`**: Supports 9:16, 16:9, 1:1. * **`sora-2`**: Supports 9:16, 16:9. | `"16:9"` | +| `audio` | ✗ | ✗ | Whether to include audio in the video. Defaults to `false` if not specified. Audio support varies by model: * **`ltx-2.3`**: Toggle-able: no additional credits for audio * **`wan-2.2`**: Not supported * **`kling-2.5`**: Toggle-able: no additional credits for audio * **`kling-3.0`**: Toggle-able: audio adds extra credits when enabled * **`veo3.1-lite`**: Toggle-able: audio adds extra credits when enabled * **`veo3.1`**: Toggle-able: audio adds extra credits when enabled * **`seedance`**: Not supported * **`seedance-2.0`**: Toggle-able: no additional credits for audio * **`sora-2`**: Toggle-able: no additional credits for audio | `True` | +| `model` | ✗ | ✗ | The AI model to use for video generation. * `default`: uses our currently recommended model for general use. For paid tiers, defaults to `kling-3.0`. For free tiers, it defaults to `ltx-2.3`. * `ltx-2.3`: Fast iteration with lip-sync & end frame * `wan-2.2`: Fast, strong visuals with effects * `kling-2.5`: Motion, action, and camera control * `kling-3.0`: Cinematic, multi-scene storytelling * `veo3.1-lite`: Fast, affordable, high-quality * `veo3.1`: Realistic visuals and prompt adherence * `seedance`: Fast iteration and start/end frames * `seedance-2.0`: State-of-the-art quality and consistency * `sora-2`: Story-first concepts and creativity If you specify the deprecated model value that includes the `-audio` suffix, this will be the same as included `audio` as `true`. | `"kling-3.0"` | +| `name` | ✗ | ✗ | Give your video a custom name for easy identification. | `"My Text To Video video"` | +| `orientation` | ✗ | ✓ | Deprecated. Use `aspect_ratio` instead. | `"landscape"` | +| `resolution` | ✗ | ✗ | Controls the output video resolution. Defaults to `720p` on paid tiers and `480p` on free tiers. * **`ltx-2.3`**: Supports 480p, 720p, 1080p. * **`wan-2.2`**: Supports 480p, 720p, 1080p. * **`kling-2.5`**: Supports 720p, 1080p. * **`kling-3.0`**: Supports 720p, 1080p, 4k. * **`veo3.1-lite`**: Supports 720p, 1080p. * **`veo3.1`**: Supports 720p, 1080p. * **`seedance`**: Supports 480p, 720p, 1080p. * **`seedance-2.0`**: Supports 480p, 720p. * **`sora-2`**: Supports 720p. | `"720p"` | #### Synchronous Client diff --git a/magic_hour/resources/v1/text_to_video/client.py b/magic_hour/resources/v1/text_to_video/client.py index c8c8dad..0b156dc 100644 --- a/magic_hour/resources/v1/text_to_video/client.py +++ b/magic_hour/resources/v1/text_to_video/client.py @@ -229,7 +229,7 @@ def create( model: The AI model to use for video generation. * `default`: uses our currently recommended model for general use. For paid tiers, defaults to `kling-3.0`. For free tiers, it defaults to `ltx-2.3`. - * `ltx-2.3`: Fast iteration with audio, lip-sync, and end frame + * `ltx-2.3`: Fast iteration with lip-sync & end frame * `wan-2.2`: Fast, strong visuals with effects * `kling-2.5`: Motion, action, and camera control * `kling-3.0`: Cinematic, multi-scene storytelling @@ -262,7 +262,7 @@ def create( * **`kling-3.0`**: 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 * **`veo3.1-lite`**: 8, 16, 24, 32, 40, 48, 56 * **`veo3.1`**: 4, 6, 8, 16, 24, 32, 40, 48, 56 - * **`seedance`**: 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12 + * **`seedance`**: 4, 5, 6, 7, 8, 9, 10, 11, 12 * **`seedance-2.0`**: 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 * **`sora-2`**: 4, 8, 12, 24, 36, 48, 60 @@ -517,7 +517,7 @@ async def create( model: The AI model to use for video generation. * `default`: uses our currently recommended model for general use. For paid tiers, defaults to `kling-3.0`. For free tiers, it defaults to `ltx-2.3`. - * `ltx-2.3`: Fast iteration with audio, lip-sync, and end frame + * `ltx-2.3`: Fast iteration with lip-sync & end frame * `wan-2.2`: Fast, strong visuals with effects * `kling-2.5`: Motion, action, and camera control * `kling-3.0`: Cinematic, multi-scene storytelling @@ -550,7 +550,7 @@ async def create( * **`kling-3.0`**: 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 * **`veo3.1-lite`**: 8, 16, 24, 32, 40, 48, 56 * **`veo3.1`**: 4, 6, 8, 16, 24, 32, 40, 48, 56 - * **`seedance`**: 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12 + * **`seedance`**: 4, 5, 6, 7, 8, 9, 10, 11, 12 * **`seedance-2.0`**: 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 * **`sora-2`**: 4, 8, 12, 24, 36, 48, 60 diff --git a/magic_hour/types/models/__init__.py b/magic_hour/types/models/__init__.py index 1ddb7ce..33c335a 100644 --- a/magic_hour/types/models/__init__.py +++ b/magic_hour/types/models/__init__.py @@ -18,6 +18,7 @@ V1AudioProjectsGetResponseDownloadsItem, ) from .v1_audio_projects_get_response_error import V1AudioProjectsGetResponseError +from .v1_audio_to_video_create_response import V1AudioToVideoCreateResponse from .v1_auto_subtitle_generator_create_response import ( V1AutoSubtitleGeneratorCreateResponse, ) @@ -72,6 +73,7 @@ "V1AudioProjectsGetResponse", "V1AudioProjectsGetResponseDownloadsItem", "V1AudioProjectsGetResponseError", + "V1AudioToVideoCreateResponse", "V1AutoSubtitleGeneratorCreateResponse", "V1BodySwapCreateResponse", "V1FaceDetectionCreateResponse", diff --git a/magic_hour/types/models/v1_audio_projects_get_response.py b/magic_hour/types/models/v1_audio_projects_get_response.py index f432eac..611dff3 100644 --- a/magic_hour/types/models/v1_audio_projects_get_response.py +++ b/magic_hour/types/models/v1_audio_projects_get_response.py @@ -68,5 +68,5 @@ class V1AudioProjectsGetResponse(pydantic.BaseModel): alias="type", ) """ - The type of the audio project. Possible values are VOICE_GENERATOR, VOICE_CHANGER, VOICE_CLONER, VIDEO_TO_AUDIO + The type of the audio project. Possible values are VOICE_GENERATOR, VOICE_CHANGER, VOICE_CLONER, VIDEO_TO_AUDIO, MUSIC_GENERATOR """ diff --git a/magic_hour/types/models/v1_audio_to_video_create_response.py b/magic_hour/types/models/v1_audio_to_video_create_response.py new file mode 100644 index 0000000..67e4892 --- /dev/null +++ b/magic_hour/types/models/v1_audio_to_video_create_response.py @@ -0,0 +1,35 @@ +import pydantic + + +class V1AudioToVideoCreateResponse(pydantic.BaseModel): + """ + Success + """ + + model_config = pydantic.ConfigDict( + arbitrary_types_allowed=True, + populate_by_name=True, + ) + + credits_charged: int = pydantic.Field( + alias="credits_charged", + ) + """ + The amount of credits deducted from your account to generate the video. If the status is not 'complete', this value is an estimate and may be adjusted upon completion based on the actual FPS of the output video. + + If video generation fails, credits will be refunded, and this field will be updated to include the refund. + """ + estimated_frame_cost: int = pydantic.Field( + alias="estimated_frame_cost", + ) + """ + Deprecated: Previously represented the number of frames (original name of our credit system) used for video generation. Use 'credits_charged' instead. + + The amount of frames used to generate the video. If the status is not 'complete', the cost is an estimate and will be adjusted when the video completes. + """ + id: str = pydantic.Field( + alias="id", + ) + """ + Unique ID of the video. Use it with the [Get video Project API](https://docs.magichour.ai/api-reference/video-projects/get-video-details) to fetch status and downloads. + """ diff --git a/magic_hour/types/models/v1_image_projects_get_response.py b/magic_hour/types/models/v1_image_projects_get_response.py index 753f574..c3bb216 100644 --- a/magic_hour/types/models/v1_image_projects_get_response.py +++ b/magic_hour/types/models/v1_image_projects_get_response.py @@ -80,5 +80,5 @@ class V1ImageProjectsGetResponse(pydantic.BaseModel): alias="type", ) """ - The type of the image project. Possible values are FACE_EDITOR, AI_IMAGE_EDITOR, AI_SELFIE, AI_HEADSHOT, AI_IMAGE, AI_MEME, CLOTHES_CHANGER, BACKGROUND_REMOVER, FACE_SWAP, IMAGE_UPSCALER, AI_GIF, QR_CODE, PHOTO_EDITOR, PHOTO_COLORIZER, HEAD_SWAP, BODY_SWAP, STORYBOARD + The type of the image project. Possible values are FACE_EDITOR, AI_IMAGE_EDITOR, AI_SELFIE, AI_HEADSHOT, AI_IMAGE, AI_MEME, CLOTHES_CHANGER, BACKGROUND_REMOVER, FACE_SWAP, IMAGE_UPSCALER, AI_GIF, QR_CODE, PHOTO_EDITOR, PHOTO_COLORIZER, HEAD_SWAP, BODY_SWAP, STORYBOARD, IMAGE_EXPANDER """ diff --git a/magic_hour/types/params/__init__.py b/magic_hour/types/params/__init__.py index 05050e0..adaefec 100644 --- a/magic_hour/types/params/__init__.py +++ b/magic_hour/types/params/__init__.py @@ -145,6 +145,19 @@ _SerializerV1AnimationCreateBodyStyle, ) from .v1_animation_generate_body_assets import V1AnimationGenerateBodyAssets +from .v1_audio_to_video_create_body import ( + V1AudioToVideoCreateBody, + _SerializerV1AudioToVideoCreateBody, +) +from .v1_audio_to_video_create_body_assets import ( + V1AudioToVideoCreateBodyAssets, + _SerializerV1AudioToVideoCreateBodyAssets, +) +from .v1_audio_to_video_create_body_style import ( + V1AudioToVideoCreateBodyStyle, + _SerializerV1AudioToVideoCreateBodyStyle, +) +from .v1_audio_to_video_generate_body_assets import V1AudioToVideoGenerateBodyAssets from .v1_auto_subtitle_generator_create_body import ( V1AutoSubtitleGeneratorCreateBody, _SerializerV1AutoSubtitleGeneratorCreateBody, @@ -343,6 +356,10 @@ "V1AnimationCreateBodyAssets", "V1AnimationCreateBodyStyle", "V1AnimationGenerateBodyAssets", + "V1AudioToVideoCreateBody", + "V1AudioToVideoCreateBodyAssets", + "V1AudioToVideoCreateBodyStyle", + "V1AudioToVideoGenerateBodyAssets", "V1AutoSubtitleGeneratorCreateBody", "V1AutoSubtitleGeneratorCreateBodyAssets", "V1AutoSubtitleGeneratorCreateBodyStyle", @@ -422,6 +439,9 @@ "_SerializerV1AnimationCreateBody", "_SerializerV1AnimationCreateBodyAssets", "_SerializerV1AnimationCreateBodyStyle", + "_SerializerV1AudioToVideoCreateBody", + "_SerializerV1AudioToVideoCreateBodyAssets", + "_SerializerV1AudioToVideoCreateBodyStyle", "_SerializerV1AutoSubtitleGeneratorCreateBody", "_SerializerV1AutoSubtitleGeneratorCreateBodyAssets", "_SerializerV1AutoSubtitleGeneratorCreateBodyStyle", diff --git a/magic_hour/types/params/v1_ai_image_editor_create_body.py b/magic_hour/types/params/v1_ai_image_editor_create_body.py index b48652f..ae39e47 100644 --- a/magic_hour/types/params/v1_ai_image_editor_create_body.py +++ b/magic_hour/types/params/v1_ai_image_editor_create_body.py @@ -59,15 +59,15 @@ class V1AiImageEditorCreateBody(typing_extensions.TypedDict): - Max additional input images: 2 - `nano-banana` - from 50 credits/image - Supported resolutions: 640px, 1k - - Available for tiers: free, creator, pro, business + - Available for tiers: creator, pro, business - Max additional input images: 9 - `nano-banana-2` - from 100 credits/image - Supported resolutions: 640px, 1k, 2k, 4k - - Available for tiers: free, creator, pro, business + - Available for tiers: creator, pro, business - Max additional input images: 9 - `seedream-v4` - from 40 credits/image - Supported resolutions: 640px, 1k, 2k, 4k - - Available for tiers: free, creator, pro, business + - Available for tiers: creator, pro, business - Max additional input images: 9 - `nano-banana-pro` - from 150 credits/image - Supported resolutions: 1k, 2k, 4k diff --git a/magic_hour/types/params/v1_ai_image_generator_create_body.py b/magic_hour/types/params/v1_ai_image_generator_create_body.py index 27c03f5..270ab81 100644 --- a/magic_hour/types/params/v1_ai_image_generator_create_body.py +++ b/magic_hour/types/params/v1_ai_image_generator_create_body.py @@ -53,15 +53,15 @@ class V1AiImageGeneratorCreateBody(typing_extensions.TypedDict): - Image count allowed: 1, 2, 3, 4 - `seedream-v4` - from 40 credits/image - Supported resolutions: 640px, 1k, 2k, 4k - - Available for tiers: free, creator, pro, business + - Available for tiers: creator, pro, business - Image count allowed: 1, 2, 3, 4 - `nano-banana` - from 50 credits/image - Supported resolutions: 640px, 1k - - Available for tiers: free, creator, pro, business + - Available for tiers: creator, pro, business - Image count allowed: 1, 2, 3, 4 - `nano-banana-2` - from 100 credits/image - Supported resolutions: 640px, 1k, 2k, 4k - - Available for tiers: free, creator, pro, business + - Available for tiers: creator, pro, business - Image count allowed: 1, 4, 9, 16 - `nano-banana-pro` - from 150 credits/image - Supported resolutions: 1k, 2k, 4k diff --git a/magic_hour/types/params/v1_ai_voice_generator_create_body_style.py b/magic_hour/types/params/v1_ai_voice_generator_create_body_style.py index 119cc25..79c543d 100644 --- a/magic_hour/types/params/v1_ai_voice_generator_create_body_style.py +++ b/magic_hour/types/params/v1_ai_voice_generator_create_body_style.py @@ -14,64 +14,112 @@ class V1AiVoiceGeneratorCreateBodyStyle(typing_extensions.TypedDict): voice_name: typing_extensions.Required[ typing_extensions.Literal[ + "21 Savage", + "50 Cent", "A.R. Rahman", "Aamir Khan", "Abraham Lincoln", "Adam Driver", + "Adam Sandler", + "Adele", "Ajay Devgn", "Akshay Kumar", + "Al Pacino", "Alain Delon", "Alan Alda", "Alan Cumming", "Alan Rickman", "Albert Einstein", "Alex Trebek", + "Alexandria Ocasio-Cortez", "Alexz Johnson", + "Ali Wong", + "All Might", "Amitabh Bachchan", "Amy Poehler", + "Amy Winehouse", "Ana Gasteyer", + "Ana de Armas", + "Anderson Cooper", + "Andrew Huberman", "Andrew Rannells", "Ang Lee", + "Angelina Jolie", "Anne Hathaway", "Ansel Elgort", "Anthony Anderson", + "Anthony Bourdain", "Anthony Mackie", + "Antonio Banderas", "Arden Cho", + "Ariana Grande", "Armie Hammer", + "Arnold Schwarzenegger", + "Arthur Morgan", "Asa Butterfield", + "Austin Butler", + "Awkwafina", "B.J. Novak", + "BTS Jungkook", + "Bad Bunny", "Barack Obama", "Barbara Eden", + "Barry White", + "Bart Simpson", + "Batman (Animated)", "Bear Grylls", "Ben McKenzie", + "Ben Shapiro", "Ben Stiller", "Ben Whishaw", + "Bender (Futurama)", + "Benedict Cumberbatch", + "Bernie Sanders", "Betty White", + "Beyonce", + "Bill Gates", "Bill Nighy", + "Bill Nye", "Bill Pullman", + "Billie Eilish", "Billie Joe Armstrong", "Bingbing Li", "Blake Shelton", + "Bo Burnham", + "Bob Dylan", + "Bob Marley", + "Bob Odenkirk", + "Bob Ross", "Bonnie Wright", "Booboo Stewart", + "Bowser", "Brad Paisley", + "Brad Pitt", "Bradley Steven Perry", "Brendan Gleeson", "Brian Cox", "Bruno Ganz", "Bruno Mars", + "Bryan Cranston", + "Bugs Bunny", "Burt Reynolds", + "Buzz Lightyear", "Caitriona Balfe", "Caity Lotz", "Cameron Boyce", "Candice Accola", + "Captain Jack Sparrow", + "Cardi B", "Carrie Fisher", "Carrie Underwood", "Casey Affleck", + "Cate Blanchett", "Caterina Scorsone", "Cedric the Entertainer", "Chace Crawford", "Chadwick Boseman", + "Chappell Roan", + "Charles Barkley", "Charles Dance", "Charlie Chaplin", "Charlie Day", @@ -79,86 +127,147 @@ class V1AiVoiceGeneratorCreateBodyStyle(typing_extensions.TypedDict): "Chris Hemsworth", "Chris Martin", "Chris Pine", + "Chris Rock", "Christina Hendricks", "Christina Ricci", "Christopher Mintz-Plasse", + "Christopher Walken", "Cillian Murphy", + "Conan O'Brien", + "Conor McGregor", + "Corpse Husband", + "Cristiano Ronaldo", "Cyndi Lauper", "Dakota Fanning", "Damian Lewis", "Dan Aykroyd", "Dan Fogler", "Dan Stevens", + "Dana White", "Daniel Craig", "Daniel Dae Kim", "Danielle Panabaker", + "Danny DeVito", + "Darth Vader", "Dave Bautista", + "Dave Chappelle", "David Attenborough", + "David Bowie", + "David Goggins", "David Letterman", "David Oyelowo", "David Schwimmer", "David Tennant", + "Deadpool", "Denis Leary", + "Denzel Washington", "Derek Mears", "Diane Keaton", "Diane Kruger", "Dick Van Dyke", "Diego Luna", + "Doja Cat", + "Dolly Parton", "Domhnall Gleeson", "Dominic Cooper", + "Donald Duck", "Donald Glover", "Donald Sutherland", "Donald Trump", + "Donkey (Shrek)", "Donnie Yen", "Doutzen Kroes", "Dove Cameron", "Dr. Dre", + "Dr. Phil", + "Drake", "Drake Bell", + "Dream (Minecraft)", "Drew Carey", + "Dua Lipa", + "Dwayne 'The Rock' Johnson", + "Dwight Schrute", "Eartha Kitt", + "Ed Sheeran", "Eddie Izzard", + "Eddie Murphy", "Edward Asner", + "Edward Elric", "Eli Roth", "Elisabeth Moss", "Elle Fanning", "Ellen Burstyn", + "Ellen DeGeneres", + "Elmo", "Elon Musk", + "Elsa (Frozen)", + "Elvis Presley", "Emile Hirsch", + "Eminem", + "Emma Watson", + "Eren Jaeger", + "Eric Cartman", "Ernie Hudson", "Ezra Miller", "Felicity Jones", "Fergie", "Fiona Shaw", "Florence Henderson", + "Florence Pugh", + "Floyd Mayweather", "Forest Whitaker", "Francia Raisa", + "Frank Sinatra", "Freddie Highmore", + "Freddie Mercury", "Freida Pinto", + "GLaDOS", + "Gabriel Iglesias", + "Gal Gadot", + "Gandalf", "Geena Davis", "Gemma Arterton", + "Geralt of Rivia", "Geri Halliwell", + "Giannis Antetokounmpo", + "Gilbert Gottfried", "Gillian Jacobs", "Gina Carano", "Ginnifer Goodwin", + "Glen Powell", "Glenn Close", "Gloria Steinem", + "Goku", + "Gollum Smeagol", + "Gordon Lightfoot", "Gordon Ramsay", "Greta Gerwig", "Gugu Mbatha-Raw", + "Guy Fieri", "Guy Pearce", "Gwendoline Christie", "Hailee Steinfeld", "Hans Zimmer", + "Harrison Ford", "Harry Connick Jr.", "Harvey Keitel", + "Hasan Minhaj", "Helena Bonham Carter", "Henry Cavill", "Hilary Swank", + "Homer Simpson", + "Howard Stern", "Howie Mandel", "Hugh Bonneville", "Hugh Jackman", "Hugh Laurie", + "Hulk Hogan", + "IShowSpeed", + "Ian McKellen", + "Ice Cube", + "Ice Spice", "Idina Menzel", + "Idris Elba", "Imelda Staunton", "Ingrid Bergman", "Irrfan Khan", @@ -167,56 +276,242 @@ class V1AiVoiceGeneratorCreateBodyStyle(typing_extensions.TypedDict): "J. K. Simmons", "J.J. Abrams", "Jack Black", + "Jack Harlow", "Jack Lemmon", + "Jacksepticeye", + "Jacob Elordi", + "Jake Paul", + "James Corden", "James Earl Jones", + "James May", "Janet Jackson", "Jared Leto", "Jason Bateman", + "Jason Momoa", "Jason Segel", + "Jason Statham", + "Jay-Z", + "Jeff Bezos", "Jeff Goldblum", + "Jenna Ortega", + "Jennifer Aniston", "Jennifer Carpenter", "Jennifer Coolidge", + "Jensen Huang", + "Jeremy Clarkson", + "Jerry Seinfeld", + "Jim Carrey", "Jimmy Fallon", "Joe Biden", + "Joe Pesci", "Joe Rogan", + "Joe Scott", + "John Cena", "John F. Kennedy", + "John Mulaney", + "John Oliver", + "Johnny Depp", "Johnny Galecki", "Jon Favreau", + "Jordan Peterson", "Joseph Gordon-Levitt", "Josh Brolin", "Josh Gad", "Josh Groban", "Julia Louis-Dreyfus", "Julia Roberts", + "Justin Bieber", + "KSI", + "Kai Cenat", + "Kamala Harris", "Kanye West", "Katy Perry", + "Keanu Reeves", + "Keith David", + "Kendrick Lamar", + "Kermit the Frog", "Kesha", "Kevin Bacon", + "Kevin Hart", "Kim Kardashian", + "Kobe Bryant", + "Kratos", "Kris Jenner", "Kristen Bell", "Kristen Stewart", "Kristen Wiig", + "Lady Gaga", + "LeBron James", + "Leonardo DiCaprio", + "Levi Ackerman", + "Lex Fridman", + "Liam Neeson", + "Light Yagami", + "Lil Wayne", + "Linus (LTT)", + "Lionel Messi", + "Lizzo", + "Logan Paul", "Lorde", "Lucille Ball", + "Luffy (One Piece)", + "Luigi", + "Lupita Nyong'o", + "Mahatma Gandhi", + "Margot Robbie", "Marilyn Monroe", + "Mario", + "Mark Hamill", + "Mark Wahlberg", "Mark Zuckerberg", + "Markiplier", + "Martha Stewart", + "Martin Luther King Jr.", + "Master Chief", + "Matt Rife", "Matt Smith", + "Matthew McConaughey", + "Megan Thee Stallion", + "Melissa McCarthy", + "Meryl Streep", + "Metro Boomin", + "Michael B. Jordan", + "Michael Jackson", + "Michael Scott", + "Mickey Mouse", + "Mike Rowe", + "Mike Tyson", + "Miley Cyrus", "Morgan Freeman", + "Morty Smith", + "Mr. Krabs", + "MrBeast", + "Muhammad Ali", + "Narendra Modi", + "Naruto Uzumaki", "Natalie Portman", + "Nate Diaz", + "Neil deGrasse Tyson", + "Nelson Mandela", + "Nicki Minaj", + "Nicolas Cage", + "Nikki Glaser", + "Ninja", + "Notorious B.I.G.", + "Oprah Winfrey", + "Optimus Prime", + "Oscar Isaac", + "Owen Wilson", + "Ozzy Osbourne", + "Pat McAfee", + "Patrick Star", + "Patrick Stewart", + "Patrick Warburton", + "Paul Giamatti", + "Pedro Pascal", + "Penelope Cruz", + "Peso Pluma", + "Peter Griffin", + "PewDiePie", + "Picard", + "Plankton", + "Pokimane", + "Post Malone", "Prince", + "Princess Diana", + "Queen Elizabeth II", + "Quentin Tarantino", + "Rachel Maddow", + "Reese Witherspoon", + "Richard Hammond", + "Rick Sanchez", + "Rihanna", + "Robert De Niro", + "Robert Downey Jr.", + "Robin Williams", "Rooney Mara", + "Ryan Reynolds", + "Ryan Seacrest", + "SZA", + "Sabrina Carpenter", + "Salma Hayek", + "Sam Altman", "Samuel L. Jackson", + "Sandra Bullock", + "Scarlett Johansson", + "Scooby-Doo", "Sean Connery", + "Serena Williams", + "Seth MacFarlane", + "Seth Meyers", + "Seth Rogen", + "Shaggy Rogers", + "Shakira", + "Shannon Sharpe", + "Shaquille O'Neal", + "Shrek", + "Snoop Dogg", + "Sofia Vergara", + "Sonic the Hedgehog", + "SpiderMan (Tom Holland ver.)", + "SpongeBob SquarePants", + "Squidward Tentacles", "Stephen Colbert", + "Stephen Curry", "Steve Carell", + "Steve Harvey", + "Steve Irwin", + "Steve Jobs", + "Stewie Griffin", + "Stone Cold Steve Austin", + "Sydney Sweeney", + "Sylvester Stallone", + "Tanjiro Kamado", "Taylor Swift", + "Terminator", + "Thanos", + "The Joker (Animated)", + "The Undertaker", + "The Weeknd", + "Tim Cook", + "Timothee Chalamet", + "Tom Brady", + "Tom Cruise", + "Tom Hanks", + "Tom Hardy", "Tom Hiddleston", + "Tommy Shelby", + "Tony Stark", + "Travis Scott", + "Trevor Noah", + "Tucker Carlson", + "Tupac Shakur", + "Tyler, The Creator", + "Tyson Fury", + "Usain Bolt", + "Valkyrae", + "Vegeta", + "Vin Diesel", + "Viola Davis", + "Vladimir Putin", + "Walter White", + "Werner Herzog", + "Whitney Houston", + "Will Ferrell", + "Will Smith", + "Willem Dafoe", + "Willie Nelson", + "Winnie the Pooh", + "Winston Churchill", + "Woody (Toy Story)", + "Yoda", + "Zendaya", "Zoe Saldana", + "xQc", ] ] """ - The voice to use for the speech. Available voices: Elon Musk, Mark Zuckerberg, Joe Rogan, Barack Obama, Morgan Freeman, Kanye West, Donald Trump, Joe Biden, Kim Kardashian, Taylor Swift, James Earl Jones, Samuel L. Jackson, Jeff Goldblum, David Attenborough, Sean Connery, Cillian Murphy, Anne Hathaway, Julia Roberts, Natalie Portman, Steve Carell, Amy Poehler, Stephen Colbert, Jimmy Fallon, David Letterman, Alex Trebek, Katy Perry, Prince, Kevin Bacon, Tom Hiddleston, Adam Driver, Alan Rickman, Alexz Johnson, Ana Gasteyer, Andrew Rannells, Arden Cho, Bear Grylls, Ben McKenzie, Ben Stiller, Ben Whishaw, Billie Joe Armstrong, Bingbing Li, Booboo Stewart, Bradley Steven Perry, Bruno Mars, Caity Lotz, Cameron Boyce, Candice Accola, Carrie Underwood, Casey Affleck, Caterina Scorsone, Cedric the Entertainer, Chace Crawford, Chadwick Boseman, Charlie Day, Chris Hemsworth, Chris Martin, Christopher Mintz-Plasse, Dan Fogler, Dan Stevens, Daniel Dae Kim, Danielle Panabaker, Dave Bautista, David Schwimmer, Denis Leary, Derek Mears, Diego Luna, Donald Glover, Donnie Yen, Doutzen Kroes, Dove Cameron, Dr. Dre, Drake Bell, Elle Fanning, Ernie Hudson, Fergie, Forest Whitaker, Francia Raisa, Freddie Highmore, Gillian Jacobs, Gina Carano, Ginnifer Goodwin, Gordon Ramsay, Guy Pearce, Gwendoline Christie, Hailee Steinfeld, Howie Mandel, Hugh Jackman, Hugh Laurie, J. K. Simmons, Jack Black, Jared Leto, Jennifer Carpenter, Kesha, Kris Jenner, Kristen Bell, Lorde, Matt Smith, Marilyn Monroe, Charlie Chaplin, Albert Einstein, Abraham Lincoln, John F. Kennedy, Lucille Ball, A.R. Rahman, Aamir Khan, Ajay Devgn, Akshay Kumar, Alain Delon, Alan Alda, Alan Cumming, Amitabh Bachchan, Ang Lee, Ansel Elgort, Anthony Anderson, Anthony Mackie, Armie Hammer, Asa Butterfield, B.J. Novak, Barbara Eden, Betty White, Bill Nighy, Bill Pullman, Blake Shelton, Bonnie Wright, Brad Paisley, Brendan Gleeson, Brian Cox, Bruno Ganz, Burt Reynolds, Carrie Fisher, Charles Dance, Chiwetel Ejiofor, Chris Pine, Christina Hendricks, Christina Ricci, Cyndi Lauper, Dakota Fanning, Damian Lewis, Dan Aykroyd, Daniel Craig, David Oyelowo, David Tennant, Diane Keaton, Diane Kruger, Dick Van Dyke, Domhnall Gleeson, Dominic Cooper, Donald Sutherland, Drew Carey, Eartha Kitt, Eddie Izzard, Edward Asner, Eli Roth, Elisabeth Moss, Ellen Burstyn, Emile Hirsch, Ezra Miller, Felicity Jones, Fiona Shaw, Florence Henderson, Freida Pinto, Geena Davis, Gemma Arterton, Geri Halliwell, Glenn Close, Gloria Steinem, Greta Gerwig, Gugu Mbatha-Raw, Hans Zimmer, Harry Connick Jr., Harvey Keitel, Helena Bonham Carter, Henry Cavill, Hilary Swank, Hugh Bonneville, Idina Menzel, Imelda Staunton, Ingrid Bergman, Irrfan Khan, Isla Fisher, Iwan Rheon, Jack Lemmon, Janet Jackson, Jason Bateman, Jason Segel, Jennifer Coolidge, Johnny Galecki, Jon Favreau, Joseph Gordon-Levitt, Josh Brolin, Josh Gad, Josh Groban, Julia Louis-Dreyfus, Kristen Stewart, Kristen Wiig, Rooney Mara, Caitriona Balfe, J.J. Abrams, Zoe Saldana + The voice to use for the speech. Available voices: Elon Musk, Mark Zuckerberg, Joe Rogan, Barack Obama, Morgan Freeman, Kanye West, Donald Trump, Joe Biden, Kim Kardashian, Taylor Swift, James Earl Jones, Samuel L. Jackson, Jeff Goldblum, David Attenborough, Sean Connery, Cillian Murphy, Anne Hathaway, Julia Roberts, Natalie Portman, Steve Carell, Amy Poehler, Stephen Colbert, Jimmy Fallon, David Letterman, Alex Trebek, Katy Perry, Prince, Kevin Bacon, Tom Hiddleston, Adam Driver, Alan Rickman, Alexz Johnson, Ana Gasteyer, Andrew Rannells, Arden Cho, Bear Grylls, Ben McKenzie, Ben Stiller, Ben Whishaw, Billie Joe Armstrong, Bingbing Li, Booboo Stewart, Bradley Steven Perry, Bruno Mars, Caity Lotz, Cameron Boyce, Candice Accola, Carrie Underwood, Casey Affleck, Caterina Scorsone, Cedric the Entertainer, Chace Crawford, Chadwick Boseman, Charlie Day, Chris Hemsworth, Chris Martin, Christopher Mintz-Plasse, Dan Fogler, Dan Stevens, Daniel Dae Kim, Danielle Panabaker, Dave Bautista, David Schwimmer, Denis Leary, Derek Mears, Diego Luna, Donald Glover, Donnie Yen, Doutzen Kroes, Dove Cameron, Dr. Dre, Drake Bell, Elle Fanning, Ernie Hudson, Fergie, Forest Whitaker, Francia Raisa, Freddie Highmore, Gillian Jacobs, Gina Carano, Ginnifer Goodwin, Gordon Ramsay, Guy Pearce, Gwendoline Christie, Hailee Steinfeld, Howie Mandel, Hugh Jackman, Hugh Laurie, J. K. Simmons, Jack Black, Jared Leto, Jennifer Carpenter, Kesha, Kris Jenner, Kristen Bell, Lorde, Matt Smith, Marilyn Monroe, Charlie Chaplin, Albert Einstein, Abraham Lincoln, John F. Kennedy, Lucille Ball, A.R. Rahman, Aamir Khan, Ajay Devgn, Akshay Kumar, Alain Delon, Alan Alda, Alan Cumming, Amitabh Bachchan, Ang Lee, Ansel Elgort, Anthony Anderson, Anthony Mackie, Armie Hammer, Asa Butterfield, B.J. Novak, Barbara Eden, Betty White, Bill Nighy, Bill Pullman, Blake Shelton, Bonnie Wright, Brad Paisley, Brendan Gleeson, Brian Cox, Bruno Ganz, Burt Reynolds, Carrie Fisher, Charles Dance, Chiwetel Ejiofor, Chris Pine, Christina Hendricks, Christina Ricci, Cyndi Lauper, Dakota Fanning, Damian Lewis, Dan Aykroyd, Daniel Craig, David Oyelowo, David Tennant, Diane Keaton, Diane Kruger, Dick Van Dyke, Domhnall Gleeson, Dominic Cooper, Donald Sutherland, Drew Carey, Eartha Kitt, Eddie Izzard, Edward Asner, Eli Roth, Elisabeth Moss, Ellen Burstyn, Emile Hirsch, Ezra Miller, Felicity Jones, Fiona Shaw, Florence Henderson, Freida Pinto, Geena Davis, Gemma Arterton, Geri Halliwell, Glenn Close, Gloria Steinem, Greta Gerwig, Gugu Mbatha-Raw, Hans Zimmer, Harry Connick Jr., Harvey Keitel, Helena Bonham Carter, Henry Cavill, Hilary Swank, Hugh Bonneville, Idina Menzel, Imelda Staunton, Ingrid Bergman, Irrfan Khan, Isla Fisher, Iwan Rheon, Jack Lemmon, Janet Jackson, Jason Bateman, Jason Segel, Jennifer Coolidge, Johnny Galecki, Jon Favreau, Joseph Gordon-Levitt, Josh Brolin, Josh Gad, Josh Groban, Julia Louis-Dreyfus, Kristen Stewart, Kristen Wiig, Rooney Mara, Caitriona Balfe, J.J. Abrams, Zoe Saldana, SpongeBob SquarePants, Patrick Star, Squidward Tentacles, Homer Simpson, Bart Simpson, Peter Griffin, Stewie Griffin, Eric Cartman, Rick Sanchez, Bugs Bunny, Mickey Mouse, Donald Duck, Shrek, Donkey (Shrek), Elsa (Frozen), Woody (Toy Story), Buzz Lightyear, Scooby-Doo, Shaggy Rogers, Bender (Futurama), Optimus Prime, Batman (Animated), The Joker (Animated), Darth Vader, Yoda, Gollum Smeagol, Gandalf, Winnie the Pooh, Kermit the Frog, Elmo, SpiderMan (Tom Holland ver.), Mario, Luigi, Sonic the Hedgehog, Naruto Uzumaki, Goku, Vegeta, Light Yagami, Luffy (One Piece), Edward Elric, Eren Jaeger, Levi Ackerman, Tanjiro Kamado, All Might, GLaDOS, Master Chief, Kratos, Arthur Morgan, Geralt of Rivia, Dwayne 'The Rock' Johnson, LeBron James, Shaquille O'Neal, Conor McGregor, Mike Tyson, Kobe Bryant, Floyd Mayweather, Cristiano Ronaldo, Lionel Messi, Serena Williams, Tom Brady, Stephen Curry, John Cena, Hulk Hogan, Stone Cold Steve Austin, The Undertaker, Nate Diaz, Charles Barkley, Shannon Sharpe, Drake, Beyonce, Rihanna, Eminem, Snoop Dogg, Jay-Z, Ed Sheeran, Billie Eilish, Ariana Grande, Adele, Post Malone, Travis Scott, Nicki Minaj, Cardi B, Doja Cat, Bad Bunny, Shakira, Justin Bieber, Sabrina Carpenter, Chappell Roan, Dua Lipa, The Weeknd, Miley Cyrus, Lady Gaga, Kendrick Lamar, Ozzy Osbourne, Freddie Mercury, Elvis Presley, Bob Marley, Frank Sinatra, MrBeast, PewDiePie, Kai Cenat, IShowSpeed, Markiplier, Jacksepticeye, KSI, Logan Paul, Jake Paul, Dream (Minecraft), Corpse Husband, xQc, Pokimane, Valkyrae, Ninja, Joe Scott, Linus (LTT), Ryan Reynolds, Tom Hanks, Robert Downey Jr., Will Smith, Denzel Washington, Leonardo DiCaprio, Brad Pitt, Keanu Reeves, Nicolas Cage, Al Pacino, Robert De Niro, Arnold Schwarzenegger, Sylvester Stallone, Vin Diesel, Jason Statham, Tom Cruise, Johnny Depp, Scarlett Johansson, Angelina Jolie, Jennifer Aniston, Emma Watson, Margot Robbie, Sydney Sweeney, Zendaya, Timothee Chalamet, Pedro Pascal, Oscar Isaac, Benedict Cumberbatch, Ian McKellen, Patrick Stewart, Christopher Walken, Matthew McConaughey, Harrison Ford, Mark Wahlberg, Owen Wilson, Seth Rogen, Kevin Hart, Adam Sandler, Jim Carrey, Eddie Murphy, Robin Williams, Will Ferrell, Melissa McCarthy, Awkwafina, Jason Momoa, Idris Elba, Tom Hardy, Michael B. Jordan, Austin Butler, Glen Powell, Paul Giamatti, Bryan Cranston, Bob Odenkirk, Vladimir Putin, Queen Elizabeth II, Winston Churchill, Martin Luther King Jr., Kamala Harris, Bernie Sanders, Alexandria Ocasio-Cortez, Narendra Modi, Oprah Winfrey, Ellen DeGeneres, Dr. Phil, Steve Harvey, Trevor Noah, John Oliver, James Corden, Ryan Seacrest, Howard Stern, Conan O'Brien, Seth Meyers, Bill Nye, Neil deGrasse Tyson, Guy Fieri, Dave Chappelle, Chris Rock, Jerry Seinfeld, Ali Wong, John Mulaney, Hasan Minhaj, Nikki Glaser, Matt Rife, Gabriel Iglesias, Bo Burnham, Jeff Bezos, Bill Gates, Steve Jobs, Tim Cook, Sam Altman, Jensen Huang, Gilbert Gottfried, James May, Jeremy Clarkson, Richard Hammond, Bob Ross, Anthony Bourdain, David Goggins, Jordan Peterson, Joe Pesci, Danny DeVito, Seth MacFarlane, Patrick Warburton, Keith David, Mark Hamill, Liam Neeson, Antonio Banderas, Sofia Vergara, Penelope Cruz, Gal Gadot, Cate Blanchett, Viola Davis, Meryl Streep, Sandra Bullock, Reese Witherspoon, Salma Hayek, Lupita Nyong'o, Florence Pugh, Jenna Ortega, Ana de Armas, Jacob Elordi, Barry White, Dolly Parton, Willie Nelson, Lil Wayne, 50 Cent, Ice Cube, Tupac Shakur, Notorious B.I.G., Bob Dylan, David Bowie, Michael Jackson, Whitney Houston, Amy Winehouse, SZA, Tyler, The Creator, Thanos, Tony Stark, Captain Jack Sparrow, Walter White, Tommy Shelby, Michael Scott, Dwight Schrute, Bowser, Usain Bolt, Tyson Fury, Dana White, Pat McAfee, Giannis Antetokounmpo, Lex Fridman, Ben Shapiro, Tucker Carlson, Martha Stewart, Gordon Lightfoot, Lizzo, Megan Thee Stallion, Ice Spice, 21 Savage, Metro Boomin, Jack Harlow, Peso Pluma, BTS Jungkook, Quentin Tarantino, Werner Herzog, Anderson Cooper, Rachel Maddow, Mahatma Gandhi, Muhammad Ali, Princess Diana, Nelson Mandela, Steve Irwin, Morty Smith, Andrew Huberman, Willem Dafoe, Mike Rowe, Terminator, Deadpool, Plankton, Mr. Krabs, Picard """ @@ -234,64 +529,112 @@ class _SerializerV1AiVoiceGeneratorCreateBodyStyle(pydantic.BaseModel): alias="prompt", ) voice_name: typing_extensions.Literal[ + "21 Savage", + "50 Cent", "A.R. Rahman", "Aamir Khan", "Abraham Lincoln", "Adam Driver", + "Adam Sandler", + "Adele", "Ajay Devgn", "Akshay Kumar", + "Al Pacino", "Alain Delon", "Alan Alda", "Alan Cumming", "Alan Rickman", "Albert Einstein", "Alex Trebek", + "Alexandria Ocasio-Cortez", "Alexz Johnson", + "Ali Wong", + "All Might", "Amitabh Bachchan", "Amy Poehler", + "Amy Winehouse", "Ana Gasteyer", + "Ana de Armas", + "Anderson Cooper", + "Andrew Huberman", "Andrew Rannells", "Ang Lee", + "Angelina Jolie", "Anne Hathaway", "Ansel Elgort", "Anthony Anderson", + "Anthony Bourdain", "Anthony Mackie", + "Antonio Banderas", "Arden Cho", + "Ariana Grande", "Armie Hammer", + "Arnold Schwarzenegger", + "Arthur Morgan", "Asa Butterfield", + "Austin Butler", + "Awkwafina", "B.J. Novak", + "BTS Jungkook", + "Bad Bunny", "Barack Obama", "Barbara Eden", + "Barry White", + "Bart Simpson", + "Batman (Animated)", "Bear Grylls", "Ben McKenzie", + "Ben Shapiro", "Ben Stiller", "Ben Whishaw", + "Bender (Futurama)", + "Benedict Cumberbatch", + "Bernie Sanders", "Betty White", + "Beyonce", + "Bill Gates", "Bill Nighy", + "Bill Nye", "Bill Pullman", + "Billie Eilish", "Billie Joe Armstrong", "Bingbing Li", "Blake Shelton", + "Bo Burnham", + "Bob Dylan", + "Bob Marley", + "Bob Odenkirk", + "Bob Ross", "Bonnie Wright", "Booboo Stewart", + "Bowser", "Brad Paisley", + "Brad Pitt", "Bradley Steven Perry", "Brendan Gleeson", "Brian Cox", "Bruno Ganz", "Bruno Mars", + "Bryan Cranston", + "Bugs Bunny", "Burt Reynolds", + "Buzz Lightyear", "Caitriona Balfe", "Caity Lotz", "Cameron Boyce", "Candice Accola", + "Captain Jack Sparrow", + "Cardi B", "Carrie Fisher", "Carrie Underwood", "Casey Affleck", + "Cate Blanchett", "Caterina Scorsone", "Cedric the Entertainer", "Chace Crawford", "Chadwick Boseman", + "Chappell Roan", + "Charles Barkley", "Charles Dance", "Charlie Chaplin", "Charlie Day", @@ -299,86 +642,147 @@ class _SerializerV1AiVoiceGeneratorCreateBodyStyle(pydantic.BaseModel): "Chris Hemsworth", "Chris Martin", "Chris Pine", + "Chris Rock", "Christina Hendricks", "Christina Ricci", "Christopher Mintz-Plasse", + "Christopher Walken", "Cillian Murphy", + "Conan O'Brien", + "Conor McGregor", + "Corpse Husband", + "Cristiano Ronaldo", "Cyndi Lauper", "Dakota Fanning", "Damian Lewis", "Dan Aykroyd", "Dan Fogler", "Dan Stevens", + "Dana White", "Daniel Craig", "Daniel Dae Kim", "Danielle Panabaker", + "Danny DeVito", + "Darth Vader", "Dave Bautista", + "Dave Chappelle", "David Attenborough", + "David Bowie", + "David Goggins", "David Letterman", "David Oyelowo", "David Schwimmer", "David Tennant", + "Deadpool", "Denis Leary", + "Denzel Washington", "Derek Mears", "Diane Keaton", "Diane Kruger", "Dick Van Dyke", "Diego Luna", + "Doja Cat", + "Dolly Parton", "Domhnall Gleeson", "Dominic Cooper", + "Donald Duck", "Donald Glover", "Donald Sutherland", "Donald Trump", + "Donkey (Shrek)", "Donnie Yen", "Doutzen Kroes", "Dove Cameron", "Dr. Dre", + "Dr. Phil", + "Drake", "Drake Bell", + "Dream (Minecraft)", "Drew Carey", + "Dua Lipa", + "Dwayne 'The Rock' Johnson", + "Dwight Schrute", "Eartha Kitt", + "Ed Sheeran", "Eddie Izzard", + "Eddie Murphy", "Edward Asner", + "Edward Elric", "Eli Roth", "Elisabeth Moss", "Elle Fanning", "Ellen Burstyn", + "Ellen DeGeneres", + "Elmo", "Elon Musk", + "Elsa (Frozen)", + "Elvis Presley", "Emile Hirsch", + "Eminem", + "Emma Watson", + "Eren Jaeger", + "Eric Cartman", "Ernie Hudson", "Ezra Miller", "Felicity Jones", "Fergie", "Fiona Shaw", "Florence Henderson", + "Florence Pugh", + "Floyd Mayweather", "Forest Whitaker", "Francia Raisa", + "Frank Sinatra", "Freddie Highmore", + "Freddie Mercury", "Freida Pinto", + "GLaDOS", + "Gabriel Iglesias", + "Gal Gadot", + "Gandalf", "Geena Davis", "Gemma Arterton", + "Geralt of Rivia", "Geri Halliwell", + "Giannis Antetokounmpo", + "Gilbert Gottfried", "Gillian Jacobs", "Gina Carano", "Ginnifer Goodwin", + "Glen Powell", "Glenn Close", "Gloria Steinem", + "Goku", + "Gollum Smeagol", + "Gordon Lightfoot", "Gordon Ramsay", "Greta Gerwig", "Gugu Mbatha-Raw", + "Guy Fieri", "Guy Pearce", "Gwendoline Christie", "Hailee Steinfeld", "Hans Zimmer", + "Harrison Ford", "Harry Connick Jr.", "Harvey Keitel", + "Hasan Minhaj", "Helena Bonham Carter", "Henry Cavill", "Hilary Swank", + "Homer Simpson", + "Howard Stern", "Howie Mandel", "Hugh Bonneville", "Hugh Jackman", "Hugh Laurie", + "Hulk Hogan", + "IShowSpeed", + "Ian McKellen", + "Ice Cube", + "Ice Spice", "Idina Menzel", + "Idris Elba", "Imelda Staunton", "Ingrid Bergman", "Irrfan Khan", @@ -387,52 +791,238 @@ class _SerializerV1AiVoiceGeneratorCreateBodyStyle(pydantic.BaseModel): "J. K. Simmons", "J.J. Abrams", "Jack Black", + "Jack Harlow", "Jack Lemmon", + "Jacksepticeye", + "Jacob Elordi", + "Jake Paul", + "James Corden", "James Earl Jones", + "James May", "Janet Jackson", "Jared Leto", "Jason Bateman", + "Jason Momoa", "Jason Segel", + "Jason Statham", + "Jay-Z", + "Jeff Bezos", "Jeff Goldblum", + "Jenna Ortega", + "Jennifer Aniston", "Jennifer Carpenter", "Jennifer Coolidge", + "Jensen Huang", + "Jeremy Clarkson", + "Jerry Seinfeld", + "Jim Carrey", "Jimmy Fallon", "Joe Biden", + "Joe Pesci", "Joe Rogan", + "Joe Scott", + "John Cena", "John F. Kennedy", + "John Mulaney", + "John Oliver", + "Johnny Depp", "Johnny Galecki", "Jon Favreau", + "Jordan Peterson", "Joseph Gordon-Levitt", "Josh Brolin", "Josh Gad", "Josh Groban", "Julia Louis-Dreyfus", "Julia Roberts", + "Justin Bieber", + "KSI", + "Kai Cenat", + "Kamala Harris", "Kanye West", "Katy Perry", + "Keanu Reeves", + "Keith David", + "Kendrick Lamar", + "Kermit the Frog", "Kesha", "Kevin Bacon", + "Kevin Hart", "Kim Kardashian", + "Kobe Bryant", + "Kratos", "Kris Jenner", "Kristen Bell", "Kristen Stewart", "Kristen Wiig", + "Lady Gaga", + "LeBron James", + "Leonardo DiCaprio", + "Levi Ackerman", + "Lex Fridman", + "Liam Neeson", + "Light Yagami", + "Lil Wayne", + "Linus (LTT)", + "Lionel Messi", + "Lizzo", + "Logan Paul", "Lorde", "Lucille Ball", + "Luffy (One Piece)", + "Luigi", + "Lupita Nyong'o", + "Mahatma Gandhi", + "Margot Robbie", "Marilyn Monroe", + "Mario", + "Mark Hamill", + "Mark Wahlberg", "Mark Zuckerberg", + "Markiplier", + "Martha Stewart", + "Martin Luther King Jr.", + "Master Chief", + "Matt Rife", "Matt Smith", + "Matthew McConaughey", + "Megan Thee Stallion", + "Melissa McCarthy", + "Meryl Streep", + "Metro Boomin", + "Michael B. Jordan", + "Michael Jackson", + "Michael Scott", + "Mickey Mouse", + "Mike Rowe", + "Mike Tyson", + "Miley Cyrus", "Morgan Freeman", + "Morty Smith", + "Mr. Krabs", + "MrBeast", + "Muhammad Ali", + "Narendra Modi", + "Naruto Uzumaki", "Natalie Portman", + "Nate Diaz", + "Neil deGrasse Tyson", + "Nelson Mandela", + "Nicki Minaj", + "Nicolas Cage", + "Nikki Glaser", + "Ninja", + "Notorious B.I.G.", + "Oprah Winfrey", + "Optimus Prime", + "Oscar Isaac", + "Owen Wilson", + "Ozzy Osbourne", + "Pat McAfee", + "Patrick Star", + "Patrick Stewart", + "Patrick Warburton", + "Paul Giamatti", + "Pedro Pascal", + "Penelope Cruz", + "Peso Pluma", + "Peter Griffin", + "PewDiePie", + "Picard", + "Plankton", + "Pokimane", + "Post Malone", "Prince", + "Princess Diana", + "Queen Elizabeth II", + "Quentin Tarantino", + "Rachel Maddow", + "Reese Witherspoon", + "Richard Hammond", + "Rick Sanchez", + "Rihanna", + "Robert De Niro", + "Robert Downey Jr.", + "Robin Williams", "Rooney Mara", + "Ryan Reynolds", + "Ryan Seacrest", + "SZA", + "Sabrina Carpenter", + "Salma Hayek", + "Sam Altman", "Samuel L. Jackson", + "Sandra Bullock", + "Scarlett Johansson", + "Scooby-Doo", "Sean Connery", + "Serena Williams", + "Seth MacFarlane", + "Seth Meyers", + "Seth Rogen", + "Shaggy Rogers", + "Shakira", + "Shannon Sharpe", + "Shaquille O'Neal", + "Shrek", + "Snoop Dogg", + "Sofia Vergara", + "Sonic the Hedgehog", + "SpiderMan (Tom Holland ver.)", + "SpongeBob SquarePants", + "Squidward Tentacles", "Stephen Colbert", + "Stephen Curry", "Steve Carell", + "Steve Harvey", + "Steve Irwin", + "Steve Jobs", + "Stewie Griffin", + "Stone Cold Steve Austin", + "Sydney Sweeney", + "Sylvester Stallone", + "Tanjiro Kamado", "Taylor Swift", + "Terminator", + "Thanos", + "The Joker (Animated)", + "The Undertaker", + "The Weeknd", + "Tim Cook", + "Timothee Chalamet", + "Tom Brady", + "Tom Cruise", + "Tom Hanks", + "Tom Hardy", "Tom Hiddleston", + "Tommy Shelby", + "Tony Stark", + "Travis Scott", + "Trevor Noah", + "Tucker Carlson", + "Tupac Shakur", + "Tyler, The Creator", + "Tyson Fury", + "Usain Bolt", + "Valkyrae", + "Vegeta", + "Vin Diesel", + "Viola Davis", + "Vladimir Putin", + "Walter White", + "Werner Herzog", + "Whitney Houston", + "Will Ferrell", + "Will Smith", + "Willem Dafoe", + "Willie Nelson", + "Winnie the Pooh", + "Winston Churchill", + "Woody (Toy Story)", + "Yoda", + "Zendaya", "Zoe Saldana", + "xQc", ] = pydantic.Field( alias="voice_name", ) diff --git a/magic_hour/types/params/v1_audio_to_video_create_body.py b/magic_hour/types/params/v1_audio_to_video_create_body.py new file mode 100644 index 0000000..0d4166d --- /dev/null +++ b/magic_hour/types/params/v1_audio_to_video_create_body.py @@ -0,0 +1,78 @@ +import pydantic +import typing +import typing_extensions + +from .v1_audio_to_video_create_body_assets import ( + V1AudioToVideoCreateBodyAssets, + _SerializerV1AudioToVideoCreateBodyAssets, +) +from .v1_audio_to_video_create_body_style import ( + V1AudioToVideoCreateBodyStyle, + _SerializerV1AudioToVideoCreateBodyStyle, +) + + +class V1AudioToVideoCreateBody(typing_extensions.TypedDict): + """ + V1AudioToVideoCreateBody + """ + + assets: typing_extensions.Required[V1AudioToVideoCreateBodyAssets] + """ + Provide the audio file and an optional reference image. + """ + + end_seconds: typing_extensions.Required[float] + """ + End time of your clip (seconds). Must be greater than start_seconds. + """ + + name: typing_extensions.NotRequired[str] + """ + Give your video a custom name for easy identification. + """ + + resolution: typing_extensions.NotRequired[ + typing_extensions.Literal["1080p", "480p", "720p"] + ] + """ + Output video resolution. Defaults to `720p` on paid tiers and `480p` on free tiers. + """ + + start_seconds: typing_extensions.NotRequired[float] + """ + Start time of your clip (seconds). Must be ≥ 0. + """ + + style: typing_extensions.NotRequired[V1AudioToVideoCreateBodyStyle] + """ + Attributes used to dictate the style of the output + """ + + +class _SerializerV1AudioToVideoCreateBody(pydantic.BaseModel): + """ + Serializer for V1AudioToVideoCreateBody handling case conversions + and file omissions as dictated by the API + """ + + model_config = pydantic.ConfigDict( + populate_by_name=True, + ) + + assets: _SerializerV1AudioToVideoCreateBodyAssets = pydantic.Field( + alias="assets", + ) + end_seconds: float = pydantic.Field( + alias="end_seconds", + ) + name: typing.Optional[str] = pydantic.Field(alias="name", default=None) + resolution: typing.Optional[typing_extensions.Literal["1080p", "480p", "720p"]] = ( + pydantic.Field(alias="resolution", default=None) + ) + start_seconds: typing.Optional[float] = pydantic.Field( + alias="start_seconds", default=None + ) + style: typing.Optional[_SerializerV1AudioToVideoCreateBodyStyle] = pydantic.Field( + alias="style", default=None + ) diff --git a/magic_hour/types/params/v1_audio_to_video_create_body_assets.py b/magic_hour/types/params/v1_audio_to_video_create_body_assets.py new file mode 100644 index 0000000..42da698 --- /dev/null +++ b/magic_hour/types/params/v1_audio_to_video_create_body_assets.py @@ -0,0 +1,47 @@ +import pydantic +import typing +import typing_extensions + + +class V1AudioToVideoCreateBodyAssets(typing_extensions.TypedDict): + """ + Provide the audio file and an optional reference image. + """ + + audio_file_path: typing_extensions.Required[str] + """ + The path of the audio file. 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. + + """ + + image_file_path: typing_extensions.NotRequired[str] + """ + Reference image for the initial frame of the video. 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. + + """ + + +class _SerializerV1AudioToVideoCreateBodyAssets(pydantic.BaseModel): + """ + Serializer for V1AudioToVideoCreateBodyAssets handling case conversions + and file omissions as dictated by the API + """ + + model_config = pydantic.ConfigDict( + populate_by_name=True, + ) + + audio_file_path: str = pydantic.Field( + alias="audio_file_path", + ) + image_file_path: typing.Optional[str] = pydantic.Field( + alias="image_file_path", default=None + ) diff --git a/magic_hour/types/params/v1_audio_to_video_create_body_style.py b/magic_hour/types/params/v1_audio_to_video_create_body_style.py new file mode 100644 index 0000000..bcb7957 --- /dev/null +++ b/magic_hour/types/params/v1_audio_to_video_create_body_style.py @@ -0,0 +1,27 @@ +import pydantic +import typing +import typing_extensions + + +class V1AudioToVideoCreateBodyStyle(typing_extensions.TypedDict): + """ + Attributes used to dictate the style of the output + """ + + prompt: typing_extensions.NotRequired[str] + """ + Prompt to guide the visual style of the video. + """ + + +class _SerializerV1AudioToVideoCreateBodyStyle(pydantic.BaseModel): + """ + Serializer for V1AudioToVideoCreateBodyStyle handling case conversions + and file omissions as dictated by the API + """ + + model_config = pydantic.ConfigDict( + populate_by_name=True, + ) + + prompt: typing.Optional[str] = pydantic.Field(alias="prompt", default=None) diff --git a/magic_hour/types/params/v1_audio_to_video_generate_body_assets.py b/magic_hour/types/params/v1_audio_to_video_generate_body_assets.py new file mode 100644 index 0000000..850de00 --- /dev/null +++ b/magic_hour/types/params/v1_audio_to_video_generate_body_assets.py @@ -0,0 +1,25 @@ +import typing_extensions + + +class V1AudioToVideoGenerateBodyAssets(typing_extensions.TypedDict): + """ + Provide the audio file and an optional reference image. + """ + + audio_file_path: typing_extensions.Required[str] + """ + The path of the audio file. This value is either + - a direct URL to the audio file + - a path to a local file + + Note: if the path begins with `api-assets`, it will be assumed to already be uploaded to Magic Hour's storage, and will not be uploaded again. + """ + + image_file_path: typing_extensions.NotRequired[str] + """ + Reference image for the initial frame of the video. This value is either + - a direct URL to the image file + - a path to a local file + + Note: if the path begins with `api-assets`, it will be assumed to already be uploaded to Magic Hour's storage, and will not be uploaded again. + """ diff --git a/magic_hour/types/params/v1_image_to_video_create_body.py b/magic_hour/types/params/v1_image_to_video_create_body.py index 8098732..6df1175 100644 --- a/magic_hour/types/params/v1_image_to_video_create_body.py +++ b/magic_hour/types/params/v1_image_to_video_create_body.py @@ -49,7 +49,7 @@ class V1ImageToVideoCreateBody(typing_extensions.TypedDict): * **`kling-3.0`**: 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 * **`veo3.1-lite`**: 8, 16, 24, 32, 40, 48, 56 * **`veo3.1`**: 4, 6, 8, 16, 24, 32, 40, 48, 56 - * **`seedance`**: 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12 + * **`seedance`**: 4, 5, 6, 7, 8, 9, 10, 11, 12 * **`seedance-2.0`**: 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 * **`sora-2`**: 4, 8, 12, 24, 36, 48, 60 @@ -84,7 +84,7 @@ class V1ImageToVideoCreateBody(typing_extensions.TypedDict): The AI model to use for video generation. * `default`: uses our currently recommended model for general use. For paid tiers, defaults to `kling-3.0`. For free tiers, it defaults to `ltx-2.3`. - * `ltx-2.3`: Fast iteration with audio, lip-sync, and end frame + * `ltx-2.3`: Fast iteration with lip-sync & end frame * `wan-2.2`: Fast, strong visuals with effects * `kling-2.5`: Motion, action, and camera control * `kling-3.0`: Cinematic, multi-scene storytelling diff --git a/magic_hour/types/params/v1_text_to_video_create_body.py b/magic_hour/types/params/v1_text_to_video_create_body.py index 622be53..ee02a09 100644 --- a/magic_hour/types/params/v1_text_to_video_create_body.py +++ b/magic_hour/types/params/v1_text_to_video_create_body.py @@ -58,7 +58,7 @@ class V1TextToVideoCreateBody(typing_extensions.TypedDict): * **`kling-3.0`**: 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 * **`veo3.1-lite`**: 8, 16, 24, 32, 40, 48, 56 * **`veo3.1`**: 4, 6, 8, 16, 24, 32, 40, 48, 56 - * **`seedance`**: 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12 + * **`seedance`**: 4, 5, 6, 7, 8, 9, 10, 11, 12 * **`seedance-2.0`**: 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 * **`sora-2`**: 4, 8, 12, 24, 36, 48, 60 @@ -86,7 +86,7 @@ class V1TextToVideoCreateBody(typing_extensions.TypedDict): The AI model to use for video generation. * `default`: uses our currently recommended model for general use. For paid tiers, defaults to `kling-3.0`. For free tiers, it defaults to `ltx-2.3`. - * `ltx-2.3`: Fast iteration with audio, lip-sync, and end frame + * `ltx-2.3`: Fast iteration with lip-sync & end frame * `wan-2.2`: Fast, strong visuals with effects * `kling-2.5`: Motion, action, and camera control * `kling-3.0`: Cinematic, multi-scene storytelling diff --git a/pyproject.toml b/pyproject.toml index 1c7e432..fa1bee3 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "magic_hour" -version = "0.63.0" +version = "0.64.0" description = "Python SDK for Magic Hour API" readme = "README.md" authors = [] diff --git a/tests/test_v1_audio_to_video_client.py b/tests/test_v1_audio_to_video_client.py new file mode 100644 index 0000000..3337dca --- /dev/null +++ b/tests/test_v1_audio_to_video_client.py @@ -0,0 +1,89 @@ +import pydantic +import pytest + +from magic_hour import AsyncClient, Client +from magic_hour.environment import Environment +from magic_hour.types import models + + +def test_create_200_success_all_params() -> None: + """Tests a POST request to the /v1/audio-to-video endpoint. + + Operation: create + Test Case ID: success_all_params + Expected Status: 200 + Mode: Synchronous execution + + Response : models.V1AudioToVideoCreateResponse + + Validates: + - Authentication requirements are satisfied + - All required input parameters are properly handled + - Response status code is correct + - Response data matches expected schema + + This test uses example data to verify the endpoint behavior. + """ + # tests calling sync method with example data + client = Client(token="API_TOKEN", environment=Environment.MOCK_SERVER) + response = client.v1.audio_to_video.create( + assets={ + "audio_file_path": "api-assets/id/1234.mp3", + "image_file_path": "api-assets/id/1234.png", + }, + end_seconds=15.0, + name="My Audio To Video video", + resolution="720p", + start_seconds=0.0, + style={"prompt": "Car driving through a city"}, + ) + try: + pydantic.TypeAdapter(models.V1AudioToVideoCreateResponse).validate_python( + response + ) + is_valid_response_schema = True + except pydantic.ValidationError: + is_valid_response_schema = False + assert is_valid_response_schema, "failed response type check" + + +@pytest.mark.asyncio +async def test_await_create_200_success_all_params() -> None: + """Tests a POST request to the /v1/audio-to-video endpoint. + + Operation: create + Test Case ID: success_all_params + Expected Status: 200 + Mode: Asynchronous execution + + Response : models.V1AudioToVideoCreateResponse + + Validates: + - Authentication requirements are satisfied + - All required input parameters are properly handled + - Response status code is correct + - Response data matches expected schema + + This test uses example data to verify the endpoint behavior. + """ + # tests calling async method with example data + client = AsyncClient(token="API_TOKEN", environment=Environment.MOCK_SERVER) + response = await client.v1.audio_to_video.create( + assets={ + "audio_file_path": "api-assets/id/1234.mp3", + "image_file_path": "api-assets/id/1234.png", + }, + end_seconds=15.0, + name="My Audio To Video video", + resolution="720p", + start_seconds=0.0, + style={"prompt": "Car driving through a city"}, + ) + try: + pydantic.TypeAdapter(models.V1AudioToVideoCreateResponse).validate_python( + response + ) + is_valid_response_schema = True + except pydantic.ValidationError: + is_valid_response_schema = False + assert is_valid_response_schema, "failed response type check"