Skip to content

Commit 6153d36

Browse files
magic-hour-sdk-bot[bot]sdk-github-actions[bot]
andauthored
feat(api): allow 1/2 second video using ltx-2 model, add 640px/1k resolution to image generator/editor (#136)
Co-authored-by: sdk-github-actions[bot] <sdk-github-actions[bot]@users.noreply.github.com>
1 parent 4814094 commit 6153d36

19 files changed

Lines changed: 258 additions & 177 deletions

.sdk.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"id": "546e1877-5fc9-48f8-af87-100072c9c2fc",
2+
"id": "a99332c4-395a-42e0-8a2d-833989f9bf84",
33
"tracked_paths": [
44
{
55
"editable": true,

magic_hour/environment.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ class Environment(enum.Enum):
66
"""Pre-defined base URLs for the API"""
77

88
ENVIRONMENT = "https://api.magichour.ai"
9-
MOCK_SERVER = "https://api.sideko.dev/v1/mock/magichour/magic-hour/0.60.0"
9+
MOCK_SERVER = "https://api.sideko.dev/v1/mock/magichour/magic-hour/0.61.1"
1010

1111

1212
def _get_base_url(

magic_hour/resources/v1/ai_image_editor/README.md

Lines changed: 15 additions & 15 deletions
Large diffs are not rendered by default.

magic_hour/resources/v1/ai_image_editor/client.py

Lines changed: 64 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,9 @@ def create(
165165
typing.Optional[str], type_utils.NotGiven
166166
] = type_utils.NOT_GIVEN,
167167
resolution: typing.Union[
168-
typing.Optional[typing_extensions.Literal["2k", "4k", "auto"]],
168+
typing.Optional[
169+
typing_extensions.Literal["1k", "2k", "4k", "640px", "auto"]
170+
],
169171
type_utils.NotGiven,
170172
] = type_utils.NOT_GIVEN,
171173
request_options: typing.Optional[RequestOptions] = None,
@@ -184,40 +186,50 @@ def create(
184186
185187
**Models:**
186188
- `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.
187-
- `qwen-edit` - 10 credits/image
189+
- `qwen-edit` - from 10 credits/image
190+
- Supported resolutions: 640px, 1k, 2k
188191
- Available for tiers: free, creator, pro, business
189-
- Image count allowed: 1
190192
- Max additional input images: 2
191-
- `nano-banana` - 50 credits/image
193+
- `nano-banana` - from 50 credits/image
194+
- Supported resolutions: 640px, 1k
192195
- Available for tiers: free, creator, pro, business
193-
- Image count allowed: 1
194196
- Max additional input images: 9
195-
- `nano-banana-2` - 100 credits/image
197+
- `nano-banana-2` - from 100 credits/image
198+
- Supported resolutions: 640px, 1k, 2k, 4k
196199
- Available for tiers: free, creator, pro, business
197-
- Image count allowed: 1
198200
- Max additional input images: 9
199-
- `seedream-v4` - 50 credits/image
201+
- `seedream-v4` - from 40 credits/image
202+
- Supported resolutions: 640px, 1k, 2k, 4k
200203
- Available for tiers: free, creator, pro, business
201-
- Image count allowed: 1
202204
- Max additional input images: 9
203-
- `nano-banana-pro` - 150 credits/image
205+
- `nano-banana-pro` - from 150 credits/image
206+
- Supported resolutions: 1k, 2k, 4k
204207
- Available for tiers: creator, pro, business
205-
- Image count allowed: 1, 4, 9, 16
206208
- Max additional input images: 9
207-
- `seedream-v4.5` - 100 credits/image
209+
- `seedream-v4.5` - from 50 credits/image
210+
- Supported resolutions: 640px, 1k, 2k, 4k
208211
- Available for tiers: creator, pro, business
209-
- Image count allowed: 1
210212
- Max additional input images: 9
211213
212214
name: Give your image a custom name for easy identification.
213-
resolution: Maximum resolution for the generated image.
215+
resolution: Maximum resolution (longest edge) for the output image.
214216
215217
**Options:**
216-
- `auto` - Automatic resolution (all tiers, default)
217-
- `2k` - Up to 2048px (requires Pro or Business tier)
218-
- `4k` - Up to 4096px (requires Business tier)
219-
220-
Note: Resolution availability depends on your subscription tier. Defaults to `auto` if not specified.
218+
- `640px` — up to 640px
219+
- `1k` — up to 1024px
220+
- `2k` — up to 2048px
221+
- `4k` — up to 4096px
222+
- `auto` — **Deprecated.** Mapped server-side from your subscription tier to the best matching resolution the model supports
223+
224+
**Per-model support:**
225+
- `qwen-edit` - 640px, 1k, 2k
226+
- `nano-banana` - 640px, 1k
227+
- `nano-banana-2` - 640px, 1k, 2k, 4k
228+
- `seedream-v4` - 640px, 1k, 2k, 4k
229+
- `nano-banana-pro` - 1k, 2k, 4k
230+
- `seedream-v4.5` - 640px, 1k, 2k, 4k
231+
232+
Note: Resolution availability depends on the model and your subscription tier.
221233
assets: Provide the assets for image edit
222234
style: V1AiImageEditorCreateBodyStyle
223235
request_options: Additional options to customize the HTTP request
@@ -240,7 +252,7 @@ def create(
240252
image_count=1.0,
241253
model="default",
242254
name="My Ai Image Editor image",
243-
resolution="auto",
255+
resolution="1k",
244256
)
245257
```
246258
"""
@@ -412,7 +424,9 @@ async def create(
412424
typing.Optional[str], type_utils.NotGiven
413425
] = type_utils.NOT_GIVEN,
414426
resolution: typing.Union[
415-
typing.Optional[typing_extensions.Literal["2k", "4k", "auto"]],
427+
typing.Optional[
428+
typing_extensions.Literal["1k", "2k", "4k", "640px", "auto"]
429+
],
416430
type_utils.NotGiven,
417431
] = type_utils.NOT_GIVEN,
418432
request_options: typing.Optional[RequestOptions] = None,
@@ -431,40 +445,50 @@ async def create(
431445
432446
**Models:**
433447
- `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.
434-
- `qwen-edit` - 10 credits/image
448+
- `qwen-edit` - from 10 credits/image
449+
- Supported resolutions: 640px, 1k, 2k
435450
- Available for tiers: free, creator, pro, business
436-
- Image count allowed: 1
437451
- Max additional input images: 2
438-
- `nano-banana` - 50 credits/image
452+
- `nano-banana` - from 50 credits/image
453+
- Supported resolutions: 640px, 1k
439454
- Available for tiers: free, creator, pro, business
440-
- Image count allowed: 1
441455
- Max additional input images: 9
442-
- `nano-banana-2` - 100 credits/image
456+
- `nano-banana-2` - from 100 credits/image
457+
- Supported resolutions: 640px, 1k, 2k, 4k
443458
- Available for tiers: free, creator, pro, business
444-
- Image count allowed: 1
445459
- Max additional input images: 9
446-
- `seedream-v4` - 50 credits/image
460+
- `seedream-v4` - from 40 credits/image
461+
- Supported resolutions: 640px, 1k, 2k, 4k
447462
- Available for tiers: free, creator, pro, business
448-
- Image count allowed: 1
449463
- Max additional input images: 9
450-
- `nano-banana-pro` - 150 credits/image
464+
- `nano-banana-pro` - from 150 credits/image
465+
- Supported resolutions: 1k, 2k, 4k
451466
- Available for tiers: creator, pro, business
452-
- Image count allowed: 1, 4, 9, 16
453467
- Max additional input images: 9
454-
- `seedream-v4.5` - 100 credits/image
468+
- `seedream-v4.5` - from 50 credits/image
469+
- Supported resolutions: 640px, 1k, 2k, 4k
455470
- Available for tiers: creator, pro, business
456-
- Image count allowed: 1
457471
- Max additional input images: 9
458472
459473
name: Give your image a custom name for easy identification.
460-
resolution: Maximum resolution for the generated image.
474+
resolution: Maximum resolution (longest edge) for the output image.
461475
462476
**Options:**
463-
- `auto` - Automatic resolution (all tiers, default)
464-
- `2k` - Up to 2048px (requires Pro or Business tier)
465-
- `4k` - Up to 4096px (requires Business tier)
466-
467-
Note: Resolution availability depends on your subscription tier. Defaults to `auto` if not specified.
477+
- `640px` — up to 640px
478+
- `1k` — up to 1024px
479+
- `2k` — up to 2048px
480+
- `4k` — up to 4096px
481+
- `auto` — **Deprecated.** Mapped server-side from your subscription tier to the best matching resolution the model supports
482+
483+
**Per-model support:**
484+
- `qwen-edit` - 640px, 1k, 2k
485+
- `nano-banana` - 640px, 1k
486+
- `nano-banana-2` - 640px, 1k, 2k, 4k
487+
- `seedream-v4` - 640px, 1k, 2k, 4k
488+
- `nano-banana-pro` - 1k, 2k, 4k
489+
- `seedream-v4.5` - 640px, 1k, 2k, 4k
490+
491+
Note: Resolution availability depends on the model and your subscription tier.
468492
assets: Provide the assets for image edit
469493
style: V1AiImageEditorCreateBodyStyle
470494
request_options: Additional options to customize the HTTP request
@@ -487,7 +511,7 @@ async def create(
487511
image_count=1.0,
488512
model="default",
489513
name="My Ai Image Editor image",
490-
resolution="auto",
514+
resolution="1k",
491515
)
492516
```
493517
"""

0 commit comments

Comments
 (0)