magic-hour 0.66.0 → 0.68.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 (61) hide show
  1. package/README.md +10 -0
  2. package/dist/environment.d.ts +1 -1
  3. package/dist/environment.js +1 -1
  4. package/dist/resources/v1/ai-image-upscaler/request-types.d.ts +3 -3
  5. package/dist/resources/v1/ai-image-upscaler/request-types.js +2 -2
  6. package/dist/resources/v1/ai-image-upscaler/resource-client.d.ts +1 -1
  7. package/dist/resources/v1/ai-image-upscaler/resource-client.js +1 -1
  8. package/dist/resources/v1/ai-video-editor/index.d.ts +2 -0
  9. package/dist/resources/v1/ai-video-editor/index.js +5 -0
  10. package/dist/resources/v1/ai-video-editor/request-types.d.ts +41 -0
  11. package/dist/resources/v1/ai-video-editor/request-types.js +85 -0
  12. package/dist/resources/v1/ai-video-editor/resource-client.d.ts +76 -0
  13. package/dist/resources/v1/ai-video-editor/resource-client.js +120 -0
  14. package/dist/resources/v1/body-swap/resource-client.d.ts +1 -1
  15. package/dist/resources/v1/body-swap/resource-client.js +1 -1
  16. package/dist/resources/v1/character-replace/index.d.ts +2 -0
  17. package/dist/resources/v1/character-replace/index.js +5 -0
  18. package/dist/resources/v1/character-replace/request-types.d.ts +49 -0
  19. package/dist/resources/v1/character-replace/request-types.js +89 -0
  20. package/dist/resources/v1/character-replace/resource-client.d.ts +88 -0
  21. package/dist/resources/v1/character-replace/resource-client.js +129 -0
  22. package/dist/resources/v1/files/upload-urls/resource-client.d.ts +2 -2
  23. package/dist/resources/v1/files/upload-urls/resource-client.js +2 -2
  24. package/dist/resources/v1/index.d.ts +2 -0
  25. package/dist/resources/v1/index.js +3 -1
  26. package/dist/resources/v1/resource-client.d.ts +6 -0
  27. package/dist/resources/v1/resource-client.js +12 -0
  28. package/dist/types/index.d.ts +12 -0
  29. package/dist/types/v1-ai-image-upscaler-create-body-style-enhancement-enum.d.ts +1 -1
  30. package/dist/types/v1-ai-image-upscaler-create-body-style-mode-enum.d.ts +2 -2
  31. package/dist/types/v1-ai-image-upscaler-create-body-style.d.ts +8 -5
  32. package/dist/types/v1-ai-image-upscaler-create-body-style.js +2 -2
  33. package/dist/types/v1-ai-image-upscaler-create-body.d.ts +3 -3
  34. package/dist/types/v1-ai-image-upscaler-create-body.js +2 -2
  35. package/dist/types/v1-ai-video-editor-create-body-assets.d.ts +27 -0
  36. package/dist/types/v1-ai-video-editor-create-body-assets.js +67 -0
  37. package/dist/types/v1-ai-video-editor-create-body-style.d.ts +22 -0
  38. package/dist/types/v1-ai-video-editor-create-body-style.js +67 -0
  39. package/dist/types/v1-ai-video-editor-create-body.d.ts +41 -0
  40. package/dist/types/v1-ai-video-editor-create-body.js +85 -0
  41. package/dist/types/v1-ai-video-editor-create-response.d.ts +36 -0
  42. package/dist/types/v1-ai-video-editor-create-response.js +75 -0
  43. package/dist/types/v1-body-swap-create-body-assets.d.ts +1 -1
  44. package/dist/types/v1-character-replace-create-body-assets.d.ts +37 -0
  45. package/dist/types/v1-character-replace-create-body-assets.js +71 -0
  46. package/dist/types/v1-character-replace-create-body-resolution-enum.d.ts +4 -0
  47. package/dist/types/v1-character-replace-create-body-resolution-enum.js +2 -0
  48. package/dist/types/v1-character-replace-create-body-style-mode-enum.d.ts +4 -0
  49. package/dist/types/v1-character-replace-create-body-style-mode-enum.js +2 -0
  50. package/dist/types/v1-character-replace-create-body-style-points-item.d.ts +32 -0
  51. package/dist/types/v1-character-replace-create-body-style-points-item.js +75 -0
  52. package/dist/types/v1-character-replace-create-body-style-selection-mode-enum.d.ts +4 -0
  53. package/dist/types/v1-character-replace-create-body-style-selection-mode-enum.js +2 -0
  54. package/dist/types/v1-character-replace-create-body-style.d.ts +33 -0
  55. package/dist/types/v1-character-replace-create-body-style.js +80 -0
  56. package/dist/types/v1-character-replace-create-body.d.ts +49 -0
  57. package/dist/types/v1-character-replace-create-body.js +89 -0
  58. package/dist/types/v1-character-replace-create-response.d.ts +36 -0
  59. package/dist/types/v1-character-replace-create-response.js +75 -0
  60. package/dist/types/v1-files-upload-urls-create-body-items-item.d.ts +1 -1
  61. package/package.json +1 -1
