diff --git a/.sdk.json b/.sdk.json index 2f20076..26172a8 100644 --- a/.sdk.json +++ b/.sdk.json @@ -1,5 +1,5 @@ { - "id": "c188927d-3584-4a2a-b407-ed577a0b44bf", + "id": "41dbe050-66a7-40e4-a5c0-2c5e9bbe5a1d", "tracked_paths": [ { "editable": true, diff --git a/magic_hour/environment.py b/magic_hour/environment.py index 400ad44..99d9033 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.86.0" + MOCK_SERVER = "https://api.sideko.dev/v1/mock/magichour/magic-hour/0.87.0" 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 c26fc9f..57a0fde 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. - `flux-2-klein` - from 5 credits/image - Supported resolutions: 640px, 1k, 2k - Available for tiers: free, creator, pro, business - Max additional input images: 5 - `gpt-image-2` - from 50 credits/image - Supported resolutions: 640px, 1k, 2k, 4k - Available for tiers: creator, pro, business - Max additional input images: 9 - `gpt-image-2.5-flare` - from 100 credits/image - Supported resolutions: 640px, 1k, 2k, 4k - Available for tiers: creator, pro, business - Max additional input images: 9 - `krea-2` - from 10 credits/image - Supported resolutions: 640px, 1k - Available for tiers: free, creator, pro, business - Max additional input images: 1 - `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 - `nano-banana-2-lite` - from 50 credits/image - Supported resolutions: 640px, 1k - 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 - `qwen-edit` - from 10 credits/image - Supported resolutions: 640px, 1k, 2k - Available for tiers: free, creator, pro, business - Max additional input images: 2 - `qwen-image-2.1` - from 10 credits/image - Supported resolutions: 640px, 1k, 2k - Available for tiers: free, creator, pro, business - Max additional input images: 2 - `seedream-v4` - from 40 credits/image - Supported resolutions: 640px, 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 - `seedream-v5-pro` - from 75 credits/image - Supported resolutions: 640px, 1k, 2k - 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:** - `flux-2-klein` - 640px, 1k, 2k - `gpt-image-2` - 640px, 1k, 2k, 4k - `gpt-image-2.5-flare` - 640px, 1k, 2k, 4k - `krea-2` - 640px, 1k - `nano-banana` - 640px, 1k - `nano-banana-2` - 640px, 1k, 2k, 4k - `nano-banana-2-lite` - 640px, 1k - `nano-banana-pro` - 1k, 2k, 4k - `qwen-edit` - 640px, 1k, 2k - `qwen-image-2.1` - 640px, 1k, 2k - `seedream-v4` - 640px, 1k, 2k, 4k - `seedream-v4.5` - 640px, 1k, 2k, 4k - `seedream-v5-pro` - 640px, 1k, 2k 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. - `flux-2-klein` - from 5 credits/image - Supported resolutions: 640px, 1k, 2k - Available for tiers: free, creator, pro, business - Max additional input images: 5 - `gpt-image-2` - from 50 credits/image - Supported resolutions: 640px, 1k, 2k, 4k - Available for tiers: creator, pro, business - Max additional input images: 9 - `gpt-image-2.5-flare` - from 100 credits/image - Supported resolutions: 640px, 1k, 2k, 4k - Available for tiers: creator, pro, business - Max additional input images: 9 - `krea-2` - from 10 credits/image - Supported resolutions: 640px, 1k - Available for tiers: free, creator, pro, business - Max additional input images: 1 - `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 - `nano-banana-2-lite` - from 50 credits/image - Supported resolutions: 640px, 1k - Available for tiers: creator, pro, business - Max additional input images: 9 - `nano-banana-2.1` - from 50 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 - `qwen-edit` - from 10 credits/image - Supported resolutions: 640px, 1k, 2k - Available for tiers: free, creator, pro, business - Max additional input images: 2 - `qwen-image-2.1` - from 10 credits/image - Supported resolutions: 640px, 1k, 2k - Available for tiers: free, creator, pro, business - Max additional input images: 2 - `seedream-v4` - from 40 credits/image - Supported resolutions: 640px, 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 - `seedream-v5-pro` - from 75 credits/image - Supported resolutions: 640px, 1k, 2k - 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:** - `flux-2-klein` - 640px, 1k, 2k - `gpt-image-2` - 640px, 1k, 2k, 4k - `gpt-image-2.5-flare` - 640px, 1k, 2k, 4k - `krea-2` - 640px, 1k - `nano-banana` - 640px, 1k - `nano-banana-2` - 640px, 1k, 2k, 4k - `nano-banana-2-lite` - 640px, 1k - `nano-banana-2.1` - 640px, 1k, 2k, 4k - `nano-banana-pro` - 1k, 2k, 4k - `qwen-edit` - 640px, 1k, 2k - `qwen-image-2.1` - 640px, 1k, 2k - `seedream-v4` - 640px, 1k, 2k, 4k - `seedream-v4.5` - 640px, 1k, 2k, 4k - `seedream-v5-pro` - 640px, 1k, 2k 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 c5d50eb..12202a5 100644 --- a/magic_hour/resources/v1/ai_image_editor/client.py +++ b/magic_hour/resources/v1/ai_image_editor/client.py @@ -52,6 +52,7 @@ def generate( "nano-banana", "nano-banana-2", "nano-banana-2-lite", + "nano-banana-2.1", "nano-banana-pro", "qwen-edit", "qwen-image-2.1", @@ -168,6 +169,7 @@ def create( "nano-banana", "nano-banana-2", "nano-banana-2-lite", + "nano-banana-2.1", "nano-banana-pro", "qwen-edit", "qwen-image-2.1", @@ -231,6 +233,10 @@ def create( - Supported resolutions: 640px, 1k - Available for tiers: creator, pro, business - Max additional input images: 9 + - `nano-banana-2.1` - from 50 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 @@ -274,6 +280,7 @@ def create( - `nano-banana` - 640px, 1k - `nano-banana-2` - 640px, 1k, 2k, 4k - `nano-banana-2-lite` - 640px, 1k + - `nano-banana-2.1` - 640px, 1k, 2k, 4k - `nano-banana-pro` - 1k, 2k, 4k - `qwen-edit` - 640px, 1k, 2k - `qwen-image-2.1` - 640px, 1k, 2k @@ -364,6 +371,7 @@ async def generate( "nano-banana", "nano-banana-2", "nano-banana-2-lite", + "nano-banana-2.1", "nano-banana-pro", "qwen-edit", "qwen-image-2.1", @@ -479,6 +487,7 @@ async def create( "nano-banana", "nano-banana-2", "nano-banana-2-lite", + "nano-banana-2.1", "nano-banana-pro", "qwen-edit", "qwen-image-2.1", @@ -542,6 +551,10 @@ async def create( - Supported resolutions: 640px, 1k - Available for tiers: creator, pro, business - Max additional input images: 9 + - `nano-banana-2.1` - from 50 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 @@ -585,6 +598,7 @@ async def create( - `nano-banana` - 640px, 1k - `nano-banana-2` - 640px, 1k, 2k, 4k - `nano-banana-2-lite` - 640px, 1k + - `nano-banana-2.1` - 640px, 1k, 2k, 4k - `nano-banana-pro` - 1k, 2k, 4k - `qwen-edit` - 640px, 1k, 2k - `qwen-image-2.1` - 640px, 1k, 2k diff --git a/magic_hour/resources/v1/ai_image_generator/README.md b/magic_hour/resources/v1/ai_image_generator/README.md index 1652daa..d680716 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-2-klein` - from 5 credits/image - Supported resolutions: 640px, 1k, 2k - Available for tiers: free, creator, pro, business - Image count allowed: 1 - `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 - `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 - `gpt-image-2.5-flare` - from 100 credits/image - Supported resolutions: 640px, 1k, 2k, 4k - Available for tiers: creator, pro, business - Image count allowed: 1, 2, 3, 4 - `krea-2` - from 10 credits/image - Supported resolutions: 640px, 1k - Available for tiers: free, creator, pro, business - Image count allowed: 1 - `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-2-lite` - from 50 credits/image - Supported resolutions: 640px, 1k - Available for tiers: 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 - `qwen-image-2.1` - from 10 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 - `seedream-v5-pro` - from 75 credits/image - Supported resolutions: 640px, 1k, 2k - Available for tiers: 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 **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-2-klein` - 640px, 1k, 2k - `flux-schnell` - 640px, 1k, 2k - `gpt-image-2` - 640px, 1k, 2k, 4k - `gpt-image-2.5-flare` - 640px, 1k, 2k, 4k - `krea-2` - 640px, 1k - `nano-banana` - 640px, 1k - `nano-banana-2` - 640px, 1k, 2k, 4k - `nano-banana-2-lite` - 640px, 1k - `nano-banana-pro` - 1k, 2k, 4k - `qwen-image-2.1` - 640px, 1k, 2k - `seedream-v4` - 640px, 1k, 2k, 4k - `seedream-v5-pro` - 640px, 1k, 2k - `z-image-turbo` - 640px, 1k, 2k Note: Resolution availability depends on the model and your subscription tier. | `"1k"` | +| 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-2-klein` - from 5 credits/image - Supported resolutions: 640px, 1k, 2k - Available for tiers: free, creator, pro, business - Image count allowed: 1 - `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 - `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 - `gpt-image-2.5-flare` - from 100 credits/image - Supported resolutions: 640px, 1k, 2k, 4k - Available for tiers: creator, pro, business - Image count allowed: 1, 2, 3, 4 - `krea-2` - from 10 credits/image - Supported resolutions: 640px, 1k - Available for tiers: free, creator, pro, business - Image count allowed: 1 - `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-2-lite` - from 50 credits/image - Supported resolutions: 640px, 1k - Available for tiers: creator, pro, business - Image count allowed: 1, 2, 3, 4 - `nano-banana-2.1` - from 50 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 - `qwen-image-2.1` - from 10 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 - `seedream-v5-pro` - from 75 credits/image - Supported resolutions: 640px, 1k, 2k - Available for tiers: 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 **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-2-klein` - 640px, 1k, 2k - `flux-schnell` - 640px, 1k, 2k - `gpt-image-2` - 640px, 1k, 2k, 4k - `gpt-image-2.5-flare` - 640px, 1k, 2k, 4k - `krea-2` - 640px, 1k - `nano-banana` - 640px, 1k - `nano-banana-2` - 640px, 1k, 2k, 4k - `nano-banana-2-lite` - 640px, 1k - `nano-banana-2.1` - 640px, 1k, 2k, 4k - `nano-banana-pro` - 1k, 2k, 4k - `qwen-image-2.1` - 640px, 1k, 2k - `seedream-v4` - 640px, 1k, 2k, 4k - `seedream-v5-pro` - 640px, 1k, 2k - `z-image-turbo` - 640px, 1k, 2k Note: Resolution availability depends on the model and your subscription tier. | `"1k"` | #### 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 65e0919..3efe4f4 100644 --- a/magic_hour/resources/v1/ai_image_generator/client.py +++ b/magic_hour/resources/v1/ai_image_generator/client.py @@ -45,6 +45,7 @@ def generate( "nano-banana", "nano-banana-2", "nano-banana-2-lite", + "nano-banana-2.1", "nano-banana-pro", "qwen-image-2.1", "seedream", @@ -151,6 +152,7 @@ def create( "nano-banana", "nano-banana-2", "nano-banana-2-lite", + "nano-banana-2.1", "nano-banana-pro", "qwen-image-2.1", "seedream", @@ -223,6 +225,10 @@ def create( - Supported resolutions: 640px, 1k - Available for tiers: creator, pro, business - Image count allowed: 1, 2, 3, 4 + - `nano-banana-2.1` - from 50 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 @@ -269,6 +275,7 @@ def create( - `nano-banana` - 640px, 1k - `nano-banana-2` - 640px, 1k, 2k, 4k - `nano-banana-2-lite` - 640px, 1k + - `nano-banana-2.1` - 640px, 1k, 2k, 4k - `nano-banana-pro` - 1k, 2k, 4k - `qwen-image-2.1` - 640px, 1k, 2k - `seedream-v4` - 640px, 1k, 2k, 4k @@ -355,6 +362,7 @@ async def generate( "nano-banana", "nano-banana-2", "nano-banana-2-lite", + "nano-banana-2.1", "nano-banana-pro", "qwen-image-2.1", "seedream", @@ -451,6 +459,7 @@ async def create( "nano-banana", "nano-banana-2", "nano-banana-2-lite", + "nano-banana-2.1", "nano-banana-pro", "qwen-image-2.1", "seedream", @@ -523,6 +532,10 @@ async def create( - Supported resolutions: 640px, 1k - Available for tiers: creator, pro, business - Image count allowed: 1, 2, 3, 4 + - `nano-banana-2.1` - from 50 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 @@ -569,6 +582,7 @@ async def create( - `nano-banana` - 640px, 1k - `nano-banana-2` - 640px, 1k, 2k, 4k - `nano-banana-2-lite` - 640px, 1k + - `nano-banana-2.1` - 640px, 1k, 2k, 4k - `nano-banana-pro` - 1k, 2k, 4k - `qwen-image-2.1` - 640px, 1k, 2k - `seedream-v4` - 640px, 1k, 2k, 4k diff --git a/magic_hour/resources/v1/ai_talking_photo/README.md b/magic_hour/resources/v1/ai_talking_photo/README.md index 35baa45..746c7be 100644 --- a/magic_hour/resources/v1/ai_talking_photo/README.md +++ b/magic_hour/resources/v1/ai_talking_photo/README.md @@ -70,7 +70,7 @@ res = await client.v1.ai_talking_photo.generate( ### AI Talking Photo -Create a talking photo from an image and audio or text input. +Create a talking photo video from an image and an audio file. **API Endpoint**: `POST /v1/ai-talking-photo` @@ -84,7 +84,7 @@ Create a talking photo from an image and audio or text input. | `end_seconds` | ✓ | The end time of the input audio in seconds. Maximum clip length depends on style.generation_mode: realistic 300s, prompted 45s. | `15.0` | | `start_seconds` | ✓ | The start time of the input audio in seconds. Maximum clip length depends on style.generation_mode: realistic 300s, prompted 45s. | `0.0` | | `max_resolution` | ✗ | Constrains the larger dimension (height or width) of the output video. Allows you to set a lower resolution than your plan's maximum if desired. The value is capped by your plan's max resolution. | `1024` | -| `name` | ✗ | Give your image a custom name for easy identification. | `"My Talking Photo image"` | +| `name` | ✗ | Give your video a custom name for easy identification. | `"My Talking Photo video"` | | `style` | ✗ | Attributes used to dictate the style of the output | `{"generation_mode": "realistic"}` | | `└─ generation_mode` | ✗ | Controls overall motion style. * `realistic` - Maintains likeness well, high quality, and reliable. * `prompted` - Slightly lower likeness; allows option to prompt scene. **Deprecated values (maintained for backward compatibility):** * `pro` - Deprecated: use `realistic` * `standard` - Deprecated: use `prompted` * `stable` - Deprecated: use `realistic` * `expressive` - Deprecated: use `prompted` | `"realistic"` | | `└─ intensity` | ✗ | Note: this value is only applicable when generation_mode is `expressive`. The value can include up to 2 decimal places. * Lower values yield more stability but can suppress mouth movement. * Higher values increase motion and expressiveness, with a higher risk of distortion. | `123.0` | @@ -105,7 +105,7 @@ res = client.v1.ai_talking_photo.create( end_seconds=15.0, start_seconds=0.0, max_resolution=1024, - name="My Talking Photo image", + name="My Talking Photo video", ) ``` @@ -124,7 +124,7 @@ res = await client.v1.ai_talking_photo.create( end_seconds=15.0, start_seconds=0.0, max_resolution=1024, - name="My Talking Photo image", + name="My Talking Photo video", ) ``` diff --git a/magic_hour/resources/v1/ai_talking_photo/client.py b/magic_hour/resources/v1/ai_talking_photo/client.py index c0cae3c..2ff9ea7 100644 --- a/magic_hour/resources/v1/ai_talking_photo/client.py +++ b/magic_hour/resources/v1/ai_talking_photo/client.py @@ -129,13 +129,13 @@ def create( """ AI Talking Photo - Create a talking photo from an image and audio or text input. + Create a talking photo video from an image and an audio file. POST /v1/ai-talking-photo Args: max_resolution: Constrains the larger dimension (height or width) of the output video. Allows you to set a lower resolution than your plan's maximum if desired. The value is capped by your plan's max resolution. - name: Give your image a custom name for easy identification. + name: Give your video a custom name for easy identification. style: Attributes used to dictate the style of the output assets: Provide the assets for creating a talking photo end_seconds: The end time of the input audio in seconds. Maximum clip length depends on style.generation_mode: realistic 300s, prompted 45s. @@ -159,7 +159,7 @@ def create( end_seconds=15.0, start_seconds=0.0, max_resolution=1024, - name="My Talking Photo image", + name="My Talking Photo video", ) ``` """ @@ -293,13 +293,13 @@ async def create( """ AI Talking Photo - Create a talking photo from an image and audio or text input. + Create a talking photo video from an image and an audio file. POST /v1/ai-talking-photo Args: max_resolution: Constrains the larger dimension (height or width) of the output video. Allows you to set a lower resolution than your plan's maximum if desired. The value is capped by your plan's max resolution. - name: Give your image a custom name for easy identification. + name: Give your video a custom name for easy identification. style: Attributes used to dictate the style of the output assets: Provide the assets for creating a talking photo end_seconds: The end time of the input audio in seconds. Maximum clip length depends on style.generation_mode: realistic 300s, prompted 45s. @@ -323,7 +323,7 @@ async def create( end_seconds=15.0, start_seconds=0.0, max_resolution=1024, - name="My Talking Photo image", + name="My Talking Photo video", ) ``` """ 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 4367d3e..43f9ed9 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 @@ -46,6 +46,7 @@ class V1AiImageEditorCreateBody(typing_extensions.TypedDict): "nano-banana", "nano-banana-2", "nano-banana-2-lite", + "nano-banana-2.1", "nano-banana-pro", "qwen-edit", "qwen-image-2.1", @@ -87,6 +88,10 @@ class V1AiImageEditorCreateBody(typing_extensions.TypedDict): - Supported resolutions: 640px, 1k - Available for tiers: creator, pro, business - Max additional input images: 9 + - `nano-banana-2.1` - from 50 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 @@ -140,6 +145,7 @@ class V1AiImageEditorCreateBody(typing_extensions.TypedDict): - `nano-banana` - 640px, 1k - `nano-banana-2` - 640px, 1k, 2k, 4k - `nano-banana-2-lite` - 640px, 1k + - `nano-banana-2.1` - 640px, 1k, 2k, 4k - `nano-banana-pro` - 1k, 2k, 4k - `qwen-edit` - 640px, 1k, 2k - `qwen-image-2.1` - 640px, 1k, 2k @@ -184,6 +190,7 @@ class _SerializerV1AiImageEditorCreateBody(pydantic.BaseModel): "nano-banana", "nano-banana-2", "nano-banana-2-lite", + "nano-banana-2.1", "nano-banana-pro", "qwen-edit", "qwen-image-2.1", 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 342e404..f95375c 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 @@ -36,6 +36,7 @@ class V1AiImageGeneratorCreateBody(typing_extensions.TypedDict): "nano-banana", "nano-banana-2", "nano-banana-2-lite", + "nano-banana-2.1", "nano-banana-pro", "qwen-image-2.1", "seedream", @@ -81,6 +82,10 @@ class V1AiImageGeneratorCreateBody(typing_extensions.TypedDict): - Supported resolutions: 640px, 1k - Available for tiers: creator, pro, business - Image count allowed: 1, 2, 3, 4 + - `nano-banana-2.1` - from 50 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 @@ -143,6 +148,7 @@ class V1AiImageGeneratorCreateBody(typing_extensions.TypedDict): - `nano-banana` - 640px, 1k - `nano-banana-2` - 640px, 1k, 2k, 4k - `nano-banana-2-lite` - 640px, 1k + - `nano-banana-2.1` - 640px, 1k, 2k, 4k - `nano-banana-pro` - 1k, 2k, 4k - `qwen-image-2.1` - 640px, 1k, 2k - `seedream-v4` - 640px, 1k, 2k, 4k @@ -185,6 +191,7 @@ class _SerializerV1AiImageGeneratorCreateBody(pydantic.BaseModel): "nano-banana", "nano-banana-2", "nano-banana-2-lite", + "nano-banana-2.1", "nano-banana-pro", "qwen-image-2.1", "seedream", diff --git a/magic_hour/types/params/v1_ai_talking_photo_create_body.py b/magic_hour/types/params/v1_ai_talking_photo_create_body.py index af994c3..3eeb8d8 100644 --- a/magic_hour/types/params/v1_ai_talking_photo_create_body.py +++ b/magic_hour/types/params/v1_ai_talking_photo_create_body.py @@ -34,7 +34,7 @@ class V1AiTalkingPhotoCreateBody(typing_extensions.TypedDict): name: typing_extensions.NotRequired[str] """ - Give your image a custom name for easy identification. + Give your video a custom name for easy identification. """ start_seconds: typing_extensions.Required[float] diff --git a/pyproject.toml b/pyproject.toml index 4d34ec8..b557edb 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "magic_hour" -version = "0.86.0" +version = "0.87.0" description = "Python SDK for Magic Hour API" readme = "README.md" authors = [] diff --git a/tests/test_v1_ai_talking_photo_client.py b/tests/test_v1_ai_talking_photo_client.py index bc50942..3b9d0fd 100644 --- a/tests/test_v1_ai_talking_photo_client.py +++ b/tests/test_v1_ai_talking_photo_client.py @@ -34,7 +34,7 @@ def test_create_200_success_all_params() -> None: end_seconds=15.0, start_seconds=0.0, max_resolution=1024, - name="My Talking Photo image", + name="My Talking Photo video", style={"generation_mode": "realistic", "intensity": 123.45, "prompt": "string"}, ) try: @@ -76,7 +76,7 @@ async def test_await_create_200_success_all_params() -> None: end_seconds=15.0, start_seconds=0.0, max_resolution=1024, - name="My Talking Photo image", + name="My Talking Photo video", style={"generation_mode": "realistic", "intensity": 123.45, "prompt": "string"}, ) try: