magic-hour 0.45.0 → 0.47.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (47) hide show
  1. package/dist/environment.d.ts +1 -1
  2. package/dist/environment.js +1 -1
  3. package/dist/resources/v1/ai-image-editor/resource-client.d.ts +1 -1
  4. package/dist/resources/v1/ai-image-editor/resource-client.js +1 -1
  5. package/dist/resources/v1/ai-image-generator/request-types.d.ts +48 -4
  6. package/dist/resources/v1/ai-image-generator/request-types.js +30 -2
  7. package/dist/resources/v1/ai-image-generator/resource-client.d.ts +1 -1
  8. package/dist/resources/v1/ai-image-generator/resource-client.js +1 -1
  9. package/dist/resources/v1/ai-talking-photo/request-types.d.ts +5 -0
  10. package/dist/resources/v1/ai-talking-photo/request-types.js +4 -0
  11. package/dist/resources/v1/image-to-video/request-types.d.ts +29 -7
  12. package/dist/resources/v1/image-to-video/request-types.js +24 -0
  13. package/dist/resources/v1/text-to-video/request-types.d.ts +41 -12
  14. package/dist/resources/v1/text-to-video/request-types.js +30 -2
  15. package/dist/types/index.d.ts +6 -0
  16. package/dist/types/v1-ai-image-editor-create-body-style-model-enum.d.ts +2 -1
  17. package/dist/types/v1-ai-image-editor-create-body-style.d.ts +2 -1
  18. package/dist/types/v1-ai-image-generator-create-body-aspect-ratio-enum.d.ts +4 -0
  19. package/dist/types/v1-ai-image-generator-create-body-aspect-ratio-enum.js +2 -0
  20. package/dist/types/v1-ai-image-generator-create-body-model-enum.d.ts +24 -0
  21. package/dist/types/v1-ai-image-generator-create-body-model-enum.js +2 -0
  22. package/dist/types/v1-ai-image-generator-create-body-orientation-enum.d.ts +3 -1
  23. package/dist/types/v1-ai-image-generator-create-body-resolution-enum.d.ts +11 -0
  24. package/dist/types/v1-ai-image-generator-create-body-resolution-enum.js +2 -0
  25. package/dist/types/v1-ai-image-generator-create-body-style-quality-mode-enum.d.ts +5 -5
  26. package/dist/types/v1-ai-image-generator-create-body-style.d.ts +5 -5
  27. package/dist/types/v1-ai-image-generator-create-body.d.ts +48 -4
  28. package/dist/types/v1-ai-image-generator-create-body.js +30 -2
  29. package/dist/types/v1-ai-talking-photo-create-body.d.ts +5 -0
  30. package/dist/types/v1-ai-talking-photo-create-body.js +4 -0
  31. package/dist/types/v1-image-projects-get-response.d.ts +1 -1
  32. package/dist/types/v1-image-to-video-create-body-assets.d.ts +1 -1
  33. package/dist/types/v1-image-to-video-create-body-model-enum.d.ts +11 -0
  34. package/dist/types/v1-image-to-video-create-body-model-enum.js +2 -0
  35. package/dist/types/v1-image-to-video-create-body-resolution-enum.d.ts +7 -6
  36. package/dist/types/v1-image-to-video-create-body.d.ts +29 -7
  37. package/dist/types/v1-image-to-video-create-body.js +24 -0
  38. package/dist/types/v1-text-to-video-create-body-aspect-ratio-enum.d.ts +10 -0
  39. package/dist/types/v1-text-to-video-create-body-aspect-ratio-enum.js +2 -0
  40. package/dist/types/v1-text-to-video-create-body-model-enum.d.ts +11 -0
  41. package/dist/types/v1-text-to-video-create-body-model-enum.js +2 -0
  42. package/dist/types/v1-text-to-video-create-body-orientation-enum.d.ts +1 -1
  43. package/dist/types/v1-text-to-video-create-body-resolution-enum.d.ts +7 -6
  44. package/dist/types/v1-text-to-video-create-body.d.ts +41 -12
  45. package/dist/types/v1-text-to-video-create-body.js +30 -2
  46. package/dist/types/v1-video-projects-get-response.d.ts +1 -1
  47. package/package.json +1 -1