@@ -0,0 +1,88 @@
1
+ import { ApiPromise, CoreClient, CoreResourceClient, RequestOptions, ResourceClientOptions } from "make-api-request-js";
2
+ import { GenerateOptions, GenerateRequestType } from "../../../helpers/generate-type";
3
+ import * as requests from "../../../resources/v1/character-replace/request-types";
4
+ import * as types from "../../../types";
5
+ type GenerateRequest = GenerateRequestType<requests.CreateRequest, {
6
+ /**
7
+ * Reference character image used as the replacement or animation target. This value is either
8
+ * - a direct URL to the image file
9
+ * - a path to a local file
10
+ *
11
+ * Note: if the path begins with `api-assets`, it will be assumed to already be uploaded to Magic Hour's storage, and will not be uploaded again.
12
+ */
13
+ imageFilePath: string;
14
+ /**
15
+ * Source video containing the subject to replace or animate. This value is either
16
+ * - a direct URL to the video file
17
+ * - a path to a local file
18
+ *
19
+ * Note: if the path begins with `api-assets`, it will be assumed to already be uploaded to Magic Hour's storage, and will not be uploaded again.
20
+ */
21
+ videoFilePath: string;
22
+ }>;
23
+ export declare class CharacterReplaceClient extends CoreResourceClient {
24
+ constructor(coreClient: CoreClient, opts: ResourceClientOptions);
25
+ /**
26
+ * Character Replace
27
+ *
28
+ * Create a Character Replace video
29
+ *
30
+ * This method provides a convenient way to create a request and automatically wait for completion and download outputs.
31
+ *
32
+ * @example
33
+ * ```typescript
34
+ * import { Client } from "../../../index.js";
35
+ *
36
+ * const client = new Client({ token: process.env["API_TOKEN"]!! });
37
+ * const res = await client.v1.characterReplace.generate(
38
+ * {
39
+ * assets: {
40
+ * imageFilePath: "/path/to/5678.png",
41
+ * videoFilePath: "/path/to/1234.mp4",
42
+ * },
43
+ * endSeconds: 15.0,
44
+ * name: "My Character Replace video",
45
+ * resolution: "720p",
46
+ * startSeconds: 0.0,
47
+ * style: { mode: "replace", selectionMode: "auto" },
48
+ * },
49
+ * {
50
+ * waitForCompletion: true,
51
+ * downloadOutputs: true,
52
+ * downloadDirectory: ".",
53
+ * },
54
+ * );
55
+ * ```
56
+ */
57
+ generate(request: GenerateRequest, opts?: GenerateOptions): Promise<import("../video-projects/resource-client").V1VideoProjectsGetResponseWithDownloads>;
58
+ /**
59
+ * Character Replace
60
+ *
61
+ * **What this API does**
62
+ *
63
+ * Create the same Character Replace you can make in the browser, but programmatically, so you can automate it, run it at scale, or connect it to your own app or workflow.
64
+ *
65
+ * **Good for**
66
+ * - Automation and batch processing
67
+ * - Adding character replace into apps, pipelines, or tools
68
+ *
69
+ * **How it works (3 steps)**
70
+ * 1) Upload your inputs (video, image, or audio) with [Generate Upload URLs](https://docs.magichour.ai/api-reference/files/generate-asset-upload-urls) and copy the `file_path`.
71
+ * 2) Send a request to create a character replace job with the basic fields.
72
+ * 3) Check the job status until it's `complete`, then download the result from `downloads`.
73
+ *
74
+ * **Key options**
75
+ * - Inputs: usually a file, sometimes a YouTube link, depending on project type
76
+ * - Resolution: free users are limited to 576px; higher plans unlock HD and larger sizes
77
+ * - Extra fields: e.g. `face_swap_mode`, `start_seconds`/`end_seconds`, or a text prompt
78
+ *
79
+ * **Cost**
80
+ * Credits are only charged for the frames that actually render. You'll see an estimate when the job is queued, and the final total after it's done.
81
+ *
82
+ * For detailed examples, see the [product page](https://magichour.ai/products/character-replace).
83
+ *
84
+ * POST /v1/character-replace
85
+ */
86
+ create(request: requests.CreateRequest, opts?: RequestOptions): ApiPromise<types.V1CharacterReplaceCreateResponse>;
87
+ }
88
+ export {};
@@ -0,0 +1,129 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ var __rest = (this && this.__rest) || function (s, e) {
12
+ var t = {};
13
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
14
+ t[p] = s[p];
15
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
16
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
17
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
18
+ t[p[i]] = s[p[i]];
19
+ }
20
+ return t;
21
+ };
22
+ Object.defineProperty(exports, "__esModule", { value: true });
23
+ exports.CharacterReplaceClient = void 0;
24
+ const make_api_request_js_1 = require("make-api-request-js");
25
+ const logger_1 = require("../../../logger");
26
+ const files_1 = require("../../../resources/v1/files");
27
+ const video_projects_1 = require("../../../resources/v1/video-projects");
28
+ const v1_character_replace_create_body_1 = require("../../../types/v1-character-replace-create-body");
29
+ const v1_character_replace_create_response_1 = require("../../../types/v1-character-replace-create-response");
30
+ class CharacterReplaceClient extends make_api_request_js_1.CoreResourceClient {
31
+ constructor(coreClient, opts) {
32
+ super(coreClient, opts);
33
+ }
34
+ /**
35
+ * Character Replace
36
+ *
37
+ * Create a Character Replace video
38
+ *
39
+ * This method provides a convenient way to create a request and automatically wait for completion and download outputs.
40
+ *
41
+ * @example
42
+ * ```typescript
43
+ * import { Client } from "../../../index.js";
44
+ *
45
+ * const client = new Client({ token: process.env["API_TOKEN"]!! });
46
+ * const res = await client.v1.characterReplace.generate(
47
+ * {
48
+ * assets: {
49
+ * imageFilePath: "/path/to/5678.png",
50
+ * videoFilePath: "/path/to/1234.mp4",
51
+ * },
52
+ * endSeconds: 15.0,
53
+ * name: "My Character Replace video",
54
+ * resolution: "720p",
55
+ * startSeconds: 0.0,
56
+ * style: { mode: "replace", selectionMode: "auto" },
57
+ * },
58
+ * {
59
+ * waitForCompletion: true,
60
+ * downloadOutputs: true,
61
+ * downloadDirectory: ".",
62
+ * },
63
+ * );
64
+ * ```
65
+ */
66
+ generate(request_1) {
67
+ return __awaiter(this, arguments, void 0, function* (request, opts = {}) {
68
+ const { waitForCompletion = true, downloadOutputs = true, downloadDirectory = undefined } = opts, createOpts = __rest(opts, ["waitForCompletion", "downloadOutputs", "downloadDirectory"]);
69
+ const fileClient = new files_1.FilesClient(this._client, this._opts);
70
+ const _a = request.assets, { imageFilePath, videoFilePath } = _a, restAssets = __rest(_a, ["imageFilePath", "videoFilePath"]);
71
+ (0, logger_1.getLogger)().debug(`Uploading file ${imageFilePath} to Magic Hour's storage`);
72
+ (0, logger_1.getLogger)().debug(`Uploading file ${videoFilePath} to Magic Hour's storage`);
73
+ const [uploadedImageFilePath, uploadedVideoFilePath] = yield Promise.all([
74
+ fileClient.uploadFile(imageFilePath),
75
+ fileClient.uploadFile(videoFilePath),
76
+ ]);
77
+ (0, logger_1.getLogger)().info(`Uploaded file ${imageFilePath} to Magic Hour's storage as ${uploadedImageFilePath}`);
78
+ (0, logger_1.getLogger)().info(`Uploaded file ${videoFilePath} to Magic Hour's storage as ${uploadedVideoFilePath}`);
79
+ const createResponse = yield this.create(Object.assign(Object.assign({}, request), { assets: Object.assign(Object.assign({}, restAssets), { imageFilePath: uploadedImageFilePath, videoFilePath: uploadedVideoFilePath }) }), createOpts);
80
+ (0, logger_1.getLogger)().info(`Created CharacterReplaceClient project ${createResponse.id}`);
81
+ const projectsClient = new video_projects_1.VideoProjectsClient(this._client, this._opts);
82
+ (0, logger_1.getLogger)().debug(`Checking result for CharacterReplaceClient project ${createResponse.id}`);
83
+ const result = yield projectsClient.checkResult({ id: createResponse.id }, Object.assign({ waitForCompletion,
84
+ downloadOutputs,
85
+ downloadDirectory }, createOpts));
86
+ return result;
87
+ });
88
+ }
89
+ /**
90
+ * Character Replace
91
+ *
92
+ * **What this API does**
93
+ *
94
+ * Create the same Character Replace you can make in the browser, but programmatically, so you can automate it, run it at scale, or connect it to your own app or workflow.
95
+ *
96
+ * **Good for**
97
+ * - Automation and batch processing
98
+ * - Adding character replace into apps, pipelines, or tools
99
+ *
100
+ * **How it works (3 steps)**
101
+ * 1) Upload your inputs (video, image, or audio) with [Generate Upload URLs](https://docs.magichour.ai/api-reference/files/generate-asset-upload-urls) and copy the `file_path`.
102
+ * 2) Send a request to create a character replace job with the basic fields.
103
+ * 3) Check the job status until it's `complete`, then download the result from `downloads`.
104
+ *
105
+ * **Key options**
106
+ * - Inputs: usually a file, sometimes a YouTube link, depending on project type
107
+ * - Resolution: free users are limited to 576px; higher plans unlock HD and larger sizes
108
+ * - Extra fields: e.g. `face_swap_mode`, `start_seconds`/`end_seconds`, or a text prompt
109
+ *
110
+ * **Cost**
111
+ * Credits are only charged for the frames that actually render. You'll see an estimate when the job is queued, and the final total after it's done.
112
+ *
113
+ * For detailed examples, see the [product page](https://magichour.ai/products/character-replace).
114
+ *
115
+ * POST /v1/character-replace
116
+ */
117
+ create(request, opts) {
118
+ return this._client.makeRequest({
119
+ method: "post",
120
+ path: "/v1/character-replace",
121
+ auth: ["bearerAuth"],
122
+ contentType: "application/json",
123
+ body: v1_character_replace_create_body_1.Schemas$V1CharacterReplaceCreateBody.out.parse(request),
124
+ responseSchema: v1_character_replace_create_response_1.Schemas$V1CharacterReplaceCreateResponse.in,
125
+ opts,
126
+ });
127
+ }
128
+ }
129
+ exports.CharacterReplaceClient = CharacterReplaceClient;
@@ -12,8 +12,8 @@ export declare class UploadUrlsClient extends CoreResourceClient {
12
12
  *
13
13
  * **Valid file extensions per asset type**:
14
14
  * - video: mp4, m4v, mov, webm
15
- * - audio: mp3, wav, aac, flac, webm, m4a, opus, ogg, aiff, amr
16
- * - image: png, jpg, jpeg, jfif, heic, heif, webp, avif, jp2, tiff, bmp
15
+ * - audio: mp3, wav, aac, flac, webm, weba, m4a, opus, ogg, oga, aiff, amr
16
+ * - image: png, jpg, jpeg, jfif, heic, heif, webp, avif, jp2, tiff, tif, bmp
17
17
  * - gif: gif, webp, webm
18
18
  *
19
19
  * > Note: `gif` is only supported for face swap API `video_file_path` field.
@@ -17,8 +17,8 @@ class UploadUrlsClient extends make_api_request_js_1.CoreResourceClient {
17
17
  *
18
18
  * **Valid file extensions per asset type**:
19
19
  * - video: mp4, m4v, mov, webm
20
- * - audio: mp3, wav, aac, flac, webm, m4a, opus, ogg, aiff, amr
21
- * - image: png, jpg, jpeg, jfif, heic, heif, webp, avif, jp2, tiff, bmp
20
+ * - audio: mp3, wav, aac, flac, webm, weba, m4a, opus, ogg, oga, aiff, amr
21
+ * - image: png, jpg, jpeg, jfif, heic, heif, webp, avif, jp2, tiff, tif, bmp
22
22
  * - gif: gif, webp, webm
23
23
  *
24
24
  * > Note: `gif` is only supported for face swap API `video_file_path` field.
@@ -8,6 +8,7 @@ export * as aiImageUpscaler from "./ai-image-upscaler";
8
8
  export * as aiMemeGenerator from "./ai-meme-generator";
9
9
  export * as aiQrCodeGenerator from "./ai-qr-code-generator";
10
10
  export * as aiTalkingPhoto from "./ai-talking-photo";
11
+ export * as aiVideoEditor from "./ai-video-editor";
11
12
  export * as aiVoiceCloner from "./ai-voice-cloner";
12
13
  export * as aiVoiceGenerator from "./ai-voice-generator";
13
14
  export * as animation from "./animation";
@@ -15,6 +16,7 @@ export * as audioProjects from "./audio-projects";
15
16
  export * as audioToVideo from "./audio-to-video";
16
17
  export * as autoSubtitleGenerator from "./auto-subtitle-generator";
17
18
  export * as bodySwap from "./body-swap";
19
+ export * as characterReplace from "./character-replace";
18
20
  export * as faceDetection from "./face-detection";
19
21
  export * as faceSwap from "./face-swap";
20
22
  export * as faceSwapPhoto from "./face-swap-photo";
@@ -33,7 +33,7 @@ var __importStar = (this && this.__importStar) || (function () {
33
33
  };
34
34
  })();
35
35
  Object.defineProperty(exports, "__esModule", { value: true });
36
- exports.videoToVideo = exports.videoProjects = exports.textToVideo = exports.V1Client = exports.photoColorizer = exports.lipSync = exports.imageToVideo = exports.imageProjects = exports.imageBackgroundRemover = exports.headSwap = exports.files = exports.faceSwapPhoto = exports.faceSwap = exports.faceDetection = exports.bodySwap = exports.autoSubtitleGenerator = exports.audioToVideo = exports.audioProjects = exports.animation = exports.aiVoiceGenerator = exports.aiVoiceCloner = exports.aiTalkingPhoto = exports.aiQrCodeGenerator = exports.aiMemeGenerator = exports.aiImageUpscaler = exports.aiImageGenerator = exports.aiImageEditor = exports.aiHeadshotGenerator = exports.aiGifGenerator = exports.aiFaceEditor = exports.aiClothesChanger = void 0;
36
+ exports.videoToVideo = exports.videoProjects = exports.textToVideo = exports.V1Client = exports.photoColorizer = exports.lipSync = exports.imageToVideo = exports.imageProjects = exports.imageBackgroundRemover = exports.headSwap = exports.files = exports.faceSwapPhoto = exports.faceSwap = exports.faceDetection = exports.characterReplace = exports.bodySwap = exports.autoSubtitleGenerator = exports.audioToVideo = exports.audioProjects = exports.animation = exports.aiVoiceGenerator = exports.aiVoiceCloner = exports.aiVideoEditor = exports.aiTalkingPhoto = exports.aiQrCodeGenerator = exports.aiMemeGenerator = exports.aiImageUpscaler = exports.aiImageGenerator = exports.aiImageEditor = exports.aiHeadshotGenerator = exports.aiGifGenerator = exports.aiFaceEditor = exports.aiClothesChanger = void 0;
37
37
  exports.aiClothesChanger = __importStar(require("./ai-clothes-changer"));
38
38
  exports.aiFaceEditor = __importStar(require("./ai-face-editor"));
39
39
  exports.aiGifGenerator = __importStar(require("./ai-gif-generator"));
@@ -44,6 +44,7 @@ exports.aiImageUpscaler = __importStar(require("./ai-image-upscaler"));
44
44
  exports.aiMemeGenerator = __importStar(require("./ai-meme-generator"));
45
45
  exports.aiQrCodeGenerator = __importStar(require("./ai-qr-code-generator"));
46
46
  exports.aiTalkingPhoto = __importStar(require("./ai-talking-photo"));
47
+ exports.aiVideoEditor = __importStar(require("./ai-video-editor"));
47
48
  exports.aiVoiceCloner = __importStar(require("./ai-voice-cloner"));
48
49
  exports.aiVoiceGenerator = __importStar(require("./ai-voice-generator"));
49
50
  exports.animation = __importStar(require("./animation"));
@@ -51,6 +52,7 @@ exports.audioProjects = __importStar(require("./audio-projects"));
51
52
  exports.audioToVideo = __importStar(require("./audio-to-video"));
52
53
  exports.autoSubtitleGenerator = __importStar(require("./auto-subtitle-generator"));
53
54
  exports.bodySwap = __importStar(require("./body-swap"));
55
+ exports.characterReplace = __importStar(require("./character-replace"));
54
56
  exports.faceDetection = __importStar(require("./face-detection"));
55
57
  exports.faceSwap = __importStar(require("./face-swap"));
56
58
  exports.faceSwapPhoto = __importStar(require("./face-swap-photo"));
@@ -9,6 +9,7 @@ import { AiImageUpscalerClient } from "../../resources/v1/ai-image-upscaler";
9
9
  import { AiMemeGeneratorClient } from "../../resources/v1/ai-meme-generator";
10
10
  import { AiQrCodeGeneratorClient } from "../../resources/v1/ai-qr-code-generator";
11
11
  import { AiTalkingPhotoClient } from "../../resources/v1/ai-talking-photo";
12
+ import { AiVideoEditorClient } from "../../resources/v1/ai-video-editor";
12
13
  import { AiVoiceClonerClient } from "../../resources/v1/ai-voice-cloner";
13
14
  import { AiVoiceGeneratorClient } from "../../resources/v1/ai-voice-generator";
14
15
  import { AnimationClient } from "../../resources/v1/animation";
@@ -16,6 +17,7 @@ import { AudioProjectsClient } from "../../resources/v1/audio-projects";
16
17
  import { AudioToVideoClient } from "../../resources/v1/audio-to-video";
17
18
  import { AutoSubtitleGeneratorClient } from "../../resources/v1/auto-subtitle-generator";
18
19
  import { BodySwapClient } from "../../resources/v1/body-swap";
20
+ import { CharacterReplaceClient } from "../../resources/v1/character-replace";
19
21
  import { FaceDetectionClient } from "../../resources/v1/face-detection";
20
22
  import { FaceSwapClient } from "../../resources/v1/face-swap";
21
23
  import { FaceSwapPhotoClient } from "../../resources/v1/face-swap-photo";
@@ -30,6 +32,8 @@ import { TextToVideoClient } from "../../resources/v1/text-to-video";
30
32
  import { VideoProjectsClient } from "../../resources/v1/video-projects";
31
33
  import { VideoToVideoClient } from "../../resources/v1/video-to-video";
32
34
  export declare class V1Client extends CoreResourceClient {
35
+ private _characterReplaceLazy?;
36
+ private _aiVideoEditorLazy?;
33
37
  private _audioToVideoLazy?;
34
38
  private _bodySwapLazy?;
35
39
  private _headSwapLazy?;
@@ -91,4 +95,6 @@ export declare class V1Client extends CoreResourceClient {
91
95
  get headSwap(): HeadSwapClient;
92
96
  get bodySwap(): BodySwapClient;
93
97
  get audioToVideo(): AudioToVideoClient;
98
+ get aiVideoEditor(): AiVideoEditorClient;
99
+ get characterReplace(): CharacterReplaceClient;
94
100
  }
@@ -16,6 +16,7 @@ class V1Client extends make_api_request_js_1.CoreResourceClient {
16
16
  this.aiMemeGenerator;
17
17
  this.aiQrCodeGenerator;
18
18
  this.aiTalkingPhoto;
19
+ this.aiVideoEditor;
19
20
  this.aiVoiceCloner;
20
21
  this.aiVoiceGenerator;
21
22
  this.animation;
@@ -23,6 +24,7 @@ class V1Client extends make_api_request_js_1.CoreResourceClient {
23
24
  this.audioToVideo;
24
25
  this.autoSubtitleGenerator;
25
26
  this.bodySwap;
27
+ this.characterReplace;
26
28
  this.faceDetection;
27
29
  this.faceSwap;
28
30
  this.faceSwapPhoto;
@@ -182,5 +184,15 @@ class V1Client extends make_api_request_js_1.CoreResourceClient {
182
184
  return ((_a = this._audioToVideoLazy) !== null && _a !== void 0 ? _a : (this._audioToVideoLazy =
183
185
  new (require("./audio-to-video").AudioToVideoClient)(this._client, this._opts)));
184
186
  }
187
+ get aiVideoEditor() {
188
+ var _a;
189
+ return ((_a = this._aiVideoEditorLazy) !== null && _a !== void 0 ? _a : (this._aiVideoEditorLazy =
190
+ new (require("./ai-video-editor").AiVideoEditorClient)(this._client, this._opts)));
191
+ }
192
+ get characterReplace() {
193
+ var _a;
194
+ return ((_a = this._characterReplaceLazy) !== null && _a !== void 0 ? _a : (this._characterReplaceLazy =
195
+ new (require("./character-replace").CharacterReplaceClient)(this._client, this._opts)));
196
+ }
185
197
  }
186
198
  exports.V1Client = V1Client;
@@ -49,6 +49,10 @@ export { V1AiTalkingPhotoCreateBodyAssets } from "./v1-ai-talking-photo-create-b
49
49
  export { V1AiTalkingPhotoCreateBodyStyle } from "./v1-ai-talking-photo-create-body-style";
50
50
  export { V1AiTalkingPhotoCreateBodyStyleGenerationModeEnum } from "./v1-ai-talking-photo-create-body-style-generation-mode-enum";
51
51
  export { V1AiTalkingPhotoCreateResponse } from "./v1-ai-talking-photo-create-response";
52
+ export { V1AiVideoEditorCreateBody } from "./v1-ai-video-editor-create-body";
53
+ export { V1AiVideoEditorCreateBodyAssets } from "./v1-ai-video-editor-create-body-assets";
54
+ export { V1AiVideoEditorCreateBodyStyle } from "./v1-ai-video-editor-create-body-style";
55
+ export { V1AiVideoEditorCreateResponse } from "./v1-ai-video-editor-create-response";
52
56
  export { V1AiVoiceClonerCreateBody } from "./v1-ai-voice-cloner-create-body";
53
57
  export { V1AiVoiceClonerCreateBodyAssets } from "./v1-ai-voice-cloner-create-body-assets";
54
58
  export { V1AiVoiceClonerCreateBodyStyle } from "./v1-ai-voice-cloner-create-body-style";
@@ -84,6 +88,14 @@ export { V1BodySwapCreateBody } from "./v1-body-swap-create-body";
84
88
  export { V1BodySwapCreateBodyAssets } from "./v1-body-swap-create-body-assets";
85
89
  export { V1BodySwapCreateBodyResolutionEnum } from "./v1-body-swap-create-body-resolution-enum";
86
90
  export { V1BodySwapCreateResponse } from "./v1-body-swap-create-response";
91
+ export { V1CharacterReplaceCreateBody } from "./v1-character-replace-create-body";
92
+ export { V1CharacterReplaceCreateBodyAssets } from "./v1-character-replace-create-body-assets";
93
+ export { V1CharacterReplaceCreateBodyResolutionEnum } from "./v1-character-replace-create-body-resolution-enum";
94
+ export { V1CharacterReplaceCreateBodyStyle } from "./v1-character-replace-create-body-style";
95
+ export { V1CharacterReplaceCreateBodyStyleModeEnum } from "./v1-character-replace-create-body-style-mode-enum";
96
+ export { V1CharacterReplaceCreateBodyStylePointsItem } from "./v1-character-replace-create-body-style-points-item";
97
+ export { V1CharacterReplaceCreateBodyStyleSelectionModeEnum } from "./v1-character-replace-create-body-style-selection-mode-enum";
98
+ export { V1CharacterReplaceCreateResponse } from "./v1-character-replace-create-response";
87
99
  export { V1FaceDetectionCreateBody } from "./v1-face-detection-create-body";
88
100
  export { V1FaceDetectionCreateBodyAssets } from "./v1-face-detection-create-body-assets";
89
101
  export { V1FaceDetectionCreateResponse } from "./v1-face-detection-create-response";
@@ -1,4 +1,4 @@
1
1
  /**
2
- * V1AiImageUpscalerCreateBodyStyleEnhancementEnum
2
+ * Deprecated: use `mode` instead. `"Resemblance"` maps to `"preserve"`. `"Balanced"` and `"Creative"` map to the same-named modes.
3
3
  */
4
4
  export type V1AiImageUpscalerCreateBodyStyleEnhancementEnum = "Balanced" | "Creative" | "Resemblance";
@@ -1,4 +1,4 @@
1
1
  /**
2
- * The upscaling mode. `"pro"` is faster and does not require `enhancement`. `"creative"` requires `enhancement`. Defaults to `"creative"`.
2
+ * The upscaling mode. `"preserve"` uses the fast pro pipeline (1× credit multiplier). `"balanced"` and `"creative"` use the creative pipeline (2× credit multiplier). `"pro"` is deprecated and maps to `"preserve"`. Defaults to `"balanced"`.
3
3
  */
4
- export type V1AiImageUpscalerCreateBodyStyleModeEnum = "creative" | "pro";
4
+ export type V1AiImageUpscalerCreateBodyStyleModeEnum = "balanced" | "creative" | "preserve" | "pro";
@@ -1,15 +1,18 @@
1
1
  import * as z from "zod";
2
2
  /**
3
- * Style settings for the upscale. Use `mode` to select between `"pro"` (faster, no enhancement required) and `"creative"` (defaults to `"Balanced"` enhancement). Defaults to `"creative"`.
3
+ * Style settings for the upscale. Use `mode` (`"preserve"`, `"balanced"`, or `"creative"`). Defaults to `"balanced"`.
4
4
  */
5
5
  export type V1AiImageUpscalerCreateBodyStyle = {
6
+ /**
7
+ * Deprecated: use `mode` instead. `"Resemblance"` maps to `"preserve"`. `"Balanced"` and `"Creative"` map to the same-named modes.
8
+ */
6
9
  enhancement?: ("Balanced" | "Creative" | "Resemblance") | undefined;
7
10
  /**
8
- * The upscaling mode. `"pro"` is faster and does not require `enhancement`. `"creative"` requires `enhancement`. Defaults to `"creative"`.
11
+ * The upscaling mode. `"preserve"` uses the fast pro pipeline (1× credit multiplier). `"balanced"` and `"creative"` use the creative pipeline (2× credit multiplier). `"pro"` is deprecated and maps to `"preserve"`. Defaults to `"balanced"`.
9
12
  */
10
- mode?: ("creative" | "pro") | undefined;
13
+ mode?: ("balanced" | "creative" | "preserve" | "pro") | undefined;
11
14
  /**
12
- * A prompt to guide the final image. This value is ignored if `enhancement` is not Creative
15
+ * A prompt to guide the final image. Only used when mode is `creative`.
13
16
  */
14
17
  prompt?: string | undefined;
15
18
  };
@@ -20,7 +23,7 @@ export type V1AiImageUpscalerCreateBodyStyle = {
20
23
  */
21
24
  export type External$V1AiImageUpscalerCreateBodyStyle = {
22
25
  enhancement?: ("Balanced" | "Creative" | "Resemblance") | undefined;
23
- mode?: ("creative" | "pro") | undefined;
26
+ mode?: ("balanced" | "creative" | "preserve" | "pro") | undefined;
24
27
  prompt?: string | undefined;
25
28
  };
26
29
  export declare const Schemas$V1AiImageUpscalerCreateBodyStyle: {
@@ -42,7 +42,7 @@ const z = __importStar(require("zod"));
42
42
  const SchemaIn$V1AiImageUpscalerCreateBodyStyle = z
43
43
  .object({
44
44
  enhancement: z.enum(["Balanced", "Creative", "Resemblance"]).optional(),
45
- mode: z.enum(["creative", "pro"]).optional(),
45
+ mode: z.enum(["balanced", "creative", "preserve", "pro"]).optional(),
46
46
  prompt: z.string().optional(),
47
47
  })
48
48
  .transform((obj) => {
@@ -59,7 +59,7 @@ const SchemaIn$V1AiImageUpscalerCreateBodyStyle = z
59
59
  const SchemaOut$V1AiImageUpscalerCreateBodyStyle = z
60
60
  .object({
61
61
  enhancement: z.enum(["Balanced", "Creative", "Resemblance"]).optional(),
62
- mode: z.enum(["creative", "pro"]).optional(),
62
+ mode: z.enum(["balanced", "creative", "preserve", "pro"]).optional(),
63
63
  prompt: z.string().optional(),
64
64
  })
65
65
  .transform((obj) => {
@@ -20,9 +20,9 @@ export type V1AiImageUpscalerCreateBody = {
20
20
  */
21
21
  scaleFactor: number;
22
22
  /**
23
- * Style settings for the upscale. Use `mode` to select between `"pro"` (faster, no enhancement required) and `"creative"` (defaults to `"Balanced"` enhancement). Defaults to `"creative"`.
23
+ * Style settings for the upscale. Use `mode` (`"preserve"`, `"balanced"`, or `"creative"`). Defaults to `"balanced"`.
24
24
  */
25
- style: V1AiImageUpscalerCreateBodyStyle;
25
+ style?: V1AiImageUpscalerCreateBodyStyle | undefined;
26
26
  };
27
27
  /**
28
28
  * @internal
@@ -33,7 +33,7 @@ export type External$V1AiImageUpscalerCreateBody = {
33
33
  assets: External$V1AiImageUpscalerCreateBodyAssets;
34
34
  name?: string | undefined;
35
35
  scale_factor: number;
36
- style: External$V1AiImageUpscalerCreateBodyStyle;
36
+ style?: External$V1AiImageUpscalerCreateBodyStyle | undefined;
37
37
  };
38
38
  export declare const Schemas$V1AiImageUpscalerCreateBody: {
39
39
  in: z.ZodType<V1AiImageUpscalerCreateBody, z.ZodTypeDef, unknown>;
@@ -46,7 +46,7 @@ const SchemaIn$V1AiImageUpscalerCreateBody = z
46
46
  assets: v1_ai_image_upscaler_create_body_assets_1.Schemas$V1AiImageUpscalerCreateBodyAssets.in,
47
47
  name: z.string().optional(),
48
48
  scale_factor: z.number(),
49
- style: v1_ai_image_upscaler_create_body_style_1.Schemas$V1AiImageUpscalerCreateBodyStyle.in,
49
+ style: v1_ai_image_upscaler_create_body_style_1.Schemas$V1AiImageUpscalerCreateBodyStyle.in.optional(),
50
50
  })
51
51
  .transform((obj) => {
52
52
  return (0, make_api_request_js_1.zodTransform)(obj, {
@@ -65,7 +65,7 @@ const SchemaOut$V1AiImageUpscalerCreateBody = z
65
65
  assets: v1_ai_image_upscaler_create_body_assets_1.Schemas$V1AiImageUpscalerCreateBodyAssets.out,
66
66
  name: z.string().optional(),
67
67
  scaleFactor: z.number(),
68
- style: v1_ai_image_upscaler_create_body_style_1.Schemas$V1AiImageUpscalerCreateBodyStyle.out,
68
+ style: v1_ai_image_upscaler_create_body_style_1.Schemas$V1AiImageUpscalerCreateBodyStyle.out.optional(),
69
69
  })
70
70
  .transform((obj) => {
71
71
  return (0, make_api_request_js_1.zodTransform)(obj, {
@@ -0,0 +1,27 @@
1
+ import * as z from "zod";
2
+ /**
3
+ * Provide the assets for video editing.
4
+ */
5
+ export type V1AiVideoEditorCreateBodyAssets = {
6
+ /**
7
+ * The video to edit. 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
+ videoFilePath: string;
15
+ };
16
+ /**
17
+ * @internal
18
+ * V1AiVideoEditorCreateBodyAssets without any key transformation, this is what
19
+ * we expect to come in as network data
20
+ */
21
+ export type External$V1AiVideoEditorCreateBodyAssets = {
22
+ video_file_path: string;
23
+ };
24
+ export declare const Schemas$V1AiVideoEditorCreateBodyAssets: {
25
+ in: z.ZodType<V1AiVideoEditorCreateBodyAssets, z.ZodTypeDef, unknown>;
26
+ out: z.ZodType<External$V1AiVideoEditorCreateBodyAssets, z.ZodTypeDef, V1AiVideoEditorCreateBodyAssets>;
27
+ };
@@ -0,0 +1,67 @@
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$V1AiVideoEditorCreateBodyAssets = 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 V1AiVideoEditorCreateBodyAssets
41
+ */
42
+ const SchemaIn$V1AiVideoEditorCreateBodyAssets = z
43
+ .object({
44
+ video_file_path: z.string(),
45
+ })
46
+ .transform((obj) => {
47
+ return (0, make_api_request_js_1.zodTransform)(obj, {
48
+ video_file_path: "videoFilePath",
49
+ });
50
+ });
51
+ /**
52
+ * @internal
53
+ * Takes typescript data, validates it, and maps keys to match the expected external object External$V1AiVideoEditorCreateBodyAssets
54
+ */
55
+ const SchemaOut$V1AiVideoEditorCreateBodyAssets = z
56
+ .object({
57
+ videoFilePath: z.string(),
58
+ })
59
+ .transform((obj) => {
60
+ return (0, make_api_request_js_1.zodTransform)(obj, {
61
+ videoFilePath: "video_file_path",
62
+ });
63
+ });
64
+ exports.Schemas$V1AiVideoEditorCreateBodyAssets = {
65
+ in: SchemaIn$V1AiVideoEditorCreateBodyAssets,
66
+ out: SchemaOut$V1AiVideoEditorCreateBodyAssets,
67
+ };
@@ -0,0 +1,22 @@
1
+ import * as z from "zod";
2
+ /**
3
+ * V1AiVideoEditorCreateBodyStyle
4
+ */
5
+ export type V1AiVideoEditorCreateBodyStyle = {
6
+ /**
7
+ * The prompt used to edit the video.
8
+ */
9
+ prompt: string;
10
+ };
11
+ /**
12
+ * @internal
13
+ * V1AiVideoEditorCreateBodyStyle without any key transformation, this is what
14
+ * we expect to come in as network data
15
+ */
16
+ export type External$V1AiVideoEditorCreateBodyStyle = {
17
+ prompt: string;
18
+ };
19
+ export declare const Schemas$V1AiVideoEditorCreateBodyStyle: {
20
+ in: z.ZodType<V1AiVideoEditorCreateBodyStyle, z.ZodTypeDef, unknown>;
21
+ out: z.ZodType<External$V1AiVideoEditorCreateBodyStyle, z.ZodTypeDef, V1AiVideoEditorCreateBodyStyle>;
22
+ };