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

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .sdk.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"id": "c90fe09f-b516-4af0-b41b-381e051eba94",
"id": "e010c44a-5d62-41e2-b0fe-654712dd6457",
"tracked_paths": [
{
"editable": true,
Expand Down
2 changes: 1 addition & 1 deletion magic_hour/environment.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ class Environment(enum.Enum):
"""Pre-defined base URLs for the API"""

ENVIRONMENT = "https://api.magichour.ai"
MOCK_SERVER = "https://api.sideko.dev/v1/mock/magichour/magic-hour/0.56.0"
MOCK_SERVER = "https://api.sideko.dev/v1/mock/magichour/magic-hour/0.57.0"


def _get_base_url(
Expand Down
3 changes: 3 additions & 0 deletions magic_hour/resources/v1/ai_image_editor/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ Edit images with AI.
| `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"` |

#### Synchronous Client

Expand All @@ -95,6 +96,7 @@ res = client.v1.ai_image_editor.create(
image_count=1.0,
model="default",
name="My Ai Image Editor image",
resolution="auto",
)
```

Expand All @@ -112,6 +114,7 @@ res = await client.v1.ai_image_editor.create(
image_count=1.0,
model="default",
name="My Ai Image Editor image",
resolution="auto",
)
```

Expand Down
38 changes: 38 additions & 0 deletions magic_hour/resources/v1/ai_image_editor/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,10 @@ def generate(
name: typing.Union[
typing.Optional[str], type_utils.NotGiven
] = type_utils.NOT_GIVEN,
resolution: typing.Union[
typing.Optional[typing_extensions.Literal["2k", "4k", "auto"]],
type_utils.NotGiven,
] = type_utils.NOT_GIVEN,
wait_for_completion: bool = True,
download_outputs: bool = True,
download_directory: typing.Optional[str] = None,
Expand Down Expand Up @@ -112,6 +116,7 @@ def generate(
image_count=image_count,
model=model,
name=name,
resolution=resolution,
request_options=request_options,
)
logger.info(f"AI Image Editor response: {create_response}")
Expand Down Expand Up @@ -159,6 +164,10 @@ def create(
name: typing.Union[
typing.Optional[str], type_utils.NotGiven
] = type_utils.NOT_GIVEN,
resolution: typing.Union[
typing.Optional[typing_extensions.Literal["2k", "4k", "auto"]],
type_utils.NotGiven,
] = type_utils.NOT_GIVEN,
request_options: typing.Optional[RequestOptions] = None,
) -> models.V1AiImageEditorCreateResponse:
"""
Expand Down Expand Up @@ -201,6 +210,14 @@ def create(
- Max additional input images: 9

name: Give your image a custom name for easy identification.
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.
assets: Provide the assets for image edit
style: V1AiImageEditorCreateBodyStyle
request_options: Additional options to customize the HTTP request
Expand All @@ -223,6 +240,7 @@ def create(
image_count=1.0,
model="default",
name="My Ai Image Editor image",
resolution="auto",
)
```
"""
Expand All @@ -232,6 +250,7 @@ def create(
"image_count": image_count,
"model": model,
"name": name,
"resolution": resolution,
"assets": assets,
"style": style,
},
Expand Down Expand Up @@ -283,6 +302,10 @@ async def generate(
],
type_utils.NotGiven,
] = type_utils.NOT_GIVEN,
resolution: typing.Union[
typing.Optional[typing_extensions.Literal["2k", "4k", "auto"]],
type_utils.NotGiven,
] = type_utils.NOT_GIVEN,
wait_for_completion: bool = True,
download_outputs: bool = True,
download_directory: typing.Optional[str] = None,
Expand Down Expand Up @@ -340,6 +363,7 @@ async def generate(
aspect_ratio=aspect_ratio,
image_count=image_count,
model=model,
resolution=resolution,
request_options=request_options,
)
logger.info(f"AI Image Editor response: {create_response}")
Expand Down Expand Up @@ -387,6 +411,10 @@ async def create(
name: typing.Union[
typing.Optional[str], type_utils.NotGiven
] = type_utils.NOT_GIVEN,
resolution: typing.Union[
typing.Optional[typing_extensions.Literal["2k", "4k", "auto"]],
type_utils.NotGiven,
] = type_utils.NOT_GIVEN,
request_options: typing.Optional[RequestOptions] = None,
) -> models.V1AiImageEditorCreateResponse:
"""
Expand Down Expand Up @@ -429,6 +457,14 @@ async def create(
- Max additional input images: 9

name: Give your image a custom name for easy identification.
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.
assets: Provide the assets for image edit
style: V1AiImageEditorCreateBodyStyle
request_options: Additional options to customize the HTTP request
Expand All @@ -451,6 +487,7 @@ async def create(
image_count=1.0,
model="default",
name="My Ai Image Editor image",
resolution="auto",
)
```
"""
Expand All @@ -460,6 +497,7 @@ async def create(
"image_count": image_count,
"model": model,
"name": name,
"resolution": resolution,
"assets": assets,
"style": style,
},
Expand Down
Loading
Loading