@@ -8,13 +8,13 @@ export type V1AiImageGeneratorCreateBodyStyle = {
8
8
  */
9
9
  prompt: string;
10
10
  /**
11
- * Controls the quality of the generated image. Defaults to 'standard' if not specified.
11
+ * DEPRECATED: Use `model` field instead for explicit model selection.
12
12
  *
13
- * **Options:**
14
- * - `standard` - Standard quality generation. Cost: 5 credits per image.
15
- * - `pro` - Pro quality generation with enhanced details and quality. Cost: 30 credits per image.
13
+ * Legacy quality mode mapping:
14
+ * - `standard` → `z-image-turbo` model
15
+ * - `pro` → `seedream` model
16
16
  *
17
- * Note: Pro mode is available for users on Creator, Pro, or Business tier.
17
+ * If model is specified, it will take precedence over the legacy quality_mode field.
18
18
  */
19
19
  qualityMode?: ("pro" | "standard") | undefined;
20
20
  /**
@@ -5,17 +5,58 @@ import { External$V1AiImageGeneratorCreateBodyStyle, V1AiImageGeneratorCreateBod
5
5
  */
6
6
  export type V1AiImageGeneratorCreateBody = {
7
7
  /**
8
- * Number of images to generate.
8
+ * The aspect ratio of the output image(s). If not specified, defaults to `1:1` (square).
9
+ */
10
+ aspectRatio?: ("16:9" | "1:1" | "9:16") | undefined;
11
+ /**
12
+ * Number of images to generate. Maximum varies by model.
9
13
  */
10
14
  imageCount: number;
15
+ /**
16
+ * The AI model to use for image generation. Each model has different capabilities and costs.
17
+ *
18
+ * **Models:**
19
+ * - `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.
20
+ * - `flux-schnell` - 5 credits/image
21
+ * - Supported resolutions: auto
22
+ * - Available for tiers: free, creator, pro, business
23
+ * - Image count allowed: 1, 2, 3, 4
24
+ * - `z-image-turbo` - 5 credits/image
25
+ * - Supported resolutions: auto, 2k
26
+ * - Available for tiers: free, creator, pro, business
27
+ * - Image count allowed: 1, 2, 3, 4
28
+ * - `seedream` - 30 credits/image
29
+ * - Supported resolutions: auto, 2k, 4k
30
+ * - Available for tiers: free, creator, pro, business
31
+ * - Image count allowed: 1, 2, 3, 4
32
+ * - `nano-banana-pro` - 150 credits/image
33
+ * - Supported resolutions: auto
34
+ * - Available for tiers: creator, pro, business
35
+ * - Image count allowed: 1, 4, 9, 16
36
+ *
37
+ */
38
+ model?: ("default" | "flux-schnell" | "nano-banana-pro" | "seedream" | "z-image-turbo") | undefined;
11
39
  /**
12
40
  * Give your image a custom name for easy identification.
13
41
  */
14
42
  name?: string | undefined;
15
43
  /**
16
- * The orientation of the output image(s).
44
+ * DEPRECATED: Use `aspect_ratio` instead.
45
+ *
46
+ * The orientation of the output image(s). `aspect_ratio` takes precedence when `orientation` if both are provided.
47
+ */
48
+ orientation?: ("landscape" | "portrait" | "square") | undefined;
49
+ /**
50
+ * Maximum resolution for the generated image.
51
+ *
52
+ * **Options:**
53
+ * - `auto` - Automatic resolution (all tiers, default)
54
+ * - `2k` - Up to 2048px (requires Pro or Business tier)
55
+ * - `4k` - Up to 4096px (requires Business tier)
56
+ *
57
+ * 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.
17
58
  */
18
- orientation: "landscape" | "portrait" | "square";
59
+ resolution?: ("2k" | "4k" | "auto") | undefined;
19
60
  /**
20
61
  * The art style to use for image generation.
21
62
  */
@@ -27,9 +68,12 @@ export type V1AiImageGeneratorCreateBody = {
27
68
  * we expect to come in as network data
28
69
  */
29
70
  export type External$V1AiImageGeneratorCreateBody = {
71
+ aspect_ratio?: ("16:9" | "1:1" | "9:16") | undefined;
30
72
  image_count: number;
73
+ model?: ("default" | "flux-schnell" | "nano-banana-pro" | "seedream" | "z-image-turbo") | undefined;
31
74
  name?: string | undefined;
32
- orientation: "landscape" | "portrait" | "square";
75
+ orientation?: ("landscape" | "portrait" | "square") | undefined;
76
+ resolution?: ("2k" | "4k" | "auto") | undefined;
33
77
  style: External$V1AiImageGeneratorCreateBodyStyle;
34
78
  };
35
79
  export declare const Schemas$V1AiImageGeneratorCreateBody: {
@@ -42,16 +42,30 @@ const v1_ai_image_generator_create_body_style_1 = require("./v1-ai-image-generat
42
42
  */
43
43
  const SchemaIn$V1AiImageGeneratorCreateBody = z
44
44
  .object({
45
+ aspect_ratio: z.enum(["16:9", "1:1", "9:16"]).optional(),
45
46
  image_count: z.number().int(),
47
+ model: z
48
+ .enum([
49
+ "default",
50
+ "flux-schnell",
51
+ "nano-banana-pro",
52
+ "seedream",
53
+ "z-image-turbo",
54
+ ])
55
+ .optional(),
46
56
  name: z.string().optional(),
47
- orientation: z.enum(["landscape", "portrait", "square"]),
57
+ orientation: z.enum(["landscape", "portrait", "square"]).optional(),
58
+ resolution: z.enum(["2k", "4k", "auto"]).optional(),
48
59
  style: v1_ai_image_generator_create_body_style_1.Schemas$V1AiImageGeneratorCreateBodyStyle.in,
49
60
  })
50
61
  .transform((obj) => {
51
62
  return (0, make_api_request_js_1.zodTransform)(obj, {
63
+ aspect_ratio: "aspectRatio",
52
64
  image_count: "imageCount",
65
+ model: "model",
53
66
  name: "name",
54
67
  orientation: "orientation",
68
+ resolution: "resolution",
55
69
  style: "style",
56
70
  });
57
71
  });
@@ -61,16 +75,30 @@ const SchemaIn$V1AiImageGeneratorCreateBody = z
61
75
  */
62
76
  const SchemaOut$V1AiImageGeneratorCreateBody = z
63
77
  .object({
78
+ aspectRatio: z.enum(["16:9", "1:1", "9:16"]).optional(),
64
79
  imageCount: z.number().int(),
80
+ model: z
81
+ .enum([
82
+ "default",
83
+ "flux-schnell",
84
+ "nano-banana-pro",
85
+ "seedream",
86
+ "z-image-turbo",
87
+ ])
88
+ .optional(),
65
89
  name: z.string().optional(),
66
- orientation: z.enum(["landscape", "portrait", "square"]),
90
+ orientation: z.enum(["landscape", "portrait", "square"]).optional(),
91
+ resolution: z.enum(["2k", "4k", "auto"]).optional(),
67
92
  style: v1_ai_image_generator_create_body_style_1.Schemas$V1AiImageGeneratorCreateBodyStyle.out,
68
93
  })
69
94
  .transform((obj) => {
70
95
  return (0, make_api_request_js_1.zodTransform)(obj, {
96
+ aspectRatio: "aspect_ratio",
71
97
  imageCount: "image_count",
98
+ model: "model",
72
99
  name: "name",
73
100
  orientation: "orientation",
101
+ resolution: "resolution",
74
102
  style: "style",
75
103
  });
76
104
  });
@@ -13,6 +13,10 @@ export type V1AiTalkingPhotoCreateBody = {
13
13
  * The end time of the input audio in seconds. The maximum duration allowed is 60 seconds.
14
14
  */
15
15
  endSeconds: number;
16
+ /**
17
+ * 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.
18
+ */
19
+ maxResolution?: number | undefined;
16
20
  /**
17
21
  * Give your image a custom name for easy identification.
18
22
  */
@@ -34,6 +38,7 @@ export type V1AiTalkingPhotoCreateBody = {
34
38
  export type External$V1AiTalkingPhotoCreateBody = {
35
39
  assets: External$V1AiTalkingPhotoCreateBodyAssets;
36
40
  end_seconds: number;
41
+ max_resolution?: number | undefined;
37
42
  name?: string | undefined;
38
43
  start_seconds: number;
39
44
  style?: External$V1AiTalkingPhotoCreateBodyStyle | undefined;
@@ -45,6 +45,7 @@ const SchemaIn$V1AiTalkingPhotoCreateBody = z
45
45
  .object({
46
46
  assets: v1_ai_talking_photo_create_body_assets_1.Schemas$V1AiTalkingPhotoCreateBodyAssets.in,
47
47
  end_seconds: z.number(),
48
+ max_resolution: z.number().int().optional(),
48
49
  name: z.string().optional(),
49
50
  start_seconds: z.number(),
50
51
  style: v1_ai_talking_photo_create_body_style_1.Schemas$V1AiTalkingPhotoCreateBodyStyle.in.optional(),
@@ -53,6 +54,7 @@ const SchemaIn$V1AiTalkingPhotoCreateBody = z
53
54
  return (0, make_api_request_js_1.zodTransform)(obj, {
54
55
  assets: "assets",
55
56
  end_seconds: "endSeconds",
57
+ max_resolution: "maxResolution",
56
58
  name: "name",
57
59
  start_seconds: "startSeconds",
58
60
  style: "style",
@@ -66,6 +68,7 @@ const SchemaOut$V1AiTalkingPhotoCreateBody = z
66
68
  .object({
67
69
  assets: v1_ai_talking_photo_create_body_assets_1.Schemas$V1AiTalkingPhotoCreateBodyAssets.out,
68
70
  endSeconds: z.number(),
71
+ maxResolution: z.number().int().optional(),
69
72
  name: z.string().optional(),
70
73
  startSeconds: z.number(),
71
74
  style: v1_ai_talking_photo_create_body_style_1.Schemas$V1AiTalkingPhotoCreateBodyStyle.out.optional(),
@@ -74,6 +77,7 @@ const SchemaOut$V1AiTalkingPhotoCreateBody = z
74
77
  return (0, make_api_request_js_1.zodTransform)(obj, {
75
78
  assets: "assets",
76
79
  endSeconds: "end_seconds",
80
+ maxResolution: "max_resolution",
77
81
  name: "name",
78
82
  startSeconds: "start_seconds",
79
83
  style: "style",
@@ -42,7 +42,7 @@ export type V1ImageProjectsGetResponse = {
42
42
  */
43
43
  totalFrameCost: number;
44
44
  /**
45
- * 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
45
+ * 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
46
46
  */
47
47
  type: string;
48
48
  };
@@ -1,6 +1,6 @@
1
1
  import * as z from "zod";
2
2
  /**
3
- * Provide the assets for image-to-video.
3
+ * Provide the assets for image-to-video. Sora 2 only supports images with an aspect ratio of `9:16` or `16:9`.
4
4
  */
5
5
  export type V1ImageToVideoCreateBodyAssets = {
6
6
  /**
@@ -0,0 +1,11 @@
1
+ /**
2
+ * The AI model to use for video generation.
3
+ * * `default`: Our recommended model for general use (Kling 2.5 Audio). Note: For backward compatibility, if you use default and end_seconds > 10, we'll fall back to Kling 1.6.
4
+ * * `seedance`: Great for fast iteration and start/end frame
5
+ * * `kling-2.5-audio`: Great for motion, action, and camera control
6
+ * * `sora-2`: Great for story-telling, dialogue & creativity
7
+ * * `veo3.1-audio`: Great for dialogue + SFX generated natively
8
+ * * `veo3.1`: Great for realism, polish, & prompt adherence
9
+ * * `kling-1.6`: Great for dependable clips with smooth motion
10
+ */
11
+ export type V1ImageToVideoCreateBodyModelEnum = "default" | "kling-1.6" | "kling-2.5-audio" | "seedance" | "sora-2" | "veo3.1" | "veo3.1-audio";
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,11 +1,12 @@
1
1
  /**
2
2
  * Controls the output video resolution. Defaults to `720p` if not specified.
3
3
  *
4
- * 480p and 720p are available on Creator, Pro, or Business tiers. However, 1080p require Pro or Business tier.
5
- *
6
- * **Options:**
7
- * - `480p` - Supports only 5 or 10 second videos. Output: 24fps. Cost: 120 credits per 5 seconds.
8
- * - `720p` - Supports videos between 5-60 seconds. Output: 30fps. Cost: 300 credits per 5 seconds.
9
- * - `1080p` - Supports videos between 5-60 seconds. Output: 30fps. Cost: 600 credits per 5 seconds.
4
+ * * **Default**: Supports `480p`, `720p`, and `1080p`.
5
+ * * **Seedance**: Supports `480p`, `720p`, `1080p`.
6
+ * * **Kling 2.5 Audio**: Supports `720p`, `1080p`.
7
+ * * **Sora 2**: Supports `720p`.
8
+ * * **Veo 3.1 Audio**: Supports `720p`, `1080p`.
9
+ * * **Veo 3.1**: Supports `720p`, `1080p`.
10
+ * * **Kling 1.6**: Supports `720p`, `1080p`.
10
11
  */
11
12
  export type V1ImageToVideoCreateBodyResolutionEnum = "1080p" | "480p" | "720p";
@@ -6,11 +6,20 @@ import { External$V1ImageToVideoCreateBodyStyle, V1ImageToVideoCreateBodyStyle }
6
6
  */
7
7
  export type V1ImageToVideoCreateBody = {
8
8
  /**
9
- * Provide the assets for image-to-video.
9
+ * Provide the assets for image-to-video. Sora 2 only supports images with an aspect ratio of `9:16` or `16:9`.
10
10
  */
11
11
  assets: V1ImageToVideoCreateBodyAssets;
12
12
  /**
13
13
  * The total duration of the output video in seconds.
14
+ *
15
+ * Supported durations depend on the chosen model:
16
+ * * **Default**: 5-60 seconds (either 5 or 10 for 480p).
17
+ * * **Seedance**: 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12
18
+ * * **Kling 2.5 Audio**: 5, 10
19
+ * * **Sora 2**: 4, 8, 12, 24, 36, 48, 60
20
+ * * **Veo 3.1 Audio**: 4, 6, 8, 16, 24, 32, 40, 48, 56
21
+ * * **Veo 3.1**: 4, 6, 8, 16, 24, 32, 40, 48, 56
22
+ * * **Kling 1.6**: 5, 10, 15, 20, 25, 30, 35, 40, 45, 50, 55, 60
14
23
  */
15
24
  endSeconds: number;
16
25
  /**
@@ -23,6 +32,17 @@ export type V1ImageToVideoCreateBody = {
23
32
  * This field is retained only for backward compatibility and will be removed in a future release.
24
33
  */
25
34
  height?: number | null | undefined;
35
+ /**
36
+ * The AI model to use for video generation.
37
+ * * `default`: Our recommended model for general use (Kling 2.5 Audio). Note: For backward compatibility, if you use default and end_seconds > 10, we'll fall back to Kling 1.6.
38
+ * * `seedance`: Great for fast iteration and start/end frame
39
+ * * `kling-2.5-audio`: Great for motion, action, and camera control
40
+ * * `sora-2`: Great for story-telling, dialogue & creativity
41
+ * * `veo3.1-audio`: Great for dialogue + SFX generated natively
42
+ * * `veo3.1`: Great for realism, polish, & prompt adherence
43
+ * * `kling-1.6`: Great for dependable clips with smooth motion
44
+ */
45
+ model?: ("default" | "kling-1.6" | "kling-2.5-audio" | "seedance" | "sora-2" | "veo3.1" | "veo3.1-audio") | undefined;
26
46
  /**
27
47
  * Give your video a custom name for easy identification.
28
48
  */
@@ -30,12 +50,13 @@ export type V1ImageToVideoCreateBody = {
30
50
  /**
31
51
  * Controls the output video resolution. Defaults to `720p` if not specified.
32
52
  *
33
- * 480p and 720p are available on Creator, Pro, or Business tiers. However, 1080p require Pro or Business tier.
34
- *
35
- * **Options:**
36
- * - `480p` - Supports only 5 or 10 second videos. Output: 24fps. Cost: 120 credits per 5 seconds.
37
- * - `720p` - Supports videos between 5-60 seconds. Output: 30fps. Cost: 300 credits per 5 seconds.
38
- * - `1080p` - Supports videos between 5-60 seconds. Output: 30fps. Cost: 600 credits per 5 seconds.
53
+ * * **Default**: Supports `480p`, `720p`, and `1080p`.
54
+ * * **Seedance**: Supports `480p`, `720p`, `1080p`.
55
+ * * **Kling 2.5 Audio**: Supports `720p`, `1080p`.
56
+ * * **Sora 2**: Supports `720p`.
57
+ * * **Veo 3.1 Audio**: Supports `720p`, `1080p`.
58
+ * * **Veo 3.1**: Supports `720p`, `1080p`.
59
+ * * **Kling 1.6**: Supports `720p`, `1080p`.
39
60
  */
40
61
  resolution?: ("1080p" | "480p" | "720p") | undefined;
41
62
  /**
@@ -62,6 +83,7 @@ export type External$V1ImageToVideoCreateBody = {
62
83
  assets: External$V1ImageToVideoCreateBodyAssets;
63
84
  end_seconds: number;
64
85
  height?: number | null | undefined;
86
+ model?: ("default" | "kling-1.6" | "kling-2.5-audio" | "seedance" | "sora-2" | "veo3.1" | "veo3.1-audio") | undefined;
65
87
  name?: string | undefined;
66
88
  resolution?: ("1080p" | "480p" | "720p") | undefined;
67
89
  style?: External$V1ImageToVideoCreateBodyStyle | undefined;
@@ -46,6 +46,17 @@ const SchemaIn$V1ImageToVideoCreateBody = z
46
46
  assets: v1_image_to_video_create_body_assets_1.Schemas$V1ImageToVideoCreateBodyAssets.in,
47
47
  end_seconds: z.number(),
48
48
  height: z.number().int().nullable().optional(),
49
+ model: z
50
+ .enum([
51
+ "default",
52
+ "kling-1.6",
53
+ "kling-2.5-audio",
54
+ "seedance",
55
+ "sora-2",
56
+ "veo3.1",
57
+ "veo3.1-audio",
58
+ ])
59
+ .optional(),
49
60
  name: z.string().optional(),
50
61
  resolution: z.enum(["1080p", "480p", "720p"]).optional(),
51
62
  style: v1_image_to_video_create_body_style_1.Schemas$V1ImageToVideoCreateBodyStyle.in.optional(),
@@ -56,6 +67,7 @@ const SchemaIn$V1ImageToVideoCreateBody = z
56
67
  assets: "assets",
57
68
  end_seconds: "endSeconds",
58
69
  height: "height",
70
+ model: "model",
59
71
  name: "name",
60
72
  resolution: "resolution",
61
73
  style: "style",
@@ -71,6 +83,17 @@ const SchemaOut$V1ImageToVideoCreateBody = z
71
83
  assets: v1_image_to_video_create_body_assets_1.Schemas$V1ImageToVideoCreateBodyAssets.out,
72
84
  endSeconds: z.number(),
73
85
  height: z.number().int().nullable().optional(),
86
+ model: z
87
+ .enum([
88
+ "default",
89
+ "kling-1.6",
90
+ "kling-2.5-audio",
91
+ "seedance",
92
+ "sora-2",
93
+ "veo3.1",
94
+ "veo3.1-audio",
95
+ ])
96
+ .optional(),
74
97
  name: z.string().optional(),
75
98
  resolution: z.enum(["1080p", "480p", "720p"]).optional(),
76
99
  style: v1_image_to_video_create_body_style_1.Schemas$V1ImageToVideoCreateBodyStyle.out.optional(),
@@ -81,6 +104,7 @@ const SchemaOut$V1ImageToVideoCreateBody = z
81
104
  assets: "assets",
82
105
  endSeconds: "end_seconds",
83
106
  height: "height",
107
+ model: "model",
84
108
  name: "name",
85
109
  resolution: "resolution",
86
110
  style: "style",
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Determines the aspect ratio of the output video.
3
+ * * **Seedance**: Supports `9:16`, `16:9`, `1:1`.
4
+ * * **Kling 2.5 Audio**: Supports `9:16`, `16:9`, `1:1`.
5
+ * * **Sora 2**: Supports `9:16`, `16:9`.
6
+ * * **Veo 3.1 Audio**: Supports `9:16`, `16:9`.
7
+ * * **Veo 3.1**: Supports `9:16`, `16:9`.
8
+ * * **Kling 1.6**: Supports `9:16`, `16:9`, `1:1`.
9
+ */
10
+ export type V1TextToVideoCreateBodyAspectRatioEnum = "16:9" | "1:1" | "9:16";
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,11 @@
1
+ /**
2
+ * The AI model to use for video generation.
3
+ * * `default`: Our recommended model for general use (Kling 2.5 Audio). Note: For backward compatibility, if you use default and end_seconds > 10, we'll fall back to Kling 1.6.
4
+ * * `seedance`: Great for fast iteration and start/end frame
5
+ * * `kling-2.5-audio`: Great for motion, action, and camera control
6
+ * * `sora-2`: Great for story-telling, dialogue & creativity
7
+ * * `veo3.1-audio`: Great for dialogue + SFX generated natively
8
+ * * `veo3.1`: Great for realism, polish, & prompt adherence
9
+ * * `kling-1.6`: Great for dependable clips with smooth motion
10
+ */
11
+ export type V1TextToVideoCreateBodyModelEnum = "default" | "kling-1.6" | "kling-2.5-audio" | "seedance" | "sora-2" | "veo3.1" | "veo3.1-audio";
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,4 +1,4 @@
1
1
  /**
2
- * Determines the orientation of the output video
2
+ * Deprecated. Use `aspect_ratio` instead.
3
3
  */
4
4
  export type V1TextToVideoCreateBodyOrientationEnum = "landscape" | "portrait" | "square";
@@ -1,11 +1,12 @@
1
1
  /**
2
2
  * Controls the output video resolution. Defaults to `720p` if not specified.
3
3
  *
4
- * 480p and 720p are available on Creator, Pro, or Business tiers. However, 1080p require Pro or Business tier.
5
- *
6
- * **Options:**
7
- * - `480p` - Supports only 5 or 10 second videos. Output: 24fps. Cost: 120 credits per 5 seconds.
8
- * - `720p` - Supports videos between 5-60 seconds. Output: 30fps. Cost: 300 credits per 5 seconds.
9
- * - `1080p` - Supports videos between 5-60 seconds. Output: 30fps. Cost: 600 credits per 5 seconds.
4
+ * * **Default**: Supports `480p`, `720p`, and `1080p`.
5
+ * * **Seedance**: Supports `480p`, `720p`, `1080p`.
6
+ * * **Kling 2.5 Audio**: Supports `720p`, `1080p`.
7
+ * * **Sora 2**: Supports `720p`.
8
+ * * **Veo 3.1 Audio**: Supports `720p`, `1080p`.
9
+ * * **Veo 3.1**: Supports `720p`, `1080p`.
10
+ * * **Kling 1.6**: Supports `720p`, `1080p`.
10
11
  */
11
12
  export type V1TextToVideoCreateBodyResolutionEnum = "1080p" | "480p" | "720p";
@@ -4,31 +4,58 @@ import { External$V1TextToVideoCreateBodyStyle, V1TextToVideoCreateBodyStyle } f
4
4
  * V1TextToVideoCreateBody
5
5
  */
6
6
  export type V1TextToVideoCreateBody = {
7
+ /**
8
+ * Determines the aspect ratio of the output video.
9
+ * * **Seedance**: Supports `9:16`, `16:9`, `1:1`.
10
+ * * **Kling 2.5 Audio**: Supports `9:16`, `16:9`, `1:1`.
11
+ * * **Sora 2**: Supports `9:16`, `16:9`.
12
+ * * **Veo 3.1 Audio**: Supports `9:16`, `16:9`.
13
+ * * **Veo 3.1**: Supports `9:16`, `16:9`.
14
+ * * **Kling 1.6**: Supports `9:16`, `16:9`, `1:1`.
15
+ */
16
+ aspectRatio?: ("16:9" | "1:1" | "9:16") | undefined;
7
17
  /**
8
18
  * The total duration of the output video in seconds.
9
19
  *
10
- * The value must be greater than or equal to 5 seconds and less than or equal to 60 seconds.
11
- *
12
- * Note: For 480p resolution, the value must be either 5 or 10.
20
+ * Supported durations depend on the chosen model:
21
+ * * **Default**: 5-60 seconds (either 5 or 10 for 480p).
22
+ * * **Seedance**: 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12
23
+ * * **Kling 2.5 Audio**: 5, 10
24
+ * * **Sora 2**: 4, 8, 12, 24, 36, 48, 60
25
+ * * **Veo 3.1 Audio**: 4, 6, 8, 16, 24, 32, 40, 48, 56
26
+ * * **Veo 3.1**: 4, 6, 8, 16, 24, 32, 40, 48, 56
27
+ * * **Kling 1.6**: 5, 10, 15, 20, 25, 30, 35, 40, 45, 50, 55, 60
13
28
  */
14
29
  endSeconds: number;
30
+ /**
31
+ * The AI model to use for video generation.
32
+ * * `default`: Our recommended model for general use (Kling 2.5 Audio). Note: For backward compatibility, if you use default and end_seconds > 10, we'll fall back to Kling 1.6.
33
+ * * `seedance`: Great for fast iteration and start/end frame
34
+ * * `kling-2.5-audio`: Great for motion, action, and camera control
35
+ * * `sora-2`: Great for story-telling, dialogue & creativity
36
+ * * `veo3.1-audio`: Great for dialogue + SFX generated natively
37
+ * * `veo3.1`: Great for realism, polish, & prompt adherence
38
+ * * `kling-1.6`: Great for dependable clips with smooth motion
39
+ */
40
+ model?: ("default" | "kling-1.6" | "kling-2.5-audio" | "seedance" | "sora-2" | "veo3.1" | "veo3.1-audio") | undefined;
15
41
  /**
16
42
  * Give your video a custom name for easy identification.
17
43
  */
18
44
  name?: string | undefined;
19
45
  /**
20
- * Determines the orientation of the output video
46
+ * Deprecated. Use `aspect_ratio` instead.
21
47
  */
22
- orientation: "landscape" | "portrait" | "square";
48
+ orientation?: ("landscape" | "portrait" | "square") | undefined;
23
49
  /**
24
50
  * Controls the output video resolution. Defaults to `720p` if not specified.
25
51
  *
26
- * 480p and 720p are available on Creator, Pro, or Business tiers. However, 1080p require Pro or Business tier.
27
- *
28
- * **Options:**
29
- * - `480p` - Supports only 5 or 10 second videos. Output: 24fps. Cost: 120 credits per 5 seconds.
30
- * - `720p` - Supports videos between 5-60 seconds. Output: 30fps. Cost: 300 credits per 5 seconds.
31
- * - `1080p` - Supports videos between 5-60 seconds. Output: 30fps. Cost: 600 credits per 5 seconds.
52
+ * * **Default**: Supports `480p`, `720p`, and `1080p`.
53
+ * * **Seedance**: Supports `480p`, `720p`, `1080p`.
54
+ * * **Kling 2.5 Audio**: Supports `720p`, `1080p`.
55
+ * * **Sora 2**: Supports `720p`.
56
+ * * **Veo 3.1 Audio**: Supports `720p`, `1080p`.
57
+ * * **Veo 3.1**: Supports `720p`, `1080p`.
58
+ * * **Kling 1.6**: Supports `720p`, `1080p`.
32
59
  */
33
60
  resolution?: ("1080p" | "480p" | "720p") | undefined;
34
61
  style: V1TextToVideoCreateBodyStyle;
@@ -39,9 +66,11 @@ export type V1TextToVideoCreateBody = {
39
66
  * we expect to come in as network data
40
67
  */
41
68
  export type External$V1TextToVideoCreateBody = {
69
+ aspect_ratio?: ("16:9" | "1:1" | "9:16") | undefined;
42
70
  end_seconds: number;
71
+ model?: ("default" | "kling-1.6" | "kling-2.5-audio" | "seedance" | "sora-2" | "veo3.1" | "veo3.1-audio") | undefined;
43
72
  name?: string | undefined;
44
- orientation: "landscape" | "portrait" | "square";
73
+ orientation?: ("landscape" | "portrait" | "square") | undefined;
45
74
  resolution?: ("1080p" | "480p" | "720p") | undefined;
46
75
  style: External$V1TextToVideoCreateBodyStyle;
47
76
  };
@@ -42,15 +42,29 @@ const v1_text_to_video_create_body_style_1 = require("./v1-text-to-video-create-
42
42
  */
43
43
  const SchemaIn$V1TextToVideoCreateBody = z
44
44
  .object({
45
+ aspect_ratio: z.enum(["16:9", "1:1", "9:16"]).optional(),
45
46
  end_seconds: z.number(),
47
+ model: z
48
+ .enum([
49
+ "default",
50
+ "kling-1.6",
51
+ "kling-2.5-audio",
52
+ "seedance",
53
+ "sora-2",
54
+ "veo3.1",
55
+ "veo3.1-audio",
56
+ ])
57
+ .optional(),
46
58
  name: z.string().optional(),
47
- orientation: z.enum(["landscape", "portrait", "square"]),
59
+ orientation: z.enum(["landscape", "portrait", "square"]).optional(),
48
60
  resolution: z.enum(["1080p", "480p", "720p"]).optional(),
49
61
  style: v1_text_to_video_create_body_style_1.Schemas$V1TextToVideoCreateBodyStyle.in,
50
62
  })
51
63
  .transform((obj) => {
52
64
  return (0, make_api_request_js_1.zodTransform)(obj, {
65
+ aspect_ratio: "aspectRatio",
53
66
  end_seconds: "endSeconds",
67
+ model: "model",
54
68
  name: "name",
55
69
  orientation: "orientation",
56
70
  resolution: "resolution",
@@ -63,15 +77,29 @@ const SchemaIn$V1TextToVideoCreateBody = z
63
77
  */
64
78
  const SchemaOut$V1TextToVideoCreateBody = z
65
79
  .object({
80
+ aspectRatio: z.enum(["16:9", "1:1", "9:16"]).optional(),
66
81
  endSeconds: z.number(),
82
+ model: z
83
+ .enum([
84
+ "default",
85
+ "kling-1.6",
86
+ "kling-2.5-audio",
87
+ "seedance",
88
+ "sora-2",
89
+ "veo3.1",
90
+ "veo3.1-audio",
91
+ ])
92
+ .optional(),
67
93
  name: z.string().optional(),
68
- orientation: z.enum(["landscape", "portrait", "square"]),
94
+ orientation: z.enum(["landscape", "portrait", "square"]).optional(),
69
95
  resolution: z.enum(["1080p", "480p", "720p"]).optional(),
70
96
  style: v1_text_to_video_create_body_style_1.Schemas$V1TextToVideoCreateBodyStyle.out,
71
97
  })
72
98
  .transform((obj) => {
73
99
  return (0, make_api_request_js_1.zodTransform)(obj, {
100
+ aspectRatio: "aspect_ratio",
74
101
  endSeconds: "end_seconds",
102
+ model: "model",
75
103
  name: "name",
76
104
  orientation: "orientation",
77
105
  resolution: "resolution",
@@ -61,7 +61,7 @@ export type V1VideoProjectsGetResponse = {
61
61
  */
62
62
  totalFrameCost: number;
63
63
  /**
64
- * 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
64
+ * 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
65
65
  */
66
66
  type: string;
67
67
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "magic-hour",
3
- "version": "0.45.0",
3
+ "version": "0.47.0",
4
4
  "main": "./dist/index.js",
5
5
  "types": "./dist/index.d.ts",
6
6
  "exports": {