magic-hour 0.60.0 → 0.62.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 (53) hide show
  1. package/README.md +5 -0
  2. package/dist/environment.d.ts +1 -1
  3. package/dist/environment.js +1 -1
  4. package/dist/resources/v1/ai-image-editor/request-types.d.ts +7 -2
  5. package/dist/resources/v1/ai-image-editor/request-types.js +2 -0
  6. package/dist/resources/v1/ai-image-generator/request-types.d.ts +8 -3
  7. package/dist/resources/v1/ai-image-generator/request-types.js +2 -0
  8. package/dist/resources/v1/body-swap/index.d.ts +2 -0
  9. package/dist/resources/v1/body-swap/index.js +5 -0
  10. package/dist/resources/v1/body-swap/request-types.d.ts +33 -0
  11. package/dist/resources/v1/body-swap/request-types.js +76 -0
  12. package/dist/resources/v1/body-swap/resource-client.d.ts +64 -0
  13. package/dist/resources/v1/body-swap/resource-client.js +105 -0
  14. package/dist/resources/v1/files/upload-urls/resource-client.d.ts +1 -1
  15. package/dist/resources/v1/files/upload-urls/resource-client.js +1 -1
  16. package/dist/resources/v1/image-to-video/request-types.d.ts +27 -36
  17. package/dist/resources/v1/image-to-video/request-types.js +4 -2
  18. package/dist/resources/v1/index.d.ts +1 -0
  19. package/dist/resources/v1/index.js +2 -1
  20. package/dist/resources/v1/resource-client.d.ts +3 -0
  21. package/dist/resources/v1/resource-client.js +5 -0
  22. package/dist/resources/v1/text-to-video/request-types.d.ts +32 -43
  23. package/dist/resources/v1/text-to-video/request-types.js +4 -2
  24. package/dist/types/index.d.ts +4 -0
  25. package/dist/types/v1-ai-image-editor-create-body-model-enum.d.ts +5 -1
  26. package/dist/types/v1-ai-image-editor-create-body-resolution-enum.d.ts +1 -0
  27. package/dist/types/v1-ai-image-editor-create-body.d.ts +7 -2
  28. package/dist/types/v1-ai-image-editor-create-body.js +2 -0
  29. package/dist/types/v1-ai-image-generator-create-body-model-enum.d.ts +6 -2
  30. package/dist/types/v1-ai-image-generator-create-body-resolution-enum.d.ts +1 -0
  31. package/dist/types/v1-ai-image-generator-create-body.d.ts +8 -3
  32. package/dist/types/v1-ai-image-generator-create-body.js +2 -0
  33. package/dist/types/v1-body-swap-create-body-assets.d.ts +37 -0
  34. package/dist/types/v1-body-swap-create-body-assets.js +71 -0
  35. package/dist/types/v1-body-swap-create-body-resolution-enum.d.ts +4 -0
  36. package/dist/types/v1-body-swap-create-body-resolution-enum.js +2 -0
  37. package/dist/types/v1-body-swap-create-body.d.ts +33 -0
  38. package/dist/types/v1-body-swap-create-body.js +76 -0
  39. package/dist/types/v1-body-swap-create-response.d.ts +34 -0
  40. package/dist/types/v1-body-swap-create-response.js +75 -0
  41. package/dist/types/v1-files-upload-urls-create-body-items-item.d.ts +1 -1
  42. package/dist/types/v1-image-to-video-create-body-assets.d.ts +5 -7
  43. package/dist/types/v1-image-to-video-create-body-model-enum.d.ts +7 -10
  44. package/dist/types/v1-image-to-video-create-body-resolution-enum.d.ts +6 -8
  45. package/dist/types/v1-image-to-video-create-body.d.ts +27 -36
  46. package/dist/types/v1-image-to-video-create-body.js +4 -2
  47. package/dist/types/v1-text-to-video-create-body-aspect-ratio-enum.d.ts +5 -7
  48. package/dist/types/v1-text-to-video-create-body-model-enum.d.ts +7 -10
  49. package/dist/types/v1-text-to-video-create-body-resolution-enum.d.ts +6 -8
  50. package/dist/types/v1-text-to-video-create-body.d.ts +32 -43
  51. package/dist/types/v1-text-to-video-create-body.js +4 -2
  52. package/dist/types/v1-video-projects-get-response.d.ts +1 -1
  53. package/package.json +1 -1
