diff --git a/.sdk.json b/.sdk.json index 2349904..07347e0 100644 --- a/.sdk.json +++ b/.sdk.json @@ -1,5 +1,5 @@ { - "id": "546e1877-5fc9-48f8-af87-100072c9c2fc", + "id": "a99332c4-395a-42e0-8a2d-833989f9bf84", "tracked_paths": [ { "editable": true, diff --git a/magic_hour/environment.py b/magic_hour/environment.py index e887fee..aa59d34 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.60.0" + MOCK_SERVER = "https://api.sideko.dev/v1/mock/magichour/magic-hour/0.61.1" def _get_base_url( diff --git a/magic_hour/resources/v1/ai_image_editor/README.md b/magic_hour/resources/v1/ai_image_editor/README.md index 277678e..40a7fd9 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` - 10 credits/image - Available for tiers: free, creator, pro, business - Image count allowed: 1 - Max additional input images: 2 - `nano-banana` - 50 credits/image - Available for tiers: free, creator, pro, business - Image count allowed: 1 - Max additional input images: 9 - `nano-banana-2` - 100 credits/image - Available for tiers: free, creator, pro, business - Image count allowed: 1 - Max additional input images: 9 - `seedream-v4` - 50 credits/image - Available for tiers: free, creator, pro, business - Image count allowed: 1 - Max additional input images: 9 - `nano-banana-pro` - 150 credits/image - Available for tiers: creator, pro, business - Image count allowed: 1, 4, 9, 16 - Max additional input images: 9 - `seedream-v4.5` - 100 credits/image - Available for tiers: creator, pro, business - Image count allowed: 1 - Max additional input images: 9 | `"default"` | -| `name` | ✗ | Give your image a custom name for easy identification. | `"My Ai Image Editor image"` | -| `resolution` | ✗ | Maximum resolution for the generated image. **Options:** - `auto` - Automatic resolution (all tiers, default) - `2k` - Up to 2048px (requires Pro or Business tier) - `4k` - Up to 4096px (requires Business tier) Note: Resolution availability depends on your subscription tier. Defaults to `auto` if not specified. | `"auto"` | +| 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 | `"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 Note: Resolution availability depends on the model and your subscription tier. | `"1k"` | #### Synchronous Client @@ -96,7 +96,7 @@ res = client.v1.ai_image_editor.create( image_count=1.0, model="default", name="My Ai Image Editor image", - resolution="auto", + resolution="1k", ) ``` @@ -114,7 +114,7 @@ res = await client.v1.ai_image_editor.create( image_count=1.0, model="default", name="My Ai Image Editor image", - resolution="auto", + resolution="1k", ) ``` diff --git a/magic_hour/resources/v1/ai_image_editor/client.py b/magic_hour/resources/v1/ai_image_editor/client.py index bccea52..6f04844 100644 --- a/magic_hour/resources/v1/ai_image_editor/client.py +++ b/magic_hour/resources/v1/ai_image_editor/client.py @@ -165,7 +165,9 @@ def create( typing.Optional[str], type_utils.NotGiven ] = type_utils.NOT_GIVEN, resolution: typing.Union[ - typing.Optional[typing_extensions.Literal["2k", "4k", "auto"]], + typing.Optional[ + typing_extensions.Literal["1k", "2k", "4k", "640px", "auto"] + ], type_utils.NotGiven, ] = type_utils.NOT_GIVEN, request_options: typing.Optional[RequestOptions] = None, @@ -184,40 +186,50 @@ def create( **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` - 10 credits/image + - `qwen-edit` - from 10 credits/image + - Supported resolutions: 640px, 1k, 2k - Available for tiers: free, creator, pro, business - - Image count allowed: 1 - Max additional input images: 2 - - `nano-banana` - 50 credits/image + - `nano-banana` - from 50 credits/image + - Supported resolutions: 640px, 1k - Available for tiers: free, creator, pro, business - - Image count allowed: 1 - Max additional input images: 9 - - `nano-banana-2` - 100 credits/image + - `nano-banana-2` - from 100 credits/image + - Supported resolutions: 640px, 1k, 2k, 4k - Available for tiers: free, creator, pro, business - - Image count allowed: 1 - Max additional input images: 9 - - `seedream-v4` - 50 credits/image + - `seedream-v4` - from 40 credits/image + - Supported resolutions: 640px, 1k, 2k, 4k - Available for tiers: free, creator, pro, business - - Image count allowed: 1 - Max additional input images: 9 - - `nano-banana-pro` - 150 credits/image + - `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 - Max additional input images: 9 - - `seedream-v4.5` - 100 credits/image + - `seedream-v4.5` - from 50 credits/image + - Supported resolutions: 640px, 1k, 2k, 4k - Available for tiers: creator, pro, business - - Image count allowed: 1 - Max additional input images: 9 name: Give your image a custom name for easy identification. - resolution: Maximum resolution for the generated image. + resolution: Maximum resolution (longest edge) for the output image. **Options:** - - `auto` - Automatic resolution (all tiers, default) - - `2k` - Up to 2048px (requires Pro or Business tier) - - `4k` - Up to 4096px (requires Business tier) - - Note: Resolution availability depends on your subscription tier. Defaults to `auto` if not specified. + - `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 + + Note: Resolution availability depends on the model and your subscription tier. assets: Provide the assets for image edit style: V1AiImageEditorCreateBodyStyle request_options: Additional options to customize the HTTP request @@ -240,7 +252,7 @@ def create( image_count=1.0, model="default", name="My Ai Image Editor image", - resolution="auto", + resolution="1k", ) ``` """ @@ -412,7 +424,9 @@ async def create( typing.Optional[str], type_utils.NotGiven ] = type_utils.NOT_GIVEN, resolution: typing.Union[ - typing.Optional[typing_extensions.Literal["2k", "4k", "auto"]], + typing.Optional[ + typing_extensions.Literal["1k", "2k", "4k", "640px", "auto"] + ], type_utils.NotGiven, ] = type_utils.NOT_GIVEN, request_options: typing.Optional[RequestOptions] = None, @@ -431,40 +445,50 @@ async def create( **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` - 10 credits/image + - `qwen-edit` - from 10 credits/image + - Supported resolutions: 640px, 1k, 2k - Available for tiers: free, creator, pro, business - - Image count allowed: 1 - Max additional input images: 2 - - `nano-banana` - 50 credits/image + - `nano-banana` - from 50 credits/image + - Supported resolutions: 640px, 1k - Available for tiers: free, creator, pro, business - - Image count allowed: 1 - Max additional input images: 9 - - `nano-banana-2` - 100 credits/image + - `nano-banana-2` - from 100 credits/image + - Supported resolutions: 640px, 1k, 2k, 4k - Available for tiers: free, creator, pro, business - - Image count allowed: 1 - Max additional input images: 9 - - `seedream-v4` - 50 credits/image + - `seedream-v4` - from 40 credits/image + - Supported resolutions: 640px, 1k, 2k, 4k - Available for tiers: free, creator, pro, business - - Image count allowed: 1 - Max additional input images: 9 - - `nano-banana-pro` - 150 credits/image + - `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 - Max additional input images: 9 - - `seedream-v4.5` - 100 credits/image + - `seedream-v4.5` - from 50 credits/image + - Supported resolutions: 640px, 1k, 2k, 4k - Available for tiers: creator, pro, business - - Image count allowed: 1 - Max additional input images: 9 name: Give your image a custom name for easy identification. - resolution: Maximum resolution for the generated image. + resolution: Maximum resolution (longest edge) for the output image. **Options:** - - `auto` - Automatic resolution (all tiers, default) - - `2k` - Up to 2048px (requires Pro or Business tier) - - `4k` - Up to 4096px (requires Business tier) - - Note: Resolution availability depends on your subscription tier. Defaults to `auto` if not specified. + - `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 + + Note: Resolution availability depends on the model and your subscription tier. assets: Provide the assets for image edit style: V1AiImageEditorCreateBodyStyle request_options: Additional options to customize the HTTP request @@ -487,7 +511,7 @@ async def create( image_count=1.0, model="default", name="My Ai Image Editor image", - resolution="auto", + resolution="1k", ) ``` """ diff --git a/magic_hour/resources/v1/ai_image_generator/README.md b/magic_hour/resources/v1/ai_image_generator/README.md index 8f93449..e033a0e 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` 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` - 5 credits/image - Supported resolutions: auto - Available for tiers: free, creator, pro, business - Image count allowed: 1, 2, 3, 4 - `z-image-turbo` - 5 credits/image - Supported resolutions: auto, 2k - Available for tiers: free, creator, pro, business - Image count allowed: 1, 2, 3, 4 - `seedream` - 30 credits/image - Supported resolutions: auto, 2k, 4k - Available for tiers: free, creator, pro, business - Image count allowed: 1, 2, 3, 4 - `nano-banana` - 50 credits/image - Supported resolutions: auto - Available for tiers: free, creator, pro, business - Image count allowed: 1, 2, 3, 4 - `nano-banana-2` - 100 credits/image - Supported resolutions: auto, 2k, 4k - Available for tiers: free, creator, pro, business - Image count allowed: 1, 2, 3, 4 - `nano-banana-pro` - 150 credits/image - Supported resolutions: auto, 2k, 4k - Available for tiers: creator, pro, business - Image count allowed: 1, 4, 9, 16 | `"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 for the generated image. **Options:** - `auto` - Automatic resolution (all tiers, default) - `2k` - Up to 2048px (requires Pro or Business tier) - `4k` - Up to 4096px (requires Business tier) Note: Resolution availability depends on the model and your subscription tier. See `model` field for which resolutions each model supports. Defaults to `auto` if not specified. | `"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: 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, 2, 3, 4 - `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 **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 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 6a4ffa1..aca9b77 100644 --- a/magic_hour/resources/v1/ai_image_generator/client.py +++ b/magic_hour/resources/v1/ai_image_generator/client.py @@ -136,6 +136,7 @@ def create( "nano-banana-2", "nano-banana-pro", "seedream", + "seedream-v4", "z-image-turbo", ] ], @@ -151,7 +152,9 @@ def create( type_utils.NotGiven, ] = type_utils.NOT_GIVEN, resolution: typing.Union[ - typing.Optional[typing_extensions.Literal["2k", "4k", "auto"]], + typing.Optional[ + typing_extensions.Literal["1k", "2k", "4k", "640px", "auto"] + ], type_utils.NotGiven, ] = type_utils.NOT_GIVEN, request_options: typing.Optional[RequestOptions] = None, @@ -169,43 +172,56 @@ def create( **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` - 5 credits/image - - Supported resolutions: auto + - `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` - 5 credits/image - - Supported resolutions: auto, 2k + - `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` - 30 credits/image - - Supported resolutions: auto, 2k, 4k + - `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` - 50 credits/image - - Supported resolutions: auto + - `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` - 100 credits/image - - Supported resolutions: auto, 2k, 4k + - `nano-banana-2` - from 100 credits/image + - Supported resolutions: 640px, 1k, 2k, 4k - Available for tiers: free, creator, pro, business - Image count allowed: 1, 2, 3, 4 - - `nano-banana-pro` - 150 credits/image - - Supported resolutions: auto, 2k, 4k + - `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 + **Deprecated Enum Values:** + - `seedream` - Use `seedream-v4` instead. + name: Give your image a custom name for easy identification. orientation: DEPRECATED: Use `aspect_ratio` instead. The orientation of the output image(s). `aspect_ratio` takes precedence when `orientation` if both are provided. - resolution: Maximum resolution for the generated image. + resolution: Maximum resolution (longest edge) for the output image. **Options:** - - `auto` - Automatic resolution (all tiers, default) - - `2k` - Up to 2048px (requires Pro or Business tier) - - `4k` - Up to 4096px (requires Business tier) - - Note: Resolution availability depends on the model and your subscription tier. See `model` field for which resolutions each model supports. Defaults to `auto` if not specified. + - `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 + + Note: Resolution availability depends on the model and your subscription tier. image_count: Number of images to generate. Maximum varies by model. style: The art style to use for image generation. request_options: Additional options to customize the HTTP request @@ -361,6 +377,7 @@ async def create( "nano-banana-2", "nano-banana-pro", "seedream", + "seedream-v4", "z-image-turbo", ] ], @@ -376,7 +393,9 @@ async def create( type_utils.NotGiven, ] = type_utils.NOT_GIVEN, resolution: typing.Union[ - typing.Optional[typing_extensions.Literal["2k", "4k", "auto"]], + typing.Optional[ + typing_extensions.Literal["1k", "2k", "4k", "640px", "auto"] + ], type_utils.NotGiven, ] = type_utils.NOT_GIVEN, request_options: typing.Optional[RequestOptions] = None, @@ -394,43 +413,56 @@ async def create( **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` - 5 credits/image - - Supported resolutions: auto + - `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` - 5 credits/image - - Supported resolutions: auto, 2k + - `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` - 30 credits/image - - Supported resolutions: auto, 2k, 4k + - `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` - 50 credits/image - - Supported resolutions: auto + - `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` - 100 credits/image - - Supported resolutions: auto, 2k, 4k + - `nano-banana-2` - from 100 credits/image + - Supported resolutions: 640px, 1k, 2k, 4k - Available for tiers: free, creator, pro, business - Image count allowed: 1, 2, 3, 4 - - `nano-banana-pro` - 150 credits/image - - Supported resolutions: auto, 2k, 4k + - `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 + **Deprecated Enum Values:** + - `seedream` - Use `seedream-v4` instead. + name: Give your image a custom name for easy identification. orientation: DEPRECATED: Use `aspect_ratio` instead. The orientation of the output image(s). `aspect_ratio` takes precedence when `orientation` if both are provided. - resolution: Maximum resolution for the generated image. + resolution: Maximum resolution (longest edge) for the output image. **Options:** - - `auto` - Automatic resolution (all tiers, default) - - `2k` - Up to 2048px (requires Pro or Business tier) - - `4k` - Up to 4096px (requires Business tier) - - Note: Resolution availability depends on the model and your subscription tier. See `model` field for which resolutions each model supports. Defaults to `auto` if not specified. + - `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 + + Note: Resolution availability depends on the model and your subscription tier. image_count: Number of images to generate. Maximum varies by model. style: The art style to use for image generation. request_options: Additional options to customize the HTTP request diff --git a/magic_hour/resources/v1/image_to_video/README.md b/magic_hour/resources/v1/image_to_video/README.md index abd034f..4045f51 100644 --- a/magic_hour/resources/v1/image_to_video/README.md +++ b/magic_hour/resources/v1/image_to_video/README.md @@ -99,8 +99,8 @@ For detailed examples, see the [product page](https://magichour.ai/products/imag | `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`**: Not supported * **`wan-2.2`**: Not supported * **`seedance`**: Supports 480p, 720p, 1080p. * **`seedance-2.0`**: Supports 480p, 720p. * **`kling-2.5`**: Supports 1080p. * **`kling-3.0`**: Supports 1080p. * **`sora-2`**: Not supported * **`veo3.1`**: Not supported * **`veo3.1-lite`**: Not supported Legacy models: * **`kling-1.6`**: 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, 4, 5, 6, 7, 8, 9, 10, 15, 20, 25, 30 * **`wan-2.2`**: 3, 4, 5, 6, 7, 8, 9, 10, 15 * **`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 * **`kling-2.5`**: 5, 10 * **`kling-3.0`**: 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 * **`sora-2`**: 4, 8, 12, 24, 36, 48, 60 * **`veo3.1`**: 4, 6, 8, 16, 24, 32, 40, 48, 56 * **`veo3.1-lite`**: 4, 6, 8, 16, 24, 32, 40, 48, 56 Legacy models: * **`kling-1.6`**: 5, 10, 15, 20, 25, 30, 35, 40, 45, 50, 55, 60 | `5.0` | -| `audio` | ✗ | ✗ | Whether to include audio in the video. Defaults to `false` if not specified. Audio support varies by model: * **`ltx-2`**: Automatically included with no extra credits * **`wan-2.2`**: Not supported * **`seedance`**: Not supported * **`seedance-2.0`**: Not supported * **`kling-2.5`**: Automatically included with no extra credits * **`kling-3.0`**: Toggle-able (can enable/disable) * **`sora-2`**: Automatically included with no extra credits * **`veo3.1`**: Toggle-able (can enable/disable) * **`veo3.1-lite`**: Automatically included with no extra credits Legacy models: * **`kling-1.6`**: Not supported | `True` | +| `end_seconds` | ✓ | ✗ | The total duration of the output video in seconds. Supported durations depend on the chosen model: * **`ltx-2`**: 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 * **`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 * **`kling-2.5`**: 5, 10 * **`kling-3.0`**: 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 * **`sora-2`**: 4, 8, 12, 24, 36, 48, 60 * **`veo3.1`**: 4, 6, 8, 16, 24, 32, 40, 48, 56 * **`veo3.1-lite`**: 8, 16, 24, 32, 40, 48, 56 Legacy models: * **`kling-1.6`**: 5, 10, 15, 20, 25, 30, 35, 40, 45, 50, 55, 60 | `5.0` | +| `audio` | ✗ | ✗ | Whether to include audio in the video. Defaults to `false` if not specified. Audio support varies by model: * **`ltx-2`**: Automatically included with no extra credits * **`wan-2.2`**: Not supported * **`seedance`**: Not supported * **`seedance-2.0`**: Not supported * **`kling-2.5`**: Automatically included with no extra credits * **`kling-3.0`**: Toggle-able (can enable/disable) * **`sora-2`**: Automatically included with no extra credits * **`veo3.1`**: Toggle-able (can enable/disable) * **`veo3.1-lite`**: Toggle-able (can enable/disable) Legacy models: * **`kling-1.6`**: Not supported | `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`. * `ltx-2`: Fast iteration with audio and lip-sync * `wan-2.2`: Fast, strong visuals with effects * `seedance`: Fast iteration and start/end frames * `seedance-2.0`: State-of-the-art quality and consistency * `kling-2.5`: Motion, action, and camera control * `kling-3.0`: Cinematic, multi-scene storytelling * `sora-2`: Story-first concepts and creativity * `veo3.1`: Realistic visuals and prompt adherence * `veo3.1-lite`: Good for fast, affordable, high-quality daily generation. Legacy models: * `kling-1.6`: Reliable baseline with smooth motion 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"` | diff --git a/magic_hour/resources/v1/image_to_video/client.py b/magic_hour/resources/v1/image_to_video/client.py index 32f15c8..225548a 100644 --- a/magic_hour/resources/v1/image_to_video/client.py +++ b/magic_hour/resources/v1/image_to_video/client.py @@ -218,7 +218,7 @@ def create( * **`kling-3.0`**: Toggle-able (can enable/disable) * **`sora-2`**: Automatically included with no extra credits * **`veo3.1`**: Toggle-able (can enable/disable) - * **`veo3.1-lite`**: Automatically included with no extra credits + * **`veo3.1-lite`**: Toggle-able (can enable/disable) Legacy models: * **`kling-1.6`**: Not supported @@ -264,7 +264,7 @@ def create( assets: Provide the assets for image-to-video. Sora 2 only supports images with an aspect ratio of `9:16` or `16:9`. end_seconds: The total duration of the output video in seconds. Supported durations depend on the chosen model: - * **`ltx-2`**: 3, 4, 5, 6, 7, 8, 9, 10, 15, 20, 25, 30 + * **`ltx-2`**: 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 * **`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 @@ -272,7 +272,7 @@ def create( * **`kling-3.0`**: 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 * **`sora-2`**: 4, 8, 12, 24, 36, 48, 60 * **`veo3.1`**: 4, 6, 8, 16, 24, 32, 40, 48, 56 - * **`veo3.1-lite`**: 4, 6, 8, 16, 24, 32, 40, 48, 56 + * **`veo3.1-lite`**: 8, 16, 24, 32, 40, 48, 56 Legacy models: * **`kling-1.6`**: 5, 10, 15, 20, 25, 30, 35, 40, 45, 50, 55, 60 @@ -521,7 +521,7 @@ async def create( * **`kling-3.0`**: Toggle-able (can enable/disable) * **`sora-2`**: Automatically included with no extra credits * **`veo3.1`**: Toggle-able (can enable/disable) - * **`veo3.1-lite`**: Automatically included with no extra credits + * **`veo3.1-lite`**: Toggle-able (can enable/disable) Legacy models: * **`kling-1.6`**: Not supported @@ -567,7 +567,7 @@ async def create( assets: Provide the assets for image-to-video. Sora 2 only supports images with an aspect ratio of `9:16` or `16:9`. end_seconds: The total duration of the output video in seconds. Supported durations depend on the chosen model: - * **`ltx-2`**: 3, 4, 5, 6, 7, 8, 9, 10, 15, 20, 25, 30 + * **`ltx-2`**: 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 * **`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 @@ -575,7 +575,7 @@ async def create( * **`kling-3.0`**: 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 * **`sora-2`**: 4, 8, 12, 24, 36, 48, 60 * **`veo3.1`**: 4, 6, 8, 16, 24, 32, 40, 48, 56 - * **`veo3.1-lite`**: 4, 6, 8, 16, 24, 32, 40, 48, 56 + * **`veo3.1-lite`**: 8, 16, 24, 32, 40, 48, 56 Legacy models: * **`kling-1.6`**: 5, 10, 15, 20, 25, 30, 35, 40, 45, 50, 55, 60 diff --git a/magic_hour/resources/v1/text_to_video/README.md b/magic_hour/resources/v1/text_to_video/README.md index cb90677..2d0b6bb 100644 --- a/magic_hour/resources/v1/text_to_video/README.md +++ b/magic_hour/resources/v1/text_to_video/README.md @@ -98,12 +98,12 @@ For detailed examples, see the [product page](https://magichour.ai/products/text | 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, 4, 5, 6, 7, 8, 9, 10, 15, 20, 25, 30 * **`wan-2.2`**: 3, 4, 5, 6, 7, 8, 9, 10, 15 * **`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 * **`kling-2.5`**: 5, 10 * **`kling-3.0`**: 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 * **`sora-2`**: 4, 8, 12, 24, 36, 48, 60 * **`veo3.1`**: 4, 6, 8, 16, 24, 32, 40, 48, 56 * **`veo3.1-lite`**: 4, 6, 8, 16, 24, 32, 40, 48, 56 Legacy models: * **`kling-1.6`**: 5, 10, 15, 20, 25, 30, 35, 40, 45, 50, 55, 60 | `5.0` | +| `end_seconds` | ✓ | ✗ | The total duration of the output video in seconds. Supported durations depend on the chosen model: * **`ltx-2`**: 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 * **`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 * **`kling-2.5`**: 5, 10 * **`kling-3.0`**: 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 * **`sora-2`**: 4, 8, 12, 24, 36, 48, 60 * **`veo3.1`**: 4, 6, 8, 16, 24, 32, 40, 48, 56 * **`veo3.1-lite`**: 8, 16, 24, 32, 40, 48, 56 Legacy models: * **`kling-1.6`**: 5, 10, 15, 20, 25, 30, 35, 40, 45, 50, 55, 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`**: Supports 9:16, 16:9, 1:1. * **`wan-2.2`**: Supports 9:16, 16:9, 1:1. * **`seedance`**: Supports 9:16, 16:9, 1:1. * **`seedance-2.0`**: 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. * **`sora-2`**: Supports 9:16, 16:9. * **`veo3.1`**: Supports 9:16, 16:9. * **`veo3.1-lite`**: Supports 9:16, 16:9. Legacy models: * **`kling-1.6`**: Supports 9:16, 16:9, 1:1. | `"16:9"` | -| `audio` | ✗ | ✗ | Whether to include audio in the video. Defaults to `false` if not specified. Audio support varies by model: * **`ltx-2`**: Automatically included with no extra credits * **`wan-2.2`**: Not supported * **`seedance`**: Not supported * **`seedance-2.0`**: Not supported * **`kling-2.5`**: Automatically included with no extra credits * **`kling-3.0`**: Toggle-able (can enable/disable) * **`sora-2`**: Automatically included with no extra credits * **`veo3.1`**: Toggle-able (can enable/disable) * **`veo3.1-lite`**: Automatically included with no extra credits Legacy models: * **`kling-1.6`**: Not supported | `True` | +| `audio` | ✗ | ✗ | Whether to include audio in the video. Defaults to `false` if not specified. Audio support varies by model: * **`ltx-2`**: Automatically included with no extra credits * **`wan-2.2`**: Not supported * **`seedance`**: Not supported * **`seedance-2.0`**: Not supported * **`kling-2.5`**: Automatically included with no extra credits * **`kling-3.0`**: Toggle-able (can enable/disable) * **`sora-2`**: Automatically included with no extra credits * **`veo3.1`**: Toggle-able (can enable/disable) * **`veo3.1-lite`**: Toggle-able (can enable/disable) Legacy models: * **`kling-1.6`**: Not supported | `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`. * `ltx-2`: Fast iteration with audio and lip-sync * `wan-2.2`: Fast, strong visuals with effects * `seedance`: Fast iteration and start/end frames * `seedance-2.0`: State-of-the-art quality and consistency * `kling-2.5`: Motion, action, and camera control * `kling-3.0`: Cinematic, multi-scene storytelling * `sora-2`: Story-first concepts and creativity * `veo3.1`: Realistic visuals and prompt adherence * `veo3.1-lite`: Good for fast, affordable, high-quality daily generation. Legacy models: * `kling-1.6`: Reliable baseline with smooth motion 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"` | diff --git a/magic_hour/resources/v1/text_to_video/client.py b/magic_hour/resources/v1/text_to_video/client.py index bdc7f8f..a3da698 100644 --- a/magic_hour/resources/v1/text_to_video/client.py +++ b/magic_hour/resources/v1/text_to_video/client.py @@ -225,7 +225,7 @@ def create( * **`kling-3.0`**: Toggle-able (can enable/disable) * **`sora-2`**: Automatically included with no extra credits * **`veo3.1`**: Toggle-able (can enable/disable) - * **`veo3.1-lite`**: Automatically included with no extra credits + * **`veo3.1-lite`**: Toggle-able (can enable/disable) Legacy models: * **`kling-1.6`**: Not supported @@ -264,7 +264,7 @@ def create( * **`kling-1.6`**: Supports 720p, 1080p. end_seconds: The total duration of the output video in seconds. Supported durations depend on the chosen model: - * **`ltx-2`**: 3, 4, 5, 6, 7, 8, 9, 10, 15, 20, 25, 30 + * **`ltx-2`**: 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 * **`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 @@ -272,7 +272,7 @@ def create( * **`kling-3.0`**: 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 * **`sora-2`**: 4, 8, 12, 24, 36, 48, 60 * **`veo3.1`**: 4, 6, 8, 16, 24, 32, 40, 48, 56 - * **`veo3.1-lite`**: 4, 6, 8, 16, 24, 32, 40, 48, 56 + * **`veo3.1-lite`**: 8, 16, 24, 32, 40, 48, 56 Legacy models: * **`kling-1.6`**: 5, 10, 15, 20, 25, 30, 35, 40, 45, 50, 55, 60 @@ -523,7 +523,7 @@ async def create( * **`kling-3.0`**: Toggle-able (can enable/disable) * **`sora-2`**: Automatically included with no extra credits * **`veo3.1`**: Toggle-able (can enable/disable) - * **`veo3.1-lite`**: Automatically included with no extra credits + * **`veo3.1-lite`**: Toggle-able (can enable/disable) Legacy models: * **`kling-1.6`**: Not supported @@ -562,7 +562,7 @@ async def create( * **`kling-1.6`**: Supports 720p, 1080p. end_seconds: The total duration of the output video in seconds. Supported durations depend on the chosen model: - * **`ltx-2`**: 3, 4, 5, 6, 7, 8, 9, 10, 15, 20, 25, 30 + * **`ltx-2`**: 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 * **`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 @@ -570,7 +570,7 @@ async def create( * **`kling-3.0`**: 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 * **`sora-2`**: 4, 8, 12, 24, 36, 48, 60 * **`veo3.1`**: 4, 6, 8, 16, 24, 32, 40, 48, 56 - * **`veo3.1-lite`**: 4, 6, 8, 16, 24, 32, 40, 48, 56 + * **`veo3.1-lite`**: 8, 16, 24, 32, 40, 48, 56 Legacy models: * **`kling-1.6`**: 5, 10, 15, 20, 25, 30, 35, 40, 45, 50, 55, 60 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 b4d67f6..753f574 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 AI_HEADSHOT, AI_IMAGE, IMAGE_UPSCALER, FACE_SWAP, PHOTO_EDITOR, QR_CODE, BACKGROUND_REMOVER, CLOTHES_CHANGER, AI_MEME, FACE_EDITOR, PHOTO_COLORIZER, AI_GIF, AI_SELFIE, AI_IMAGE_EDITOR, HEAD_SWAP, STORYBOARD, BODY_SWAP + 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 """ diff --git a/magic_hour/types/models/v1_video_projects_get_response.py b/magic_hour/types/models/v1_video_projects_get_response.py index aff609b..bfc26c2 100644 --- a/magic_hour/types/models/v1_video_projects_get_response.py +++ b/magic_hour/types/models/v1_video_projects_get_response.py @@ -107,7 +107,7 @@ class V1VideoProjectsGetResponse(pydantic.BaseModel): alias="type", ) """ - The type of the video project. Possible values are ANIMATION, IMAGE_TO_VIDEO, VIDEO_TO_VIDEO, TEXT_TO_VIDEO, FACE_SWAP, LIP_SYNC, AUTO_SUBTITLE, TALKING_PHOTO, UGC_AD, VIDEO_UPSCALER, EXTEND, AUDIO_TO_VIDEO + The type of the video project. Possible values are ANIMATION, AUTO_SUBTITLE, VIDEO_TO_VIDEO, FACE_SWAP, TEXT_TO_VIDEO, IMAGE_TO_VIDEO, LIP_SYNC, TALKING_PHOTO, VIDEO_UPSCALER, EXTEND, AUDIO_TO_VIDEO, UGC_AD """ width: int = pydantic.Field( alias="width", 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 e24cfd3..927a3b6 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 @@ -52,29 +52,29 @@ class V1AiImageEditorCreateBody(typing_extensions.TypedDict): **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` - 10 credits/image + - `qwen-edit` - from 10 credits/image + - Supported resolutions: 640px, 1k, 2k - Available for tiers: free, creator, pro, business - - Image count allowed: 1 - Max additional input images: 2 - - `nano-banana` - 50 credits/image + - `nano-banana` - from 50 credits/image + - Supported resolutions: 640px, 1k - Available for tiers: free, creator, pro, business - - Image count allowed: 1 - Max additional input images: 9 - - `nano-banana-2` - 100 credits/image + - `nano-banana-2` - from 100 credits/image + - Supported resolutions: 640px, 1k, 2k, 4k - Available for tiers: free, creator, pro, business - - Image count allowed: 1 - Max additional input images: 9 - - `seedream-v4` - 50 credits/image + - `seedream-v4` - from 40 credits/image + - Supported resolutions: 640px, 1k, 2k, 4k - Available for tiers: free, creator, pro, business - - Image count allowed: 1 - Max additional input images: 9 - - `nano-banana-pro` - 150 credits/image + - `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 - Max additional input images: 9 - - `seedream-v4.5` - 100 credits/image + - `seedream-v4.5` - from 50 credits/image + - Supported resolutions: 640px, 1k, 2k, 4k - Available for tiers: creator, pro, business - - Image count allowed: 1 - Max additional input images: 9 """ @@ -85,17 +85,27 @@ class V1AiImageEditorCreateBody(typing_extensions.TypedDict): """ resolution: typing_extensions.NotRequired[ - typing_extensions.Literal["2k", "4k", "auto"] + typing_extensions.Literal["1k", "2k", "4k", "640px", "auto"] ] """ - Maximum resolution for the generated image. + Maximum resolution (longest edge) for the output image. **Options:** - - `auto` - Automatic resolution (all tiers, default) - - `2k` - Up to 2048px (requires Pro or Business tier) - - `4k` - Up to 4096px (requires Business tier) + - `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 - Note: Resolution availability depends on your subscription tier. Defaults to `auto` if not specified. + **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 + + Note: Resolution availability depends on the model and your subscription tier. """ style: typing_extensions.Required[V1AiImageEditorCreateBodyStyle] @@ -134,9 +144,9 @@ class _SerializerV1AiImageEditorCreateBody(pydantic.BaseModel): ] ] = pydantic.Field(alias="model", default=None) name: typing.Optional[str] = pydantic.Field(alias="name", default=None) - resolution: typing.Optional[typing_extensions.Literal["2k", "4k", "auto"]] = ( - pydantic.Field(alias="resolution", default=None) - ) + resolution: typing.Optional[ + typing_extensions.Literal["1k", "2k", "4k", "640px", "auto"] + ] = pydantic.Field(alias="resolution", default=None) style: _SerializerV1AiImageEditorCreateBodyStyle = pydantic.Field( alias="style", ) 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 cb51304..efe65bd 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 @@ -33,6 +33,7 @@ class V1AiImageGeneratorCreateBody(typing_extensions.TypedDict): "nano-banana-2", "nano-banana-pro", "seedream", + "seedream-v4", "z-image-turbo", ] ] @@ -41,31 +42,34 @@ class V1AiImageGeneratorCreateBody(typing_extensions.TypedDict): **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` - 5 credits/image - - Supported resolutions: auto + - `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` - 5 credits/image - - Supported resolutions: auto, 2k + - `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` - 30 credits/image - - Supported resolutions: auto, 2k, 4k + - `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` - 50 credits/image - - Supported resolutions: auto + - `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` - 100 credits/image - - Supported resolutions: auto, 2k, 4k + - `nano-banana-2` - from 100 credits/image + - Supported resolutions: 640px, 1k, 2k, 4k - Available for tiers: free, creator, pro, business - Image count allowed: 1, 2, 3, 4 - - `nano-banana-pro` - 150 credits/image - - Supported resolutions: auto, 2k, 4k + - `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 + **Deprecated Enum Values:** + - `seedream` - Use `seedream-v4` instead. + """ name: typing_extensions.NotRequired[str] @@ -83,17 +87,27 @@ class V1AiImageGeneratorCreateBody(typing_extensions.TypedDict): """ resolution: typing_extensions.NotRequired[ - typing_extensions.Literal["2k", "4k", "auto"] + typing_extensions.Literal["1k", "2k", "4k", "640px", "auto"] ] """ - Maximum resolution for the generated image. + Maximum resolution (longest edge) for the output image. **Options:** - - `auto` - Automatic resolution (all tiers, default) - - `2k` - Up to 2048px (requires Pro or Business tier) - - `4k` - Up to 4096px (requires Business tier) + - `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 - Note: Resolution availability depends on the model and your subscription tier. See `model` field for which resolutions each model supports. Defaults to `auto` if not specified. + Note: Resolution availability depends on the model and your subscription tier. """ style: typing_extensions.Required[V1AiImageGeneratorCreateBodyStyle] @@ -126,6 +140,7 @@ class _SerializerV1AiImageGeneratorCreateBody(pydantic.BaseModel): "nano-banana-2", "nano-banana-pro", "seedream", + "seedream-v4", "z-image-turbo", ] ] = pydantic.Field(alias="model", default=None) @@ -133,9 +148,9 @@ class _SerializerV1AiImageGeneratorCreateBody(pydantic.BaseModel): orientation: typing.Optional[ typing_extensions.Literal["landscape", "portrait", "square"] ] = pydantic.Field(alias="orientation", default=None) - resolution: typing.Optional[typing_extensions.Literal["2k", "4k", "auto"]] = ( - pydantic.Field(alias="resolution", default=None) - ) + resolution: typing.Optional[ + typing_extensions.Literal["1k", "2k", "4k", "640px", "auto"] + ] = pydantic.Field(alias="resolution", default=None) style: _SerializerV1AiImageGeneratorCreateBodyStyle = pydantic.Field( alias="style", ) diff --git a/magic_hour/types/params/v1_ai_image_generator_create_body_style.py b/magic_hour/types/params/v1_ai_image_generator_create_body_style.py index 885a0e0..52da92a 100644 --- a/magic_hour/types/params/v1_ai_image_generator_create_body_style.py +++ b/magic_hour/types/params/v1_ai_image_generator_create_body_style.py @@ -21,7 +21,7 @@ class V1AiImageGeneratorCreateBodyStyle(typing_extensions.TypedDict): Legacy quality mode mapping: - `standard` → `z-image-turbo` model - - `pro` → `seedream` model + - `pro` → `seedream-v4` model If model is specified, it will take precedence over the legacy quality_mode field. """ 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 c034a3d..83fd92a 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 @@ -35,7 +35,7 @@ class V1ImageToVideoCreateBody(typing_extensions.TypedDict): * **`kling-3.0`**: Toggle-able (can enable/disable) * **`sora-2`**: Automatically included with no extra credits * **`veo3.1`**: Toggle-able (can enable/disable) - * **`veo3.1-lite`**: Automatically included with no extra credits + * **`veo3.1-lite`**: Toggle-able (can enable/disable) Legacy models: * **`kling-1.6`**: Not supported @@ -45,7 +45,7 @@ class V1ImageToVideoCreateBody(typing_extensions.TypedDict): """ The total duration of the output video in seconds. Supported durations depend on the chosen model: - * **`ltx-2`**: 3, 4, 5, 6, 7, 8, 9, 10, 15, 20, 25, 30 + * **`ltx-2`**: 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 * **`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 @@ -53,7 +53,7 @@ class V1ImageToVideoCreateBody(typing_extensions.TypedDict): * **`kling-3.0`**: 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 * **`sora-2`**: 4, 8, 12, 24, 36, 48, 60 * **`veo3.1`**: 4, 6, 8, 16, 24, 32, 40, 48, 56 - * **`veo3.1-lite`**: 4, 6, 8, 16, 24, 32, 40, 48, 56 + * **`veo3.1-lite`**: 8, 16, 24, 32, 40, 48, 56 Legacy models: * **`kling-1.6`**: 5, 10, 15, 20, 25, 30, 35, 40, 45, 50, 55, 60 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 da21b6e..1a99126 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 @@ -46,7 +46,7 @@ class V1TextToVideoCreateBody(typing_extensions.TypedDict): * **`kling-3.0`**: Toggle-able (can enable/disable) * **`sora-2`**: Automatically included with no extra credits * **`veo3.1`**: Toggle-able (can enable/disable) - * **`veo3.1-lite`**: Automatically included with no extra credits + * **`veo3.1-lite`**: Toggle-able (can enable/disable) Legacy models: * **`kling-1.6`**: Not supported @@ -56,7 +56,7 @@ class V1TextToVideoCreateBody(typing_extensions.TypedDict): """ The total duration of the output video in seconds. Supported durations depend on the chosen model: - * **`ltx-2`**: 3, 4, 5, 6, 7, 8, 9, 10, 15, 20, 25, 30 + * **`ltx-2`**: 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 * **`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 @@ -64,7 +64,7 @@ class V1TextToVideoCreateBody(typing_extensions.TypedDict): * **`kling-3.0`**: 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 * **`sora-2`**: 4, 8, 12, 24, 36, 48, 60 * **`veo3.1`**: 4, 6, 8, 16, 24, 32, 40, 48, 56 - * **`veo3.1-lite`**: 4, 6, 8, 16, 24, 32, 40, 48, 56 + * **`veo3.1-lite`**: 8, 16, 24, 32, 40, 48, 56 Legacy models: * **`kling-1.6`**: 5, 10, 15, 20, 25, 30, 35, 40, 45, 50, 55, 60 diff --git a/pyproject.toml b/pyproject.toml index 8de2242..9c3c411 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "magic_hour" -version = "0.60.0" +version = "0.61.0" description = "Python SDK for Magic Hour API" readme = "README.md" authors = [] diff --git a/tests/test_v1_ai_image_editor_client.py b/tests/test_v1_ai_image_editor_client.py index 4ff86c0..3bece81 100644 --- a/tests/test_v1_ai_image_editor_client.py +++ b/tests/test_v1_ai_image_editor_client.py @@ -36,7 +36,7 @@ def test_create_200_success_all_params() -> None: image_count=1.0, model="default", name="My Ai Image Editor image", - resolution="auto", + resolution="1k", ) try: pydantic.TypeAdapter(models.V1AiImageEditorCreateResponse).validate_python( @@ -79,7 +79,7 @@ async def test_await_create_200_success_all_params() -> None: image_count=1.0, model="default", name="My Ai Image Editor image", - resolution="auto", + resolution="1k", ) try: pydantic.TypeAdapter(models.V1AiImageEditorCreateResponse).validate_python(