magic-hour 0.59.0 → 0.61.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.
- package/README.md +5 -0
- package/dist/environment.d.ts +1 -1
- package/dist/environment.js +1 -1
- package/dist/resources/v1/ai-image-editor/request-types.d.ts +29 -19
- package/dist/resources/v1/ai-image-editor/request-types.js +2 -2
- package/dist/resources/v1/ai-image-generator/request-types.d.ts +35 -22
- package/dist/resources/v1/ai-image-generator/request-types.js +4 -2
- package/dist/resources/v1/body-swap/index.d.ts +2 -0
- package/dist/resources/v1/body-swap/index.js +5 -0
- package/dist/resources/v1/body-swap/request-types.d.ts +33 -0
- package/dist/resources/v1/body-swap/request-types.js +76 -0
- package/dist/resources/v1/body-swap/resource-client.d.ts +64 -0
- package/dist/resources/v1/body-swap/resource-client.js +105 -0
- package/dist/resources/v1/image-to-video/request-types.d.ts +4 -4
- package/dist/resources/v1/index.d.ts +1 -0
- package/dist/resources/v1/index.js +2 -1
- package/dist/resources/v1/resource-client.d.ts +3 -0
- package/dist/resources/v1/resource-client.js +5 -0
- package/dist/resources/v1/text-to-video/request-types.d.ts +4 -4
- package/dist/types/index.d.ts +4 -0
- package/dist/types/v1-ai-image-editor-create-body-model-enum.d.ts +12 -12
- package/dist/types/v1-ai-image-editor-create-body-resolution-enum.d.ts +16 -6
- package/dist/types/v1-ai-image-editor-create-body.d.ts +29 -19
- package/dist/types/v1-ai-image-editor-create-body.js +2 -2
- package/dist/types/v1-ai-image-generator-create-body-model-enum.d.ts +17 -14
- package/dist/types/v1-ai-image-generator-create-body-resolution-enum.d.ts +16 -6
- package/dist/types/v1-ai-image-generator-create-body-style-quality-mode-enum.d.ts +1 -1
- package/dist/types/v1-ai-image-generator-create-body-style.d.ts +1 -1
- package/dist/types/v1-ai-image-generator-create-body.d.ts +35 -22
- package/dist/types/v1-ai-image-generator-create-body.js +4 -2
- package/dist/types/v1-body-swap-create-body-assets.d.ts +37 -0
- package/dist/types/v1-body-swap-create-body-assets.js +71 -0
- package/dist/types/v1-body-swap-create-body-resolution-enum.d.ts +4 -0
- package/dist/types/v1-body-swap-create-body-resolution-enum.js +2 -0
- package/dist/types/v1-body-swap-create-body.d.ts +33 -0
- package/dist/types/v1-body-swap-create-body.js +76 -0
- package/dist/types/v1-body-swap-create-response.d.ts +34 -0
- package/dist/types/v1-body-swap-create-response.js +75 -0
- package/dist/types/v1-image-projects-get-response.d.ts +1 -1
- package/dist/types/v1-image-to-video-create-body.d.ts +4 -4
- package/dist/types/v1-text-to-video-create-body.d.ts +4 -4
- package/dist/types/v1-video-projects-get-response.d.ts +1 -1
- package/package.json +1 -1
|
@@ -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
|
+
};
|
|
@@ -0,0 +1,75 @@
|
|
|
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$V1BodySwapCreateResponse = 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 V1BodySwapCreateResponse
|
|
41
|
+
*/
|
|
42
|
+
const SchemaIn$V1BodySwapCreateResponse = z
|
|
43
|
+
.object({
|
|
44
|
+
credits_charged: z.number().int(),
|
|
45
|
+
frame_cost: z.number().int(),
|
|
46
|
+
id: z.string(),
|
|
47
|
+
})
|
|
48
|
+
.transform((obj) => {
|
|
49
|
+
return (0, make_api_request_js_1.zodTransform)(obj, {
|
|
50
|
+
credits_charged: "creditsCharged",
|
|
51
|
+
frame_cost: "frameCost",
|
|
52
|
+
id: "id",
|
|
53
|
+
});
|
|
54
|
+
});
|
|
55
|
+
/**
|
|
56
|
+
* @internal
|
|
57
|
+
* Takes typescript data, validates it, and maps keys to match the expected external object External$V1BodySwapCreateResponse
|
|
58
|
+
*/
|
|
59
|
+
const SchemaOut$V1BodySwapCreateResponse = z
|
|
60
|
+
.object({
|
|
61
|
+
creditsCharged: z.number().int(),
|
|
62
|
+
frameCost: z.number().int(),
|
|
63
|
+
id: z.string(),
|
|
64
|
+
})
|
|
65
|
+
.transform((obj) => {
|
|
66
|
+
return (0, make_api_request_js_1.zodTransform)(obj, {
|
|
67
|
+
creditsCharged: "credits_charged",
|
|
68
|
+
frameCost: "frame_cost",
|
|
69
|
+
id: "id",
|
|
70
|
+
});
|
|
71
|
+
});
|
|
72
|
+
exports.Schemas$V1BodySwapCreateResponse = {
|
|
73
|
+
in: SchemaIn$V1BodySwapCreateResponse,
|
|
74
|
+
out: SchemaOut$V1BodySwapCreateResponse,
|
|
75
|
+
};
|
|
@@ -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
|
|
45
|
+
* The type of the image project. Possible values are FACE_EDITOR, AI_IMAGE_EDITOR, AI_SELFIE, AI_HEADSHOT, AI_IMAGE, AI_MEME, CLOTHES_CHANGER, BACKGROUND_REMOVER, FACE_SWAP, IMAGE_UPSCALER, AI_GIF, QR_CODE, PHOTO_EDITOR, PHOTO_COLORIZER, HEAD_SWAP, BODY_SWAP, STORYBOARD
|
|
46
46
|
*/
|
|
47
47
|
type: string;
|
|
48
48
|
};
|
|
@@ -16,12 +16,12 @@ export type V1ImageToVideoCreateBody = {
|
|
|
16
16
|
* * **`ltx-2`**: Automatically included with no extra credits
|
|
17
17
|
* * **`wan-2.2`**: Not supported
|
|
18
18
|
* * **`seedance`**: Not supported
|
|
19
|
-
* * **`seedance-2.0`**:
|
|
19
|
+
* * **`seedance-2.0`**: Automatically included with no extra credits
|
|
20
20
|
* * **`kling-2.5`**: Automatically included with no extra credits
|
|
21
21
|
* * **`kling-3.0`**: Toggle-able (can enable/disable)
|
|
22
22
|
* * **`sora-2`**: Automatically included with no extra credits
|
|
23
23
|
* * **`veo3.1`**: Toggle-able (can enable/disable)
|
|
24
|
-
* * **`veo3.1-lite`**:
|
|
24
|
+
* * **`veo3.1-lite`**: Toggle-able (can enable/disable)
|
|
25
25
|
*
|
|
26
26
|
* Legacy models:
|
|
27
27
|
* * **`kling-1.6`**: Not supported
|
|
@@ -30,7 +30,7 @@ export type V1ImageToVideoCreateBody = {
|
|
|
30
30
|
/**
|
|
31
31
|
* The total duration of the output video in seconds. Supported durations depend on the chosen model:
|
|
32
32
|
*
|
|
33
|
-
* * **`ltx-2`**: 3, 4, 5, 6, 7, 8, 9, 10, 15, 20, 25, 30
|
|
33
|
+
* * **`ltx-2`**: 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 15, 20, 25, 30
|
|
34
34
|
* * **`wan-2.2`**: 3, 4, 5, 6, 7, 8, 9, 10, 15
|
|
35
35
|
* * **`seedance`**: 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12
|
|
36
36
|
* * **`seedance-2.0`**: 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15
|
|
@@ -38,7 +38,7 @@ export type V1ImageToVideoCreateBody = {
|
|
|
38
38
|
* * **`kling-3.0`**: 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15
|
|
39
39
|
* * **`sora-2`**: 4, 8, 12, 24, 36, 48, 60
|
|
40
40
|
* * **`veo3.1`**: 4, 6, 8, 16, 24, 32, 40, 48, 56
|
|
41
|
-
* * **`veo3.1-lite`**:
|
|
41
|
+
* * **`veo3.1-lite`**: 8, 16, 24, 32, 40, 48, 56
|
|
42
42
|
*
|
|
43
43
|
* Legacy models:
|
|
44
44
|
* * **`kling-1.6`**: 5, 10, 15, 20, 25, 30, 35, 40, 45, 50, 55, 60
|
|
@@ -28,12 +28,12 @@ export type V1TextToVideoCreateBody = {
|
|
|
28
28
|
* * **`ltx-2`**: Automatically included with no extra credits
|
|
29
29
|
* * **`wan-2.2`**: Not supported
|
|
30
30
|
* * **`seedance`**: Not supported
|
|
31
|
-
* * **`seedance-2.0`**:
|
|
31
|
+
* * **`seedance-2.0`**: Automatically included with no extra credits
|
|
32
32
|
* * **`kling-2.5`**: Automatically included with no extra credits
|
|
33
33
|
* * **`kling-3.0`**: Toggle-able (can enable/disable)
|
|
34
34
|
* * **`sora-2`**: Automatically included with no extra credits
|
|
35
35
|
* * **`veo3.1`**: Toggle-able (can enable/disable)
|
|
36
|
-
* * **`veo3.1-lite`**:
|
|
36
|
+
* * **`veo3.1-lite`**: Toggle-able (can enable/disable)
|
|
37
37
|
*
|
|
38
38
|
* Legacy models:
|
|
39
39
|
* * **`kling-1.6`**: Not supported
|
|
@@ -42,7 +42,7 @@ export type V1TextToVideoCreateBody = {
|
|
|
42
42
|
/**
|
|
43
43
|
* The total duration of the output video in seconds. Supported durations depend on the chosen model:
|
|
44
44
|
*
|
|
45
|
-
* * **`ltx-2`**: 3, 4, 5, 6, 7, 8, 9, 10, 15, 20, 25, 30
|
|
45
|
+
* * **`ltx-2`**: 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 15, 20, 25, 30
|
|
46
46
|
* * **`wan-2.2`**: 3, 4, 5, 6, 7, 8, 9, 10, 15
|
|
47
47
|
* * **`seedance`**: 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12
|
|
48
48
|
* * **`seedance-2.0`**: 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15
|
|
@@ -50,7 +50,7 @@ export type V1TextToVideoCreateBody = {
|
|
|
50
50
|
* * **`kling-3.0`**: 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15
|
|
51
51
|
* * **`sora-2`**: 4, 8, 12, 24, 36, 48, 60
|
|
52
52
|
* * **`veo3.1`**: 4, 6, 8, 16, 24, 32, 40, 48, 56
|
|
53
|
-
* * **`veo3.1-lite`**:
|
|
53
|
+
* * **`veo3.1-lite`**: 8, 16, 24, 32, 40, 48, 56
|
|
54
54
|
*
|
|
55
55
|
* Legacy models:
|
|
56
56
|
* * **`kling-1.6`**: 5, 10, 15, 20, 25, 30, 35, 40, 45, 50, 55, 60
|
|
@@ -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,
|
|
64
|
+
* The type of the video project. Possible values are ANIMATION, AUTO_SUBTITLE, VIDEO_TO_VIDEO, FACE_SWAP, TEXT_TO_VIDEO, IMAGE_TO_VIDEO, LIP_SYNC, TALKING_PHOTO, VIDEO_UPSCALER, EXTEND, AUDIO_TO_VIDEO, UGC_AD
|
|
65
65
|
*/
|
|
66
66
|
type: string;
|
|
67
67
|
/**
|