magic-hour 0.30.1 → 0.32.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/dist/environment.d.ts +1 -1
- package/dist/environment.js +1 -1
- package/dist/resources/v1/face-swap/resource-client.d.ts +1 -1
- package/dist/resources/v1/face-swap/resource-client.js +1 -1
- package/dist/resources/v1/face-swap-photo/resource-client.d.ts +1 -1
- package/dist/resources/v1/face-swap-photo/resource-client.js +1 -1
- package/dist/resources/v1/image-to-video/resource-client.d.ts +1 -1
- package/dist/resources/v1/image-to-video/resource-client.js +1 -1
- package/dist/resources/v1/lip-sync/resource-client.d.ts +1 -1
- package/dist/resources/v1/lip-sync/resource-client.js +1 -1
- package/dist/resources/v1/text-to-video/resource-client.d.ts +1 -1
- package/dist/resources/v1/text-to-video/resource-client.js +1 -1
- package/dist/resources/v1/video-to-video/resource-client.d.ts +1 -1
- package/dist/resources/v1/video-to-video/resource-client.js +1 -1
- package/dist/types/index.d.ts +2 -0
- package/dist/types/v1-face-swap-create-body-assets-face-mappings-item.d.ts +30 -0
- package/dist/types/v1-face-swap-create-body-assets-face-mappings-item.js +71 -0
- package/dist/types/v1-face-swap-create-body-assets-face-swap-mode-enum.d.ts +6 -0
- package/dist/types/v1-face-swap-create-body-assets-face-swap-mode-enum.js +2 -0
- package/dist/types/v1-face-swap-create-body-assets.d.ts +18 -3
- package/dist/types/v1-face-swap-create-body-assets.js +15 -2
- package/dist/types/v1-face-swap-photo-create-body-assets-face-mappings-item.d.ts +1 -1
- package/dist/types/v1-face-swap-photo-create-body-assets-face-swap-mode-enum.d.ts +2 -2
- package/dist/types/v1-face-swap-photo-create-body-assets.d.ts +2 -2
- package/package.json +1 -1
package/dist/environment.d.ts
CHANGED
package/dist/environment.js
CHANGED
|
@@ -4,5 +4,5 @@ exports.Environment = void 0;
|
|
|
4
4
|
var Environment;
|
|
5
5
|
(function (Environment) {
|
|
6
6
|
Environment["Environment"] = "https://api.magichour.ai";
|
|
7
|
-
Environment["MockServer"] = "https://api.sideko.dev/v1/mock/magichour/magic-hour/0.
|
|
7
|
+
Environment["MockServer"] = "https://api.sideko.dev/v1/mock/magichour/magic-hour/0.32.0";
|
|
8
8
|
})(Environment || (exports.Environment = Environment = {}));
|
|
@@ -8,7 +8,7 @@ export declare class FaceSwapClient extends CoreResourceClient {
|
|
|
8
8
|
*
|
|
9
9
|
* Create a Face Swap video. The estimated frame cost is calculated using 30 FPS. This amount is deducted from your account balance when a video is queued. Once the video is complete, the cost will be updated based on the actual number of frames rendered.
|
|
10
10
|
*
|
|
11
|
-
* Get more information about this mode at our [product page](/products/face-swap).
|
|
11
|
+
* Get more information about this mode at our [product page](https://magichour.ai/products/face-swap).
|
|
12
12
|
*
|
|
13
13
|
*
|
|
14
14
|
* POST /v1/face-swap
|
|
@@ -13,7 +13,7 @@ class FaceSwapClient extends core_1.CoreResourceClient {
|
|
|
13
13
|
*
|
|
14
14
|
* Create a Face Swap video. The estimated frame cost is calculated using 30 FPS. This amount is deducted from your account balance when a video is queued. Once the video is complete, the cost will be updated based on the actual number of frames rendered.
|
|
15
15
|
*
|
|
16
|
-
* Get more information about this mode at our [product page](/products/face-swap).
|
|
16
|
+
* Get more information about this mode at our [product page](https://magichour.ai/products/face-swap).
|
|
17
17
|
*
|
|
18
18
|
*
|
|
19
19
|
* POST /v1/face-swap
|
|
@@ -6,7 +6,7 @@ export declare class FaceSwapPhotoClient extends CoreResourceClient {
|
|
|
6
6
|
/**
|
|
7
7
|
* Face Swap Photo
|
|
8
8
|
*
|
|
9
|
-
* Create a face swap photo. Each photo costs 5 credits. The height/width of the output image depends on your subscription. Please refer to our [pricing](/pricing) page for more details
|
|
9
|
+
* Create a face swap photo. Each photo costs 5 credits. The height/width of the output image depends on your subscription. Please refer to our [pricing](https://magichour.ai/pricing) page for more details
|
|
10
10
|
*
|
|
11
11
|
* POST /v1/face-swap-photo
|
|
12
12
|
*/
|
|
@@ -11,7 +11,7 @@ class FaceSwapPhotoClient extends core_1.CoreResourceClient {
|
|
|
11
11
|
/**
|
|
12
12
|
* Face Swap Photo
|
|
13
13
|
*
|
|
14
|
-
* Create a face swap photo. Each photo costs 5 credits. The height/width of the output image depends on your subscription. Please refer to our [pricing](/pricing) page for more details
|
|
14
|
+
* Create a face swap photo. Each photo costs 5 credits. The height/width of the output image depends on your subscription. Please refer to our [pricing](https://magichour.ai/pricing) page for more details
|
|
15
15
|
*
|
|
16
16
|
* POST /v1/face-swap-photo
|
|
17
17
|
*/
|
|
@@ -8,7 +8,7 @@ export declare class ImageToVideoClient extends CoreResourceClient {
|
|
|
8
8
|
*
|
|
9
9
|
* Create a Image To Video video. The estimated frame cost is calculated using 30 FPS. This amount is deducted from your account balance when a video is queued. Once the video is complete, the cost will be updated based on the actual number of frames rendered.
|
|
10
10
|
*
|
|
11
|
-
* Get more information about this mode at our [product page](/products/image-to-video).
|
|
11
|
+
* Get more information about this mode at our [product page](https://magichour.ai/products/image-to-video).
|
|
12
12
|
*
|
|
13
13
|
*
|
|
14
14
|
* POST /v1/image-to-video
|
|
@@ -13,7 +13,7 @@ class ImageToVideoClient extends core_1.CoreResourceClient {
|
|
|
13
13
|
*
|
|
14
14
|
* Create a Image To Video video. The estimated frame cost is calculated using 30 FPS. This amount is deducted from your account balance when a video is queued. Once the video is complete, the cost will be updated based on the actual number of frames rendered.
|
|
15
15
|
*
|
|
16
|
-
* Get more information about this mode at our [product page](/products/image-to-video).
|
|
16
|
+
* Get more information about this mode at our [product page](https://magichour.ai/products/image-to-video).
|
|
17
17
|
*
|
|
18
18
|
*
|
|
19
19
|
* POST /v1/image-to-video
|
|
@@ -8,7 +8,7 @@ export declare class LipSyncClient extends CoreResourceClient {
|
|
|
8
8
|
*
|
|
9
9
|
* Create a Lip Sync video. The estimated frame cost is calculated using 30 FPS. This amount is deducted from your account balance when a video is queued. Once the video is complete, the cost will be updated based on the actual number of frames rendered.
|
|
10
10
|
*
|
|
11
|
-
* Get more information about this mode at our [product page](/products/lip-sync).
|
|
11
|
+
* Get more information about this mode at our [product page](https://magichour.ai/products/lip-sync).
|
|
12
12
|
*
|
|
13
13
|
*
|
|
14
14
|
* POST /v1/lip-sync
|
|
@@ -13,7 +13,7 @@ class LipSyncClient extends core_1.CoreResourceClient {
|
|
|
13
13
|
*
|
|
14
14
|
* Create a Lip Sync video. The estimated frame cost is calculated using 30 FPS. This amount is deducted from your account balance when a video is queued. Once the video is complete, the cost will be updated based on the actual number of frames rendered.
|
|
15
15
|
*
|
|
16
|
-
* Get more information about this mode at our [product page](/products/lip-sync).
|
|
16
|
+
* Get more information about this mode at our [product page](https://magichour.ai/products/lip-sync).
|
|
17
17
|
*
|
|
18
18
|
*
|
|
19
19
|
* POST /v1/lip-sync
|
|
@@ -8,7 +8,7 @@ export declare class TextToVideoClient extends CoreResourceClient {
|
|
|
8
8
|
*
|
|
9
9
|
* Create a Text To Video video. The estimated frame cost is calculated using 30 FPS. This amount is deducted from your account balance when a video is queued. Once the video is complete, the cost will be updated based on the actual number of frames rendered.
|
|
10
10
|
*
|
|
11
|
-
* Get more information about this mode at our [product page](/products/text-to-video).
|
|
11
|
+
* Get more information about this mode at our [product page](https://magichour.ai/products/text-to-video).
|
|
12
12
|
*
|
|
13
13
|
*
|
|
14
14
|
* POST /v1/text-to-video
|
|
@@ -13,7 +13,7 @@ class TextToVideoClient extends core_1.CoreResourceClient {
|
|
|
13
13
|
*
|
|
14
14
|
* Create a Text To Video video. The estimated frame cost is calculated using 30 FPS. This amount is deducted from your account balance when a video is queued. Once the video is complete, the cost will be updated based on the actual number of frames rendered.
|
|
15
15
|
*
|
|
16
|
-
* Get more information about this mode at our [product page](/products/text-to-video).
|
|
16
|
+
* Get more information about this mode at our [product page](https://magichour.ai/products/text-to-video).
|
|
17
17
|
*
|
|
18
18
|
*
|
|
19
19
|
* POST /v1/text-to-video
|
|
@@ -8,7 +8,7 @@ export declare class VideoToVideoClient extends CoreResourceClient {
|
|
|
8
8
|
*
|
|
9
9
|
* Create a Video To Video video. The estimated frame cost is calculated using 30 FPS. This amount is deducted from your account balance when a video is queued. Once the video is complete, the cost will be updated based on the actual number of frames rendered.
|
|
10
10
|
*
|
|
11
|
-
* Get more information about this mode at our [product page](/products/video-to-video).
|
|
11
|
+
* Get more information about this mode at our [product page](https://magichour.ai/products/video-to-video).
|
|
12
12
|
*
|
|
13
13
|
*
|
|
14
14
|
* POST /v1/video-to-video
|
|
@@ -13,7 +13,7 @@ class VideoToVideoClient extends core_1.CoreResourceClient {
|
|
|
13
13
|
*
|
|
14
14
|
* Create a Video To Video video. The estimated frame cost is calculated using 30 FPS. This amount is deducted from your account balance when a video is queued. Once the video is complete, the cost will be updated based on the actual number of frames rendered.
|
|
15
15
|
*
|
|
16
|
-
* Get more information about this mode at our [product page](/products/video-to-video).
|
|
16
|
+
* Get more information about this mode at our [product page](https://magichour.ai/products/video-to-video).
|
|
17
17
|
*
|
|
18
18
|
*
|
|
19
19
|
* POST /v1/video-to-video
|
package/dist/types/index.d.ts
CHANGED
|
@@ -155,6 +155,8 @@ export { V1FaceDetectionGetResponse404MessageEnum } from "./v1-face-detection-ge
|
|
|
155
155
|
export { V1FaceDetectionGetResponse422 } from "./v1-face-detection-get-response422";
|
|
156
156
|
export { V1FaceSwapCreateBody } from "./v1-face-swap-create-body";
|
|
157
157
|
export { V1FaceSwapCreateBodyAssets } from "./v1-face-swap-create-body-assets";
|
|
158
|
+
export { V1FaceSwapCreateBodyAssetsFaceMappingsItem } from "./v1-face-swap-create-body-assets-face-mappings-item";
|
|
159
|
+
export { V1FaceSwapCreateBodyAssetsFaceSwapModeEnum } from "./v1-face-swap-create-body-assets-face-swap-mode-enum";
|
|
158
160
|
export { V1FaceSwapCreateBodyAssetsVideoSourceEnum } from "./v1-face-swap-create-body-assets-video-source-enum";
|
|
159
161
|
export { V1FaceSwapCreateResponse } from "./v1-face-swap-create-response";
|
|
160
162
|
export { V1FaceSwapCreateResponse400 } from "./v1-face-swap-create-response400";
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import * as z from "zod";
|
|
2
|
+
/**
|
|
3
|
+
* V1FaceSwapCreateBodyAssetsFaceMappingsItem
|
|
4
|
+
*/
|
|
5
|
+
export type V1FaceSwapCreateBodyAssetsFaceMappingsItem = {
|
|
6
|
+
/**
|
|
7
|
+
* The face image that will be used to replace the face in the `original_face`. This value can be either the `file_path` field from the response of the [upload urls API](https://docs.magichour.ai/api-reference/files/generate-asset-upload-urls), or the url of the file.
|
|
8
|
+
*/
|
|
9
|
+
newFace: string;
|
|
10
|
+
/**
|
|
11
|
+
* The face detected from the image in `target_file_path`. The file name is in the format of `<face_frame>-<face_index>.png`. This value is corresponds to the response in the [face detection API](https://docs.magichour.ai/api-reference/files/get-face-detection-details).
|
|
12
|
+
*
|
|
13
|
+
* * The face_frame is the frame number of the face in the target image. For images, the frame number is always 0.
|
|
14
|
+
* * The face_index is the index of the face in the target image, starting from 0 going left to right.
|
|
15
|
+
*/
|
|
16
|
+
originalFace: string;
|
|
17
|
+
};
|
|
18
|
+
/**
|
|
19
|
+
* @internal
|
|
20
|
+
* V1FaceSwapCreateBodyAssetsFaceMappingsItem without any key transformation, this is what
|
|
21
|
+
* we expect to come in as network data
|
|
22
|
+
*/
|
|
23
|
+
export type External$V1FaceSwapCreateBodyAssetsFaceMappingsItem = {
|
|
24
|
+
new_face: string;
|
|
25
|
+
original_face: string;
|
|
26
|
+
};
|
|
27
|
+
export declare const Schemas$V1FaceSwapCreateBodyAssetsFaceMappingsItem: {
|
|
28
|
+
in: z.ZodType<V1FaceSwapCreateBodyAssetsFaceMappingsItem, z.ZodTypeDef, unknown>;
|
|
29
|
+
out: z.ZodType<External$V1FaceSwapCreateBodyAssetsFaceMappingsItem, z.ZodTypeDef, V1FaceSwapCreateBodyAssetsFaceMappingsItem>;
|
|
30
|
+
};
|
|
@@ -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$V1FaceSwapCreateBodyAssetsFaceMappingsItem = void 0;
|
|
37
|
+
const core_1 = require("../core");
|
|
38
|
+
const z = __importStar(require("zod"));
|
|
39
|
+
/**
|
|
40
|
+
* Takes network data, validates it, and transforms keys to match typescript object V1FaceSwapCreateBodyAssetsFaceMappingsItem
|
|
41
|
+
*/
|
|
42
|
+
const SchemaIn$V1FaceSwapCreateBodyAssetsFaceMappingsItem = z
|
|
43
|
+
.object({
|
|
44
|
+
new_face: z.string(),
|
|
45
|
+
original_face: z.string(),
|
|
46
|
+
})
|
|
47
|
+
.transform((obj) => {
|
|
48
|
+
return (0, core_1.zodTransform)(obj, {
|
|
49
|
+
new_face: "newFace",
|
|
50
|
+
original_face: "originalFace",
|
|
51
|
+
});
|
|
52
|
+
});
|
|
53
|
+
/**
|
|
54
|
+
* @internal
|
|
55
|
+
* Takes typescript data, validates it, and maps keys to match the expected external object External$V1FaceSwapCreateBodyAssetsFaceMappingsItem
|
|
56
|
+
*/
|
|
57
|
+
const SchemaOut$V1FaceSwapCreateBodyAssetsFaceMappingsItem = z
|
|
58
|
+
.object({
|
|
59
|
+
newFace: z.string(),
|
|
60
|
+
originalFace: z.string(),
|
|
61
|
+
})
|
|
62
|
+
.transform((obj) => {
|
|
63
|
+
return (0, core_1.zodTransform)(obj, {
|
|
64
|
+
newFace: "new_face",
|
|
65
|
+
originalFace: "original_face",
|
|
66
|
+
});
|
|
67
|
+
});
|
|
68
|
+
exports.Schemas$V1FaceSwapCreateBodyAssetsFaceMappingsItem = {
|
|
69
|
+
in: SchemaIn$V1FaceSwapCreateBodyAssetsFaceMappingsItem,
|
|
70
|
+
out: SchemaOut$V1FaceSwapCreateBodyAssetsFaceMappingsItem,
|
|
71
|
+
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The mode of face swap.
|
|
3
|
+
* * `all-faces` - Swap all faces in the target image or video. `source_file_path` is required.
|
|
4
|
+
* * `individual-faces` - Swap individual faces in the target image or video. `source_faces` is required.
|
|
5
|
+
*/
|
|
6
|
+
export type V1FaceSwapCreateBodyAssetsFaceSwapModeEnum = "all-faces" | "individual-faces";
|
|
@@ -1,12 +1,25 @@
|
|
|
1
|
+
import { External$V1FaceSwapCreateBodyAssetsFaceMappingsItem, V1FaceSwapCreateBodyAssetsFaceMappingsItem } from "./v1-face-swap-create-body-assets-face-mappings-item";
|
|
1
2
|
import * as z from "zod";
|
|
2
3
|
/**
|
|
3
4
|
* Provide the assets for face swap. For video, The `video_source` field determines whether `video_file_path` or `youtube_url` field is used
|
|
4
5
|
*/
|
|
5
6
|
export type V1FaceSwapCreateBodyAssets = {
|
|
6
7
|
/**
|
|
7
|
-
*
|
|
8
|
+
* This is the array of face mappings used for multiple face swap. The value is required if `face_swap_mode` is `individual-faces`.
|
|
8
9
|
*/
|
|
9
|
-
|
|
10
|
+
faceMappings?: V1FaceSwapCreateBodyAssetsFaceMappingsItem[] | undefined;
|
|
11
|
+
/**
|
|
12
|
+
* The mode of face swap.
|
|
13
|
+
* * `all-faces` - Swap all faces in the target image or video. `source_file_path` is required.
|
|
14
|
+
* * `individual-faces` - Swap individual faces in the target image or video. `source_faces` is required.
|
|
15
|
+
*/
|
|
16
|
+
faceSwapMode?: ("all-faces" | "individual-faces") | undefined;
|
|
17
|
+
/**
|
|
18
|
+
* The path of the input image with the face to be swapped. The value is required if `face_swap_mode` is `all-faces`.
|
|
19
|
+
*
|
|
20
|
+
* This value can be either the `file_path` field from the response of the [upload urls API](https://docs.magichour.ai/api-reference/files/generate-asset-upload-urls), or the url of the file.
|
|
21
|
+
*/
|
|
22
|
+
imageFilePath?: string | undefined;
|
|
10
23
|
/**
|
|
11
24
|
* The path of the input video. This field is required if `video_source` is `file`. This value can be either the `file_path` field from the response of the [upload urls API](https://docs.magichour.ai/api-reference/files/generate-asset-upload-urls), or the url of the file.
|
|
12
25
|
*/
|
|
@@ -23,7 +36,9 @@ export type V1FaceSwapCreateBodyAssets = {
|
|
|
23
36
|
* we expect to come in as network data
|
|
24
37
|
*/
|
|
25
38
|
export type External$V1FaceSwapCreateBodyAssets = {
|
|
26
|
-
|
|
39
|
+
face_mappings?: External$V1FaceSwapCreateBodyAssetsFaceMappingsItem[] | undefined;
|
|
40
|
+
face_swap_mode?: ("all-faces" | "individual-faces") | undefined;
|
|
41
|
+
image_file_path?: string | undefined;
|
|
27
42
|
video_file_path?: string | undefined;
|
|
28
43
|
video_source: "file" | "youtube";
|
|
29
44
|
youtube_url?: string | undefined;
|
|
@@ -34,6 +34,7 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
34
34
|
})();
|
|
35
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
36
|
exports.Schemas$V1FaceSwapCreateBodyAssets = void 0;
|
|
37
|
+
const v1_face_swap_create_body_assets_face_mappings_item_1 = require("./v1-face-swap-create-body-assets-face-mappings-item");
|
|
37
38
|
const core_1 = require("../core");
|
|
38
39
|
const z = __importStar(require("zod"));
|
|
39
40
|
/**
|
|
@@ -41,13 +42,19 @@ const z = __importStar(require("zod"));
|
|
|
41
42
|
*/
|
|
42
43
|
const SchemaIn$V1FaceSwapCreateBodyAssets = z
|
|
43
44
|
.object({
|
|
44
|
-
|
|
45
|
+
face_mappings: z
|
|
46
|
+
.array(v1_face_swap_create_body_assets_face_mappings_item_1.Schemas$V1FaceSwapCreateBodyAssetsFaceMappingsItem.in)
|
|
47
|
+
.optional(),
|
|
48
|
+
face_swap_mode: z.enum(["all-faces", "individual-faces"]).optional(),
|
|
49
|
+
image_file_path: z.string().optional(),
|
|
45
50
|
video_file_path: z.string().optional(),
|
|
46
51
|
video_source: z.enum(["file", "youtube"]),
|
|
47
52
|
youtube_url: z.string().optional(),
|
|
48
53
|
})
|
|
49
54
|
.transform((obj) => {
|
|
50
55
|
return (0, core_1.zodTransform)(obj, {
|
|
56
|
+
face_mappings: "faceMappings",
|
|
57
|
+
face_swap_mode: "faceSwapMode",
|
|
51
58
|
image_file_path: "imageFilePath",
|
|
52
59
|
video_file_path: "videoFilePath",
|
|
53
60
|
video_source: "videoSource",
|
|
@@ -60,13 +67,19 @@ const SchemaIn$V1FaceSwapCreateBodyAssets = z
|
|
|
60
67
|
*/
|
|
61
68
|
const SchemaOut$V1FaceSwapCreateBodyAssets = z
|
|
62
69
|
.object({
|
|
63
|
-
|
|
70
|
+
faceMappings: z
|
|
71
|
+
.array(v1_face_swap_create_body_assets_face_mappings_item_1.Schemas$V1FaceSwapCreateBodyAssetsFaceMappingsItem.out)
|
|
72
|
+
.optional(),
|
|
73
|
+
faceSwapMode: z.enum(["all-faces", "individual-faces"]).optional(),
|
|
74
|
+
imageFilePath: z.string().optional(),
|
|
64
75
|
videoFilePath: z.string().optional(),
|
|
65
76
|
videoSource: z.enum(["file", "youtube"]),
|
|
66
77
|
youtubeUrl: z.string().optional(),
|
|
67
78
|
})
|
|
68
79
|
.transform((obj) => {
|
|
69
80
|
return (0, core_1.zodTransform)(obj, {
|
|
81
|
+
faceMappings: "face_mappings",
|
|
82
|
+
faceSwapMode: "face_swap_mode",
|
|
70
83
|
imageFilePath: "image_file_path",
|
|
71
84
|
videoFilePath: "video_file_path",
|
|
72
85
|
videoSource: "video_source",
|
|
@@ -8,7 +8,7 @@ export type V1FaceSwapPhotoCreateBodyAssetsFaceMappingsItem = {
|
|
|
8
8
|
*/
|
|
9
9
|
newFace: string;
|
|
10
10
|
/**
|
|
11
|
-
* The face detected from the image in `target_file_path`. The file name is in the format of `<face_frame>-<face_index>.png`. This value is corresponds to the response in the face detection API
|
|
11
|
+
* The face detected from the image in `target_file_path`. The file name is in the format of `<face_frame>-<face_index>.png`. This value is corresponds to the response in the [face detection API](https://docs.magichour.ai/api-reference/files/get-face-detection-details).
|
|
12
12
|
*
|
|
13
13
|
* * The face_frame is the frame number of the face in the target image. For images, the frame number is always 0.
|
|
14
14
|
* * The face_index is the index of the face in the target image, starting from 0 going left to right.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* The mode of face swap.
|
|
3
|
-
* * `all-faces` - Swap all faces in the target image. `source_file_path` is required.
|
|
4
|
-
* * `individual-faces` - Swap individual faces in the target image. `source_faces` is required.
|
|
3
|
+
* * `all-faces` - Swap all faces in the target image or video. `source_file_path` is required.
|
|
4
|
+
* * `individual-faces` - Swap individual faces in the target image or video. `source_faces` is required.
|
|
5
5
|
*/
|
|
6
6
|
export type V1FaceSwapPhotoCreateBodyAssetsFaceSwapModeEnum = "all-faces" | "individual-faces";
|
|
@@ -10,8 +10,8 @@ export type V1FaceSwapPhotoCreateBodyAssets = {
|
|
|
10
10
|
faceMappings?: V1FaceSwapPhotoCreateBodyAssetsFaceMappingsItem[] | undefined;
|
|
11
11
|
/**
|
|
12
12
|
* The mode of face swap.
|
|
13
|
-
* * `all-faces` - Swap all faces in the target image. `source_file_path` is required.
|
|
14
|
-
* * `individual-faces` - Swap individual faces in the target image. `source_faces` is required.
|
|
13
|
+
* * `all-faces` - Swap all faces in the target image or video. `source_file_path` is required.
|
|
14
|
+
* * `individual-faces` - Swap individual faces in the target image or video. `source_faces` is required.
|
|
15
15
|
*/
|
|
16
16
|
faceSwapMode?: ("all-faces" | "individual-faces") | undefined;
|
|
17
17
|
/**
|