@@ -21,6 +21,7 @@ class V1Client extends make_api_request_js_1.CoreResourceClient {
21
21
  this.animation;
22
22
  this.audioProjects;
23
23
  this.autoSubtitleGenerator;
24
+ this.bodySwap;
24
25
  this.faceDetection;
25
26
  this.faceSwap;
26
27
  this.faceSwapPhoto;
@@ -171,5 +172,9 @@ class V1Client extends make_api_request_js_1.CoreResourceClient {
171
172
  var _a;
172
173
  return ((_a = this._headSwapLazy) !== null && _a !== void 0 ? _a : (this._headSwapLazy = new (require("./head-swap").HeadSwapClient)(this._client, this._opts)));
173
174
  }
175
+ get bodySwap() {
176
+ var _a;
177
+ return ((_a = this._bodySwapLazy) !== null && _a !== void 0 ? _a : (this._bodySwapLazy = new (require("./body-swap").BodySwapClient)(this._client, this._opts)));
178
+ }
174
179
  }
175
180
  exports.V1Client = V1Client;
@@ -7,75 +7,66 @@ export type CreateRequest = {
7
7
  /**
8
8
  * Determines the aspect ratio of the output video.
9
9
  *
10
- * * **`ltx-2`**: Supports 9:16, 16:9, 1:1.
10
+ * * **`ltx-2.3`**: Supports 9:16, 16:9, 1:1.
11
11
  * * **`wan-2.2`**: Supports 9:16, 16:9, 1:1.
12
- * * **`seedance`**: Supports 9:16, 16:9, 1:1.
13
- * * **`seedance-2.0`**: Supports 9:16, 16:9, 1:1.
14
12
  * * **`kling-2.5`**: Supports 9:16, 16:9, 1:1.
15
13
  * * **`kling-3.0`**: Supports 9:16, 16:9, 1:1.
16
- * * **`sora-2`**: Supports 9:16, 16:9.
17
- * * **`veo3.1`**: Supports 9:16, 16:9.
18
14
  * * **`veo3.1-lite`**: Supports 9:16, 16:9.
15
+ * * **`veo3.1`**: Supports 9:16, 16:9.
16
+ * * **`seedance`**: Supports 9:16, 16:9, 1:1.
17
+ * * **`seedance-2.0`**: Supports 9:16, 16:9, 1:1.
18
+ * * **`sora-2`**: Supports 9:16, 16:9.
19
19
  *
20
- * Legacy models:
21
- * * **`kling-1.6`**: Supports 9:16, 16:9, 1:1.
22
20
  */
23
21
  aspectRatio?: ("16:9" | "1:1" | "9:16") | undefined;
24
22
  /**
25
23
  * Whether to include audio in the video. Defaults to `false` if not specified.
26
24
  *
27
25
  * Audio support varies by model:
28
- * * **`ltx-2`**: Automatically included with no extra credits
26
+ * * **`ltx-2.3`**: Toggle-able: no additional credits for audio
29
27
  * * **`wan-2.2`**: Not supported
28
+ * * **`kling-2.5`**: Toggle-able: no additional credits for audio
29
+ * * **`kling-3.0`**: Toggle-able: audio adds extra credits when enabled
30
+ * * **`veo3.1-lite`**: Toggle-able: audio adds extra credits when enabled
31
+ * * **`veo3.1`**: Toggle-able: audio adds extra credits when enabled
30
32
  * * **`seedance`**: Not supported
31
- * * **`seedance-2.0`**: Not supported
32
- * * **`kling-2.5`**: Automatically included with no extra credits
33
- * * **`kling-3.0`**: Toggle-able (can enable/disable)
34
- * * **`sora-2`**: Automatically included with no extra credits
35
- * * **`veo3.1`**: Toggle-able (can enable/disable)
36
- * * **`veo3.1-lite`**: Toggle-able (can enable/disable)
33
+ * * **`seedance-2.0`**: Toggle-able: no additional credits for audio
34
+ * * **`sora-2`**: Toggle-able: no additional credits for audio
37
35
  *
38
- * Legacy models:
39
- * * **`kling-1.6`**: Not supported
40
36
  */
41
37
  audio?: boolean | undefined;
42
38
  /**
43
39
  * The total duration of the output video in seconds. Supported durations depend on the chosen model:
44
40
  *
45
- * * **`ltx-2`**: 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 15, 20, 25, 30
41
+ * * **`ltx-2.3`**: 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 15, 20, 25, 30
46
42
  * * **`wan-2.2`**: 3, 4, 5, 6, 7, 8, 9, 10, 15
47
- * * **`seedance`**: 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12
48
- * * **`seedance-2.0`**: 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15
49
43
  * * **`kling-2.5`**: 5, 10
50
44
  * * **`kling-3.0`**: 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15
51
- * * **`sora-2`**: 4, 8, 12, 24, 36, 48, 60
52
- * * **`veo3.1`**: 4, 6, 8, 16, 24, 32, 40, 48, 56
53
45
  * * **`veo3.1-lite`**: 8, 16, 24, 32, 40, 48, 56
46
+ * * **`veo3.1`**: 4, 6, 8, 16, 24, 32, 40, 48, 56
47
+ * * **`seedance`**: 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12
48
+ * * **`seedance-2.0`**: 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15
49
+ * * **`sora-2`**: 4, 8, 12, 24, 36, 48, 60
54
50
  *
55
- * Legacy models:
56
- * * **`kling-1.6`**: 5, 10, 15, 20, 25, 30, 35, 40, 45, 50, 55, 60
57
51
  */
58
52
  endSeconds: number;
59
53
  /**
60
54
  * The AI model to use for video generation.
61
55
  *
62
- * * `default`: uses our currently recommended model for general use. For paid tiers, defaults to `kling-3.0`. For free tiers, it defaults to `ltx-2`.
63
- * * `ltx-2`: Fast iteration with audio and lip-sync
56
+ * * `default`: uses our currently recommended model for general use. For paid tiers, defaults to `kling-3.0`. For free tiers, it defaults to `ltx-2.3`.
57
+ * * `ltx-2.3`: Fast iteration with audio, lip-sync, and end frame
64
58
  * * `wan-2.2`: Fast, strong visuals with effects
65
- * * `seedance`: Fast iteration and start/end frames
66
- * * `seedance-2.0`: State-of-the-art quality and consistency
67
59
  * * `kling-2.5`: Motion, action, and camera control
68
60
  * * `kling-3.0`: Cinematic, multi-scene storytelling
69
- * * `sora-2`: Story-first concepts and creativity
61
+ * * `veo3.1-lite`: Fast, affordable, high-quality
70
62
  * * `veo3.1`: Realistic visuals and prompt adherence
71
- * * `veo3.1-lite`: Good for fast, affordable, high-quality daily generation.
72
- *
73
- * Legacy models:
74
- * * `kling-1.6`: Reliable baseline with smooth motion
63
+ * * `seedance`: Fast iteration and start/end frames
64
+ * * `seedance-2.0`: State-of-the-art quality and consistency
65
+ * * `sora-2`: Story-first concepts and creativity
75
66
  *
76
67
  * If you specify the deprecated model value that includes the `-audio` suffix, this will be the same as included `audio` as `true`.
77
68
  */
78
- model?: ("default" | "kling-1.6" | "kling-2.5" | "kling-2.5-audio" | "kling-3.0" | "ltx-2" | "seedance" | "seedance-2.0" | "sora-2" | "veo3.1" | "veo3.1-audio" | "veo3.1-lite" | "wan-2.2") | undefined;
69
+ model?: ("default" | "kling-1.6" | "kling-2.5" | "kling-2.5-audio" | "kling-3.0" | "ltx-2" | "ltx-2.3" | "seedance" | "seedance-2.0" | "sora-2" | "veo3.1" | "veo3.1-audio" | "veo3.1-lite" | "wan-2.2") | undefined;
79
70
  /**
80
71
  * Give your video a custom name for easy identification.
81
72
  */
@@ -87,20 +78,18 @@ export type CreateRequest = {
87
78
  /**
88
79
  * Controls the output video resolution. Defaults to `720p` on paid tiers and `480p` on free tiers.
89
80
  *
90
- * * **`ltx-2`**: Supports 480p, 720p, 1080p.
81
+ * * **`ltx-2.3`**: Supports 480p, 720p, 1080p.
91
82
  * * **`wan-2.2`**: Supports 480p, 720p, 1080p.
83
+ * * **`kling-2.5`**: Supports 720p, 1080p.
84
+ * * **`kling-3.0`**: Supports 720p, 1080p, 4k.
85
+ * * **`veo3.1-lite`**: Supports 720p, 1080p.
86
+ * * **`veo3.1`**: Supports 720p, 1080p.
92
87
  * * **`seedance`**: Supports 480p, 720p, 1080p.
93
88
  * * **`seedance-2.0`**: Supports 480p, 720p.
94
- * * **`kling-2.5`**: Supports 720p, 1080p.
95
- * * **`kling-3.0`**: Supports 720p, 1080p.
96
89
  * * **`sora-2`**: Supports 720p.
97
- * * **`veo3.1`**: Supports 720p, 1080p.
98
- * * **`veo3.1-lite`**: Supports 720p, 1080p.
99
90
  *
100
- * Legacy models:
101
- * * **`kling-1.6`**: Supports 720p, 1080p.
102
91
  */
103
- resolution?: ("1080p" | "480p" | "720p") | undefined;
92
+ resolution?: ("1080p" | "480p" | "4k" | "720p") | undefined;
104
93
  style: V1TextToVideoCreateBodyStyle;
105
94
  };
106
95
  /**
@@ -112,10 +101,10 @@ export type External$CreateRequest = {
112
101
  aspect_ratio?: ("16:9" | "1:1" | "9:16") | undefined;
113
102
  audio?: boolean | undefined;
114
103
  end_seconds: number;
115
- model?: ("default" | "kling-1.6" | "kling-2.5" | "kling-2.5-audio" | "kling-3.0" | "ltx-2" | "seedance" | "seedance-2.0" | "sora-2" | "veo3.1" | "veo3.1-audio" | "veo3.1-lite" | "wan-2.2") | undefined;
104
+ model?: ("default" | "kling-1.6" | "kling-2.5" | "kling-2.5-audio" | "kling-3.0" | "ltx-2" | "ltx-2.3" | "seedance" | "seedance-2.0" | "sora-2" | "veo3.1" | "veo3.1-audio" | "veo3.1-lite" | "wan-2.2") | undefined;
116
105
  name?: string | undefined;
117
106
  orientation?: ("landscape" | "portrait" | "square") | undefined;
118
- resolution?: ("1080p" | "480p" | "720p") | undefined;
107
+ resolution?: ("1080p" | "480p" | "4k" | "720p") | undefined;
119
108
  style: External$V1TextToVideoCreateBodyStyle;
120
109
  };
121
110
  export declare const Schemas$CreateRequest: {
@@ -53,6 +53,7 @@ const SchemaIn$CreateRequest = z
53
53
  "kling-2.5-audio",
54
54
  "kling-3.0",
55
55
  "ltx-2",
56
+ "ltx-2.3",
56
57
  "seedance",
57
58
  "seedance-2.0",
58
59
  "sora-2",
@@ -64,7 +65,7 @@ const SchemaIn$CreateRequest = z
64
65
  .optional(),
65
66
  name: z.string().optional(),
66
67
  orientation: z.enum(["landscape", "portrait", "square"]).optional(),
67
- resolution: z.enum(["1080p", "480p", "720p"]).optional(),
68
+ resolution: z.enum(["1080p", "480p", "4k", "720p"]).optional(),
68
69
  style: v1_text_to_video_create_body_style_1.Schemas$V1TextToVideoCreateBodyStyle.in,
69
70
  })
70
71
  .transform((obj) => {
@@ -96,6 +97,7 @@ const SchemaOut$CreateRequest = z
96
97
  "kling-2.5-audio",
97
98
  "kling-3.0",
98
99
  "ltx-2",
100
+ "ltx-2.3",
99
101
  "seedance",
100
102
  "seedance-2.0",
101
103
  "sora-2",
@@ -107,7 +109,7 @@ const SchemaOut$CreateRequest = z
107
109
  .optional(),
108
110
  name: z.string().optional(),
109
111
  orientation: z.enum(["landscape", "portrait", "square"]).optional(),
110
- resolution: z.enum(["1080p", "480p", "720p"]).optional(),
112
+ resolution: z.enum(["1080p", "480p", "4k", "720p"]).optional(),
111
113
  style: v1_text_to_video_create_body_style_1.Schemas$V1TextToVideoCreateBodyStyle.out,
112
114
  })
113
115
  .transform((obj) => {
@@ -74,6 +74,10 @@ export { V1AutoSubtitleGeneratorCreateBodyStyle } from "./v1-auto-subtitle-gener
74
74
  export { V1AutoSubtitleGeneratorCreateBodyStyleCustomConfig } from "./v1-auto-subtitle-generator-create-body-style-custom-config";
75
75
  export { V1AutoSubtitleGeneratorCreateBodyStyleTemplateEnum } from "./v1-auto-subtitle-generator-create-body-style-template-enum";
76
76
  export { V1AutoSubtitleGeneratorCreateResponse } from "./v1-auto-subtitle-generator-create-response";
77
+ export { V1BodySwapCreateBody } from "./v1-body-swap-create-body";
78
+ export { V1BodySwapCreateBodyAssets } from "./v1-body-swap-create-body-assets";
79
+ export { V1BodySwapCreateBodyResolutionEnum } from "./v1-body-swap-create-body-resolution-enum";
80
+ export { V1BodySwapCreateResponse } from "./v1-body-swap-create-response";
77
81
  export { V1FaceDetectionCreateBody } from "./v1-face-detection-create-body";
78
82
  export { V1FaceDetectionCreateBodyAssets } from "./v1-face-detection-create-body-assets";
79
83
  export { V1FaceDetectionCreateResponse } from "./v1-face-detection-create-response";
@@ -27,6 +27,10 @@
27
27
  * - Supported resolutions: 640px, 1k, 2k, 4k
28
28
  * - Available for tiers: creator, pro, business
29
29
  * - Max additional input images: 9
30
+ * - `gpt-image-2` - from 50 credits/image
31
+ * - Supported resolutions: 640px, 1k, 2k, 4k
32
+ * - Available for tiers: creator, pro, business
33
+ * - Max additional input images: 9
30
34
  *
31
35
  */
32
- export type V1AiImageEditorCreateBodyModelEnum = "default" | "nano-banana" | "nano-banana-2" | "nano-banana-pro" | "qwen-edit" | "seedream-v4" | "seedream-v4.5";
36
+ export type V1AiImageEditorCreateBodyModelEnum = "default" | "gpt-image-2" | "nano-banana" | "nano-banana-2" | "nano-banana-pro" | "qwen-edit" | "seedream-v4" | "seedream-v4.5";
@@ -15,6 +15,7 @@
15
15
  * - `seedream-v4` - 640px, 1k, 2k, 4k
16
16
  * - `nano-banana-pro` - 1k, 2k, 4k
17
17
  * - `seedream-v4.5` - 640px, 1k, 2k, 4k
18
+ * - `gpt-image-2` - 640px, 1k, 2k, 4k
18
19
  *
19
20
  * Note: Resolution availability depends on the model and your subscription tier.
20
21
  */
@@ -46,9 +46,13 @@ export type V1AiImageEditorCreateBody = {
46
46
  * - Supported resolutions: 640px, 1k, 2k, 4k
47
47
  * - Available for tiers: creator, pro, business
48
48
  * - Max additional input images: 9
49
+ * - `gpt-image-2` - from 50 credits/image
50
+ * - Supported resolutions: 640px, 1k, 2k, 4k
51
+ * - Available for tiers: creator, pro, business
52
+ * - Max additional input images: 9
49
53
  *
50
54
  */
51
- model?: ("default" | "nano-banana" | "nano-banana-2" | "nano-banana-pro" | "qwen-edit" | "seedream-v4" | "seedream-v4.5") | undefined;
55
+ model?: ("default" | "gpt-image-2" | "nano-banana" | "nano-banana-2" | "nano-banana-pro" | "qwen-edit" | "seedream-v4" | "seedream-v4.5") | undefined;
52
56
  /**
53
57
  * Give your image a custom name for easy identification.
54
58
  */
@@ -70,6 +74,7 @@ export type V1AiImageEditorCreateBody = {
70
74
  * - `seedream-v4` - 640px, 1k, 2k, 4k
71
75
  * - `nano-banana-pro` - 1k, 2k, 4k
72
76
  * - `seedream-v4.5` - 640px, 1k, 2k, 4k
77
+ * - `gpt-image-2` - 640px, 1k, 2k, 4k
73
78
  *
74
79
  * Note: Resolution availability depends on the model and your subscription tier.
75
80
  */
@@ -85,7 +90,7 @@ export type External$V1AiImageEditorCreateBody = {
85
90
  aspect_ratio?: ("16:9" | "1:1" | "2:3" | "3:2" | "4:3" | "4:5" | "9:16" | "auto") | undefined;
86
91
  assets: External$V1AiImageEditorCreateBodyAssets;
87
92
  image_count?: number | undefined;
88
- model?: ("default" | "nano-banana" | "nano-banana-2" | "nano-banana-pro" | "qwen-edit" | "seedream-v4" | "seedream-v4.5") | undefined;
93
+ model?: ("default" | "gpt-image-2" | "nano-banana" | "nano-banana-2" | "nano-banana-pro" | "qwen-edit" | "seedream-v4" | "seedream-v4.5") | undefined;
89
94
  name?: string | undefined;
90
95
  resolution?: ("1k" | "2k" | "4k" | "640px" | "auto") | undefined;
91
96
  style: External$V1AiImageEditorCreateBodyStyle;
@@ -51,6 +51,7 @@ const SchemaIn$V1AiImageEditorCreateBody = z
51
51
  model: z
52
52
  .enum([
53
53
  "default",
54
+ "gpt-image-2",
54
55
  "nano-banana",
55
56
  "nano-banana-2",
56
57
  "nano-banana-pro",
@@ -88,6 +89,7 @@ const SchemaOut$V1AiImageEditorCreateBody = z
88
89
  model: z
89
90
  .enum([
90
91
  "default",
92
+ "gpt-image-2",
91
93
  "nano-banana",
92
94
  "nano-banana-2",
93
95
  "nano-banana-pro",
@@ -22,14 +22,18 @@
22
22
  * - `nano-banana-2` - from 100 credits/image
23
23
  * - Supported resolutions: 640px, 1k, 2k, 4k
24
24
  * - Available for tiers: free, creator, pro, business
25
- * - Image count allowed: 1, 2, 3, 4
25
+ * - Image count allowed: 1, 4, 9, 16
26
26
  * - `nano-banana-pro` - from 150 credits/image
27
27
  * - Supported resolutions: 1k, 2k, 4k
28
28
  * - Available for tiers: creator, pro, business
29
29
  * - Image count allowed: 1, 4, 9, 16
30
+ * - `gpt-image-2` - from 50 credits/image
31
+ * - Supported resolutions: 640px, 1k, 2k, 4k
32
+ * - Available for tiers: creator, pro, business
33
+ * - Image count allowed: 1, 2, 3, 4
30
34
  *
31
35
  * **Deprecated Enum Values:**
32
36
  * - `seedream` - Use `seedream-v4` instead.
33
37
  *
34
38
  */
35
- export type V1AiImageGeneratorCreateBodyModelEnum = "default" | "flux-schnell" | "nano-banana" | "nano-banana-2" | "nano-banana-pro" | "seedream" | "seedream-v4" | "z-image-turbo";
39
+ export type V1AiImageGeneratorCreateBodyModelEnum = "default" | "flux-schnell" | "gpt-image-2" | "nano-banana" | "nano-banana-2" | "nano-banana-pro" | "seedream" | "seedream-v4" | "z-image-turbo";
@@ -15,6 +15,7 @@
15
15
  * - `nano-banana` - 640px, 1k
16
16
  * - `nano-banana-2` - 640px, 1k, 2k, 4k
17
17
  * - `nano-banana-pro` - 1k, 2k, 4k
18
+ * - `gpt-image-2` - 640px, 1k, 2k, 4k
18
19
  *
19
20
  * Note: Resolution availability depends on the model and your subscription tier.
20
21
  */
@@ -36,17 +36,21 @@ export type V1AiImageGeneratorCreateBody = {
36
36
  * - `nano-banana-2` - from 100 credits/image
37
37
  * - Supported resolutions: 640px, 1k, 2k, 4k
38
38
  * - Available for tiers: free, creator, pro, business
39
- * - Image count allowed: 1, 2, 3, 4
39
+ * - Image count allowed: 1, 4, 9, 16
40
40
  * - `nano-banana-pro` - from 150 credits/image
41
41
  * - Supported resolutions: 1k, 2k, 4k
42
42
  * - Available for tiers: creator, pro, business
43
43
  * - Image count allowed: 1, 4, 9, 16
44
+ * - `gpt-image-2` - from 50 credits/image
45
+ * - Supported resolutions: 640px, 1k, 2k, 4k
46
+ * - Available for tiers: creator, pro, business
47
+ * - Image count allowed: 1, 2, 3, 4
44
48
  *
45
49
  * **Deprecated Enum Values:**
46
50
  * - `seedream` - Use `seedream-v4` instead.
47
51
  *
48
52
  */
49
- model?: ("default" | "flux-schnell" | "nano-banana" | "nano-banana-2" | "nano-banana-pro" | "seedream" | "seedream-v4" | "z-image-turbo") | undefined;
53
+ model?: ("default" | "flux-schnell" | "gpt-image-2" | "nano-banana" | "nano-banana-2" | "nano-banana-pro" | "seedream" | "seedream-v4" | "z-image-turbo") | undefined;
50
54
  /**
51
55
  * Give your image a custom name for easy identification.
52
56
  */
@@ -74,6 +78,7 @@ export type V1AiImageGeneratorCreateBody = {
74
78
  * - `nano-banana` - 640px, 1k
75
79
  * - `nano-banana-2` - 640px, 1k, 2k, 4k
76
80
  * - `nano-banana-pro` - 1k, 2k, 4k
81
+ * - `gpt-image-2` - 640px, 1k, 2k, 4k
77
82
  *
78
83
  * Note: Resolution availability depends on the model and your subscription tier.
79
84
  */
@@ -91,7 +96,7 @@ export type V1AiImageGeneratorCreateBody = {
91
96
  export type External$V1AiImageGeneratorCreateBody = {
92
97
  aspect_ratio?: ("16:9" | "1:1" | "9:16") | undefined;
93
98
  image_count: number;
94
- model?: ("default" | "flux-schnell" | "nano-banana" | "nano-banana-2" | "nano-banana-pro" | "seedream" | "seedream-v4" | "z-image-turbo") | undefined;
99
+ model?: ("default" | "flux-schnell" | "gpt-image-2" | "nano-banana" | "nano-banana-2" | "nano-banana-pro" | "seedream" | "seedream-v4" | "z-image-turbo") | undefined;
95
100
  name?: string | undefined;
96
101
  orientation?: ("landscape" | "portrait" | "square") | undefined;
97
102
  resolution?: ("1k" | "2k" | "4k" | "640px" | "auto") | undefined;
@@ -48,6 +48,7 @@ const SchemaIn$V1AiImageGeneratorCreateBody = z
48
48
  .enum([
49
49
  "default",
50
50
  "flux-schnell",
51
+ "gpt-image-2",
51
52
  "nano-banana",
52
53
  "nano-banana-2",
53
54
  "nano-banana-pro",
@@ -84,6 +85,7 @@ const SchemaOut$V1AiImageGeneratorCreateBody = z
84
85
  .enum([
85
86
  "default",
86
87
  "flux-schnell",
88
+ "gpt-image-2",
87
89
  "nano-banana",
88
90
  "nano-banana-2",
89
91
  "nano-banana-pro",
@@ -0,0 +1,37 @@
1
+ import * as z from "zod";
2
+ /**
3
+ * Person image and scene image for body swap
4
+ */
5
+ export type V1BodySwapCreateBodyAssets = {
6
+ /**
7
+ * Image of the person to place into the scene. This value is either
8
+ * - a direct URL to the video file
9
+ * - `file_path` field from the response of the [upload urls API](https://docs.magichour.ai/api-reference/files/generate-asset-upload-urls).
10
+ *
11
+ * See the [file upload guide](https://docs.magichour.ai/api-reference/files/generate-asset-upload-urls#input-file) for details.
12
+ *
13
+ */
14
+ personFilePath: string;
15
+ /**
16
+ * Target scene image (background). This value is either
17
+ * - a direct URL to the video file
18
+ * - `file_path` field from the response of the [upload urls API](https://docs.magichour.ai/api-reference/files/generate-asset-upload-urls).
19
+ *
20
+ * See the [file upload guide](https://docs.magichour.ai/api-reference/files/generate-asset-upload-urls#input-file) for details.
21
+ *
22
+ */
23
+ sceneFilePath: string;
24
+ };
25
+ /**
26
+ * @internal
27
+ * V1BodySwapCreateBodyAssets without any key transformation, this is what
28
+ * we expect to come in as network data
29
+ */
30
+ export type External$V1BodySwapCreateBodyAssets = {
31
+ person_file_path: string;
32
+ scene_file_path: string;
33
+ };
34
+ export declare const Schemas$V1BodySwapCreateBodyAssets: {
35
+ in: z.ZodType<V1BodySwapCreateBodyAssets, z.ZodTypeDef, unknown>;
36
+ out: z.ZodType<External$V1BodySwapCreateBodyAssets, z.ZodTypeDef, V1BodySwapCreateBodyAssets>;
37
+ };
@@ -0,0 +1,71 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
35
+ Object.defineProperty(exports, "__esModule", { value: true });
36
+ exports.Schemas$V1BodySwapCreateBodyAssets = void 0;
37
+ const make_api_request_js_1 = require("make-api-request-js");
38
+ const z = __importStar(require("zod"));
39
+ /**
40
+ * Takes network data, validates it, and transforms keys to match typescript object V1BodySwapCreateBodyAssets
41
+ */
42
+ const SchemaIn$V1BodySwapCreateBodyAssets = z
43
+ .object({
44
+ person_file_path: z.string(),
45
+ scene_file_path: z.string(),
46
+ })
47
+ .transform((obj) => {
48
+ return (0, make_api_request_js_1.zodTransform)(obj, {
49
+ person_file_path: "personFilePath",
50
+ scene_file_path: "sceneFilePath",
51
+ });
52
+ });
53
+ /**
54
+ * @internal
55
+ * Takes typescript data, validates it, and maps keys to match the expected external object External$V1BodySwapCreateBodyAssets
56
+ */
57
+ const SchemaOut$V1BodySwapCreateBodyAssets = z
58
+ .object({
59
+ personFilePath: z.string(),
60
+ sceneFilePath: z.string(),
61
+ })
62
+ .transform((obj) => {
63
+ return (0, make_api_request_js_1.zodTransform)(obj, {
64
+ personFilePath: "person_file_path",
65
+ sceneFilePath: "scene_file_path",
66
+ });
67
+ });
68
+ exports.Schemas$V1BodySwapCreateBodyAssets = {
69
+ in: SchemaIn$V1BodySwapCreateBodyAssets,
70
+ out: SchemaOut$V1BodySwapCreateBodyAssets,
71
+ };
@@ -0,0 +1,4 @@
1
+ /**
2
+ * Output resolution. Determines credits charged for the run.
3
+ */
4
+ export type V1BodySwapCreateBodyResolutionEnum = "1k" | "2k" | "4k" | "640px";
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,33 @@
1
+ import * as z from "zod";
2
+ import { External$V1BodySwapCreateBodyAssets, V1BodySwapCreateBodyAssets } from "./v1-body-swap-create-body-assets";
3
+ /**
4
+ * V1BodySwapCreateBody
5
+ */
6
+ export type V1BodySwapCreateBody = {
7
+ /**
8
+ * Person image and scene image for body swap
9
+ */
10
+ assets: V1BodySwapCreateBodyAssets;
11
+ /**
12
+ * Give your image a custom name for easy identification.
13
+ */
14
+ name?: string | undefined;
15
+ /**
16
+ * Output resolution. Determines credits charged for the run.
17
+ */
18
+ resolution: "1k" | "2k" | "4k" | "640px";
19
+ };
20
+ /**
21
+ * @internal
22
+ * V1BodySwapCreateBody without any key transformation, this is what
23
+ * we expect to come in as network data
24
+ */
25
+ export type External$V1BodySwapCreateBody = {
26
+ assets: External$V1BodySwapCreateBodyAssets;
27
+ name?: string | undefined;
28
+ resolution: "1k" | "2k" | "4k" | "640px";
29
+ };
30
+ export declare const Schemas$V1BodySwapCreateBody: {
31
+ in: z.ZodType<V1BodySwapCreateBody, z.ZodTypeDef, unknown>;
32
+ out: z.ZodType<External$V1BodySwapCreateBody, z.ZodTypeDef, V1BodySwapCreateBody>;
33
+ };
@@ -0,0 +1,76 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
35
+ Object.defineProperty(exports, "__esModule", { value: true });
36
+ exports.Schemas$V1BodySwapCreateBody = void 0;
37
+ const make_api_request_js_1 = require("make-api-request-js");
38
+ const z = __importStar(require("zod"));
39
+ const v1_body_swap_create_body_assets_1 = require("./v1-body-swap-create-body-assets");
40
+ /**
41
+ * Takes network data, validates it, and transforms keys to match typescript object V1BodySwapCreateBody
42
+ */
43
+ const SchemaIn$V1BodySwapCreateBody = z
44
+ .object({
45
+ assets: v1_body_swap_create_body_assets_1.Schemas$V1BodySwapCreateBodyAssets.in,
46
+ name: z.string().optional(),
47
+ resolution: z.enum(["1k", "2k", "4k", "640px"]),
48
+ })
49
+ .transform((obj) => {
50
+ return (0, make_api_request_js_1.zodTransform)(obj, {
51
+ assets: "assets",
52
+ name: "name",
53
+ resolution: "resolution",
54
+ });
55
+ });
56
+ /**
57
+ * @internal
58
+ * Takes typescript data, validates it, and maps keys to match the expected external object External$V1BodySwapCreateBody
59
+ */
60
+ const SchemaOut$V1BodySwapCreateBody = z
61
+ .object({
62
+ assets: v1_body_swap_create_body_assets_1.Schemas$V1BodySwapCreateBodyAssets.out,
63
+ name: z.string().optional(),
64
+ resolution: z.enum(["1k", "2k", "4k", "640px"]),
65
+ })
66
+ .transform((obj) => {
67
+ return (0, make_api_request_js_1.zodTransform)(obj, {
68
+ assets: "assets",
69
+ name: "name",
70
+ resolution: "resolution",
71
+ });
72
+ });
73
+ exports.Schemas$V1BodySwapCreateBody = {
74
+ in: SchemaIn$V1BodySwapCreateBody,
75
+ out: SchemaOut$V1BodySwapCreateBody,
76
+ };
@@ -0,0 +1,34 @@
1
+ import * as z from "zod";
2
+ /**
3
+ * Success
4
+ */
5
+ export type V1BodySwapCreateResponse = {
6
+ /**
7
+ * The amount of credits deducted from your account to generate the image. We charge credits right when the request is made.
8
+ *
9
+ * If an error occurred while generating the image(s), credits will be refunded and this field will be updated to include the refund.
10
+ */
11
+ creditsCharged: number;
12
+ /**
13
+ * Deprecated: Previously represented the number of frames (original name of our credit system) used for image generation. Use 'credits_charged' instead.
14
+ */
15
+ frameCost: number;
16
+ /**
17
+ * Unique ID of the image. Use it with the [Get image Project API](https://docs.magichour.ai/api-reference/image-projects/get-image-details) to fetch status and downloads.
18
+ */
19
+ id: string;
20
+ };
21
+ /**
22
+ * @internal
23
+ * V1BodySwapCreateResponse without any key transformation, this is what
24
+ * we expect to come in as network data
25
+ */
26
+ export type External$V1BodySwapCreateResponse = {
27
+ credits_charged: number;
28
+ frame_cost: number;
29
+ id: string;
30
+ };
31
+ export declare const Schemas$V1BodySwapCreateResponse: {
32
+ in: z.ZodType<V1BodySwapCreateResponse, z.ZodTypeDef, unknown>;
33
+ out: z.ZodType<External$V1BodySwapCreateResponse, z.ZodTypeDef, V1BodySwapCreateResponse>;
34
+ };