magic-hour 0.49.0 → 0.51.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 +1 -1
- package/dist/environment.d.ts +1 -1
- package/dist/environment.js +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +2 -1
- package/dist/resources/v1/ai-clothes-changer/resource-client.d.ts +1 -1
- package/dist/resources/v1/ai-clothes-changer/resource-client.js +1 -1
- package/dist/resources/v1/ai-face-editor/resource-client.d.ts +1 -1
- package/dist/resources/v1/ai-face-editor/resource-client.js +1 -1
- package/dist/resources/v1/ai-gif-generator/resource-client.d.ts +1 -1
- package/dist/resources/v1/ai-gif-generator/resource-client.js +1 -1
- package/dist/resources/v1/ai-headshot-generator/resource-client.d.ts +1 -1
- package/dist/resources/v1/ai-headshot-generator/resource-client.js +1 -1
- package/dist/resources/v1/ai-image-editor/request-types.d.ts +39 -0
- package/dist/resources/v1/ai-image-editor/request-types.js +34 -0
- package/dist/resources/v1/ai-image-editor/resource-client.d.ts +2 -2
- package/dist/resources/v1/ai-image-editor/resource-client.js +2 -2
- package/dist/resources/v1/ai-image-generator/resource-client.d.ts +1 -1
- package/dist/resources/v1/ai-image-generator/resource-client.js +1 -1
- package/dist/resources/v1/ai-image-upscaler/resource-client.d.ts +1 -1
- package/dist/resources/v1/ai-image-upscaler/resource-client.js +1 -1
- package/dist/resources/v1/ai-meme-generator/resource-client.d.ts +1 -1
- package/dist/resources/v1/ai-meme-generator/resource-client.js +1 -1
- package/dist/resources/v1/ai-qr-code-generator/resource-client.d.ts +1 -1
- package/dist/resources/v1/ai-qr-code-generator/resource-client.js +1 -1
- package/dist/resources/v1/ai-talking-photo/resource-client.d.ts +1 -1
- package/dist/resources/v1/ai-talking-photo/resource-client.js +1 -1
- package/dist/resources/v1/ai-voice-cloner/resource-client.d.ts +1 -1
- package/dist/resources/v1/ai-voice-cloner/resource-client.js +1 -1
- package/dist/resources/v1/ai-voice-generator/resource-client.d.ts +1 -1
- package/dist/resources/v1/ai-voice-generator/resource-client.js +1 -1
- package/dist/resources/v1/animation/resource-client.d.ts +1 -1
- package/dist/resources/v1/animation/resource-client.js +1 -1
- package/dist/resources/v1/auto-subtitle-generator/resource-client.d.ts +1 -1
- package/dist/resources/v1/auto-subtitle-generator/resource-client.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/files/resource-client.test.js +2 -5
- package/dist/resources/v1/files/upload-urls/resource-client.d.ts +1 -1
- package/dist/resources/v1/files/upload-urls/resource-client.js +1 -1
- package/dist/resources/v1/image-background-remover/resource-client.d.ts +1 -1
- package/dist/resources/v1/image-background-remover/resource-client.js +1 -1
- package/dist/resources/v1/image-to-video/request-types.d.ts +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/photo-colorizer/resource-client.d.ts +1 -1
- package/dist/resources/v1/photo-colorizer/resource-client.js +1 -1
- package/dist/resources/v1/text-to-video/request-types.d.ts +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-ai-image-editor-create-body-aspect-ratio-enum.d.ts +4 -0
- package/dist/types/v1-ai-image-editor-create-body-aspect-ratio-enum.js +2 -0
- package/dist/types/v1-ai-image-editor-create-body-model-enum.d.ts +28 -0
- package/dist/types/v1-ai-image-editor-create-body-model-enum.js +2 -0
- package/dist/types/v1-ai-image-editor-create-body-style-model-enum.d.ts +1 -1
- package/dist/types/v1-ai-image-editor-create-body-style.d.ts +1 -1
- package/dist/types/v1-ai-image-editor-create-body.d.ts +39 -0
- package/dist/types/v1-ai-image-editor-create-body.js +34 -0
- package/dist/types/v1-files-upload-urls-create-body-items-item.d.ts +1 -1
- package/dist/types/v1-image-projects-get-response.d.ts +1 -1
- package/dist/types/v1-image-to-video-create-body.d.ts +1 -1
- package/dist/types/v1-text-to-video-create-body.d.ts +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -19,7 +19,7 @@ npm install magic-hour
|
|
|
19
19
|
## Usage
|
|
20
20
|
|
|
21
21
|
```ts
|
|
22
|
-
import Client from "magic-hour";
|
|
22
|
+
import { Client } from "magic-hour";
|
|
23
23
|
// generate your API Key at https://magichour.ai/developer
|
|
24
24
|
const client = new Client({ token: process.env["API_TOKEN"]!! });
|
|
25
25
|
const res = await client.v1.faceSwapPhoto.generate(
|
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.51.0";
|
|
8
8
|
})(Environment || (exports.Environment = Environment = {}));
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { ApiError, ApiResponse, BinaryResponse, RequestOptions, UploadFile, isUploadFile, } from "make-api-request-js";
|
|
2
|
-
export { Client as default } from "./client";
|
|
2
|
+
export { Client, Client as default } from "./client";
|
|
3
3
|
export { Environment } from "./environment";
|
|
4
4
|
export * as resources from "./resources";
|
|
5
5
|
export * as types from "./types";
|
package/dist/index.js
CHANGED
|
@@ -33,12 +33,13 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
33
33
|
};
|
|
34
34
|
})();
|
|
35
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
-
exports.types = exports.resources = exports.Environment = exports.default = exports.isUploadFile = exports.BinaryResponse = exports.ApiError = void 0;
|
|
36
|
+
exports.types = exports.resources = exports.Environment = exports.default = exports.Client = exports.isUploadFile = exports.BinaryResponse = exports.ApiError = void 0;
|
|
37
37
|
var make_api_request_js_1 = require("make-api-request-js");
|
|
38
38
|
Object.defineProperty(exports, "ApiError", { enumerable: true, get: function () { return make_api_request_js_1.ApiError; } });
|
|
39
39
|
Object.defineProperty(exports, "BinaryResponse", { enumerable: true, get: function () { return make_api_request_js_1.BinaryResponse; } });
|
|
40
40
|
Object.defineProperty(exports, "isUploadFile", { enumerable: true, get: function () { return make_api_request_js_1.isUploadFile; } });
|
|
41
41
|
var client_1 = require("./client");
|
|
42
|
+
Object.defineProperty(exports, "Client", { enumerable: true, get: function () { return client_1.Client; } });
|
|
42
43
|
Object.defineProperty(exports, "default", { enumerable: true, get: function () { return client_1.Client; } });
|
|
43
44
|
var environment_1 = require("./environment");
|
|
44
45
|
Object.defineProperty(exports, "Environment", { enumerable: true, get: function () { return environment_1.Environment; } });
|
|
@@ -31,7 +31,7 @@ export declare class AiClothesChangerClient extends CoreResourceClient {
|
|
|
31
31
|
*
|
|
32
32
|
* @example
|
|
33
33
|
* ```typescript
|
|
34
|
-
* import Client from "../../../index.js";
|
|
34
|
+
* import { Client } from "../../../index.js";
|
|
35
35
|
*
|
|
36
36
|
* const client = new Client({ token: process.env["API_TOKEN"]!! });
|
|
37
37
|
* const res = await client.v1.aiClothesChanger.generate(
|
|
@@ -40,7 +40,7 @@ class AiClothesChangerClient extends make_api_request_js_1.CoreResourceClient {
|
|
|
40
40
|
*
|
|
41
41
|
* @example
|
|
42
42
|
* ```typescript
|
|
43
|
-
* import Client from "../../../index.js";
|
|
43
|
+
* import { Client } from "../../../index.js";
|
|
44
44
|
*
|
|
45
45
|
* const client = new Client({ token: process.env["API_TOKEN"]!! });
|
|
46
46
|
* const res = await client.v1.aiClothesChanger.generate(
|
|
@@ -23,7 +23,7 @@ export declare class AiFaceEditorClient extends CoreResourceClient {
|
|
|
23
23
|
*
|
|
24
24
|
* @example
|
|
25
25
|
* ```typescript
|
|
26
|
-
* import Client from "../../../index.js";
|
|
26
|
+
* import { Client } from "../../../index.js";
|
|
27
27
|
*
|
|
28
28
|
* const client = new Client({ token: process.env["API_TOKEN"]!! });
|
|
29
29
|
* const res = await client.v1.aiFaceEditor.generate(
|
|
@@ -40,7 +40,7 @@ class AiFaceEditorClient extends make_api_request_js_1.CoreResourceClient {
|
|
|
40
40
|
*
|
|
41
41
|
* @example
|
|
42
42
|
* ```typescript
|
|
43
|
-
* import Client from "../../../index.js";
|
|
43
|
+
* import { Client } from "../../../index.js";
|
|
44
44
|
*
|
|
45
45
|
* const client = new Client({ token: process.env["API_TOKEN"]!! });
|
|
46
46
|
* const res = await client.v1.aiFaceEditor.generate(
|
|
@@ -14,7 +14,7 @@ export declare class AiGifGeneratorClient extends CoreResourceClient {
|
|
|
14
14
|
*
|
|
15
15
|
* @example
|
|
16
16
|
* ```typescript
|
|
17
|
-
* import Client from "../../../index.js";
|
|
17
|
+
* import { Client } from "../../../index.js";
|
|
18
18
|
*
|
|
19
19
|
* const client = new Client({ token: process.env["API_TOKEN"]!! });
|
|
20
20
|
* const res = await client.v1.aiGifGenerator.generate(
|
|
@@ -39,7 +39,7 @@ class AiGifGeneratorClient extends make_api_request_js_1.CoreResourceClient {
|
|
|
39
39
|
*
|
|
40
40
|
* @example
|
|
41
41
|
* ```typescript
|
|
42
|
-
* import Client from "../../../index.js";
|
|
42
|
+
* import { Client } from "../../../index.js";
|
|
43
43
|
*
|
|
44
44
|
* const client = new Client({ token: process.env["API_TOKEN"]!! });
|
|
45
45
|
* const res = await client.v1.aiGifGenerator.generate(
|
|
@@ -23,7 +23,7 @@ export declare class AiHeadshotGeneratorClient extends CoreResourceClient {
|
|
|
23
23
|
*
|
|
24
24
|
* @example
|
|
25
25
|
* ```typescript
|
|
26
|
-
* import Client from "../../../index.js";
|
|
26
|
+
* import { Client } from "../../../index.js";
|
|
27
27
|
*
|
|
28
28
|
* const client = new Client({ token: process.env["API_TOKEN"]!! });
|
|
29
29
|
* const res = await client.v1.aiHeadshotGenerator.generate(
|
|
@@ -40,7 +40,7 @@ class AiHeadshotGeneratorClient extends make_api_request_js_1.CoreResourceClient
|
|
|
40
40
|
*
|
|
41
41
|
* @example
|
|
42
42
|
* ```typescript
|
|
43
|
-
* import Client from "../../../index.js";
|
|
43
|
+
* import { Client } from "../../../index.js";
|
|
44
44
|
*
|
|
45
45
|
* const client = new Client({ token: process.env["API_TOKEN"]!! });
|
|
46
46
|
* const res = await client.v1.aiHeadshotGenerator.generate(
|
|
@@ -5,10 +5,46 @@ import { External$V1AiImageEditorCreateBodyStyle, V1AiImageEditorCreateBodyStyle
|
|
|
5
5
|
* CreateRequest
|
|
6
6
|
*/
|
|
7
7
|
export type CreateRequest = {
|
|
8
|
+
/**
|
|
9
|
+
* The aspect ratio of the output image(s). If not specified, defaults to `auto`.
|
|
10
|
+
*/
|
|
11
|
+
aspectRatio?: ("16:9" | "1:1" | "2:3" | "3:2" | "4:3" | "4:5" | "9:16" | "auto") | undefined;
|
|
8
12
|
/**
|
|
9
13
|
* Provide the assets for image edit
|
|
10
14
|
*/
|
|
11
15
|
assets: V1AiImageEditorCreateBodyAssets;
|
|
16
|
+
/**
|
|
17
|
+
* Number of images to generate. Maximum varies by model. Defaults to 1 if not specified.
|
|
18
|
+
*/
|
|
19
|
+
imageCount?: number | undefined;
|
|
20
|
+
/**
|
|
21
|
+
* The AI model to use for image editing. Each model has different capabilities and costs.
|
|
22
|
+
*
|
|
23
|
+
* **Models:**
|
|
24
|
+
* - `default` - Use the model we recommend, which will change over time. This is recommended unless you need a specific model. This is the default behavior.
|
|
25
|
+
* - `qwen-edit` - 10 credits/image
|
|
26
|
+
* - Available for tiers: free, creator, pro, business
|
|
27
|
+
* - Image count allowed: 1
|
|
28
|
+
* - Max additional input images: 2
|
|
29
|
+
* - `nano-banana` - 50 credits/image
|
|
30
|
+
* - Available for tiers: free, creator, pro, business
|
|
31
|
+
* - Image count allowed: 1
|
|
32
|
+
* - Max additional input images: 9
|
|
33
|
+
* - `seedream-v4` - 50 credits/image
|
|
34
|
+
* - Available for tiers: free, creator, pro, business
|
|
35
|
+
* - Image count allowed: 1
|
|
36
|
+
* - Max additional input images: 9
|
|
37
|
+
* - `nano-banana-pro` - 150 credits/image
|
|
38
|
+
* - Available for tiers: creator, pro, business
|
|
39
|
+
* - Image count allowed: 1, 4, 9, 16
|
|
40
|
+
* - Max additional input images: 9
|
|
41
|
+
* - `seedream-v4.5` - 100 credits/image
|
|
42
|
+
* - Available for tiers: creator, pro, business
|
|
43
|
+
* - Image count allowed: 1
|
|
44
|
+
* - Max additional input images: 9
|
|
45
|
+
*
|
|
46
|
+
*/
|
|
47
|
+
model?: ("default" | "nano-banana" | "nano-banana-pro" | "qwen-edit" | "seedream-v4" | "seedream-v4.5") | undefined;
|
|
12
48
|
/**
|
|
13
49
|
* Give your image a custom name for easy identification.
|
|
14
50
|
*/
|
|
@@ -21,7 +57,10 @@ export type CreateRequest = {
|
|
|
21
57
|
* we expect to come in as network data
|
|
22
58
|
*/
|
|
23
59
|
export type External$CreateRequest = {
|
|
60
|
+
aspect_ratio?: ("16:9" | "1:1" | "2:3" | "3:2" | "4:3" | "4:5" | "9:16" | "auto") | undefined;
|
|
24
61
|
assets: External$V1AiImageEditorCreateBodyAssets;
|
|
62
|
+
image_count?: number | undefined;
|
|
63
|
+
model?: ("default" | "nano-banana" | "nano-banana-pro" | "qwen-edit" | "seedream-v4" | "seedream-v4.5") | undefined;
|
|
25
64
|
name?: string | undefined;
|
|
26
65
|
style: External$V1AiImageEditorCreateBodyStyle;
|
|
27
66
|
};
|
|
@@ -43,13 +43,30 @@ const v1_ai_image_editor_create_body_style_1 = require("../../../types/v1-ai-ima
|
|
|
43
43
|
*/
|
|
44
44
|
const SchemaIn$CreateRequest = z
|
|
45
45
|
.object({
|
|
46
|
+
aspect_ratio: z
|
|
47
|
+
.enum(["16:9", "1:1", "2:3", "3:2", "4:3", "4:5", "9:16", "auto"])
|
|
48
|
+
.optional(),
|
|
46
49
|
assets: v1_ai_image_editor_create_body_assets_1.Schemas$V1AiImageEditorCreateBodyAssets.in,
|
|
50
|
+
image_count: z.number().optional(),
|
|
51
|
+
model: z
|
|
52
|
+
.enum([
|
|
53
|
+
"default",
|
|
54
|
+
"nano-banana",
|
|
55
|
+
"nano-banana-pro",
|
|
56
|
+
"qwen-edit",
|
|
57
|
+
"seedream-v4",
|
|
58
|
+
"seedream-v4.5",
|
|
59
|
+
])
|
|
60
|
+
.optional(),
|
|
47
61
|
name: z.string().optional(),
|
|
48
62
|
style: v1_ai_image_editor_create_body_style_1.Schemas$V1AiImageEditorCreateBodyStyle.in,
|
|
49
63
|
})
|
|
50
64
|
.transform((obj) => {
|
|
51
65
|
return (0, make_api_request_js_1.zodTransform)(obj, {
|
|
66
|
+
aspect_ratio: "aspectRatio",
|
|
52
67
|
assets: "assets",
|
|
68
|
+
image_count: "imageCount",
|
|
69
|
+
model: "model",
|
|
53
70
|
name: "name",
|
|
54
71
|
style: "style",
|
|
55
72
|
});
|
|
@@ -60,13 +77,30 @@ const SchemaIn$CreateRequest = z
|
|
|
60
77
|
*/
|
|
61
78
|
const SchemaOut$CreateRequest = z
|
|
62
79
|
.object({
|
|
80
|
+
aspectRatio: z
|
|
81
|
+
.enum(["16:9", "1:1", "2:3", "3:2", "4:3", "4:5", "9:16", "auto"])
|
|
82
|
+
.optional(),
|
|
63
83
|
assets: v1_ai_image_editor_create_body_assets_1.Schemas$V1AiImageEditorCreateBodyAssets.out,
|
|
84
|
+
imageCount: z.number().optional(),
|
|
85
|
+
model: z
|
|
86
|
+
.enum([
|
|
87
|
+
"default",
|
|
88
|
+
"nano-banana",
|
|
89
|
+
"nano-banana-pro",
|
|
90
|
+
"qwen-edit",
|
|
91
|
+
"seedream-v4",
|
|
92
|
+
"seedream-v4.5",
|
|
93
|
+
])
|
|
94
|
+
.optional(),
|
|
64
95
|
name: z.string().optional(),
|
|
65
96
|
style: v1_ai_image_editor_create_body_style_1.Schemas$V1AiImageEditorCreateBodyStyle.out,
|
|
66
97
|
})
|
|
67
98
|
.transform((obj) => {
|
|
68
99
|
return (0, make_api_request_js_1.zodTransform)(obj, {
|
|
100
|
+
aspectRatio: "aspect_ratio",
|
|
69
101
|
assets: "assets",
|
|
102
|
+
imageCount: "image_count",
|
|
103
|
+
model: "model",
|
|
70
104
|
name: "name",
|
|
71
105
|
style: "style",
|
|
72
106
|
});
|
|
@@ -33,7 +33,7 @@ export declare class AiImageEditorClient extends CoreResourceClient {
|
|
|
33
33
|
*
|
|
34
34
|
* @example
|
|
35
35
|
* ```typescript
|
|
36
|
-
* import Client from "../../../index.js";
|
|
36
|
+
* import { Client } from "../../../index.js";
|
|
37
37
|
*
|
|
38
38
|
* const client = new Client({ token: process.env["API_TOKEN"]!! });
|
|
39
39
|
* const res = await client.v1.aiImageEditor.generate(
|
|
@@ -54,7 +54,7 @@ export declare class AiImageEditorClient extends CoreResourceClient {
|
|
|
54
54
|
/**
|
|
55
55
|
* AI Image Editor
|
|
56
56
|
*
|
|
57
|
-
* Edit images with AI.
|
|
57
|
+
* Edit images with AI.
|
|
58
58
|
*
|
|
59
59
|
* POST /v1/ai-image-editor
|
|
60
60
|
*/
|
|
@@ -40,7 +40,7 @@ class AiImageEditorClient extends make_api_request_js_1.CoreResourceClient {
|
|
|
40
40
|
*
|
|
41
41
|
* @example
|
|
42
42
|
* ```typescript
|
|
43
|
-
* import Client from "../../../index.js";
|
|
43
|
+
* import { Client } from "../../../index.js";
|
|
44
44
|
*
|
|
45
45
|
* const client = new Client({ token: process.env["API_TOKEN"]!! });
|
|
46
46
|
* const res = await client.v1.aiImageEditor.generate(
|
|
@@ -86,7 +86,7 @@ class AiImageEditorClient extends make_api_request_js_1.CoreResourceClient {
|
|
|
86
86
|
/**
|
|
87
87
|
* AI Image Editor
|
|
88
88
|
*
|
|
89
|
-
* Edit images with AI.
|
|
89
|
+
* Edit images with AI.
|
|
90
90
|
*
|
|
91
91
|
* POST /v1/ai-image-editor
|
|
92
92
|
*/
|
|
@@ -14,7 +14,7 @@ export declare class AiImageGeneratorClient extends CoreResourceClient {
|
|
|
14
14
|
*
|
|
15
15
|
* @example
|
|
16
16
|
* ```typescript
|
|
17
|
-
* import Client from "../../../index.js";
|
|
17
|
+
* import { Client } from "../../../index.js";
|
|
18
18
|
*
|
|
19
19
|
* const client = new Client({ token: process.env["API_TOKEN"]!! });
|
|
20
20
|
* const res = await client.v1.aiImageGenerator.generate(
|
|
@@ -39,7 +39,7 @@ class AiImageGeneratorClient extends make_api_request_js_1.CoreResourceClient {
|
|
|
39
39
|
*
|
|
40
40
|
* @example
|
|
41
41
|
* ```typescript
|
|
42
|
-
* import Client from "../../../index.js";
|
|
42
|
+
* import { Client } from "../../../index.js";
|
|
43
43
|
*
|
|
44
44
|
* const client = new Client({ token: process.env["API_TOKEN"]!! });
|
|
45
45
|
* const res = await client.v1.aiImageGenerator.generate(
|
|
@@ -23,7 +23,7 @@ export declare class AiImageUpscalerClient extends CoreResourceClient {
|
|
|
23
23
|
*
|
|
24
24
|
* @example
|
|
25
25
|
* ```typescript
|
|
26
|
-
* import Client from "../../../index.js";
|
|
26
|
+
* import { Client } from "../../../index.js";
|
|
27
27
|
*
|
|
28
28
|
* const client = new Client({ token: process.env["API_TOKEN"]!! });
|
|
29
29
|
* const res = await client.v1.aiImageUpscaler.generate(
|
|
@@ -40,7 +40,7 @@ class AiImageUpscalerClient extends make_api_request_js_1.CoreResourceClient {
|
|
|
40
40
|
*
|
|
41
41
|
* @example
|
|
42
42
|
* ```typescript
|
|
43
|
-
* import Client from "../../../index.js";
|
|
43
|
+
* import { Client } from "../../../index.js";
|
|
44
44
|
*
|
|
45
45
|
* const client = new Client({ token: process.env["API_TOKEN"]!! });
|
|
46
46
|
* const res = await client.v1.aiImageUpscaler.generate(
|
|
@@ -14,7 +14,7 @@ export declare class AiMemeGeneratorClient extends CoreResourceClient {
|
|
|
14
14
|
*
|
|
15
15
|
* @example
|
|
16
16
|
* ```typescript
|
|
17
|
-
* import Client from "../../../index.js";
|
|
17
|
+
* import { Client } from "../../../index.js";
|
|
18
18
|
*
|
|
19
19
|
* const client = new Client({ token: process.env["API_TOKEN"]!! });
|
|
20
20
|
* const res = await client.v1.aiMemeGenerator.generate(
|
|
@@ -39,7 +39,7 @@ class AiMemeGeneratorClient extends make_api_request_js_1.CoreResourceClient {
|
|
|
39
39
|
*
|
|
40
40
|
* @example
|
|
41
41
|
* ```typescript
|
|
42
|
-
* import Client from "../../../index.js";
|
|
42
|
+
* import { Client } from "../../../index.js";
|
|
43
43
|
*
|
|
44
44
|
* const client = new Client({ token: process.env["API_TOKEN"]!! });
|
|
45
45
|
* const res = await client.v1.aiMemeGenerator.generate(
|
|
@@ -14,7 +14,7 @@ export declare class AiQrCodeGeneratorClient extends CoreResourceClient {
|
|
|
14
14
|
*
|
|
15
15
|
* @example
|
|
16
16
|
* ```typescript
|
|
17
|
-
* import Client from "../../../index.js";
|
|
17
|
+
* import { Client } from "../../../index.js";
|
|
18
18
|
*
|
|
19
19
|
* const client = new Client({ token: process.env["API_TOKEN"]!! });
|
|
20
20
|
* const res = await client.v1.aiQrCodeGenerator.generate(
|
|
@@ -39,7 +39,7 @@ class AiQrCodeGeneratorClient extends make_api_request_js_1.CoreResourceClient {
|
|
|
39
39
|
*
|
|
40
40
|
* @example
|
|
41
41
|
* ```typescript
|
|
42
|
-
* import Client from "../../../index.js";
|
|
42
|
+
* import { Client } from "../../../index.js";
|
|
43
43
|
*
|
|
44
44
|
* const client = new Client({ token: process.env["API_TOKEN"]!! });
|
|
45
45
|
* const res = await client.v1.aiQrCodeGenerator.generate(
|
|
@@ -31,7 +31,7 @@ export declare class AiTalkingPhotoClient extends CoreResourceClient {
|
|
|
31
31
|
*
|
|
32
32
|
* @example
|
|
33
33
|
* ```typescript
|
|
34
|
-
* import Client from "../../../index.js";
|
|
34
|
+
* import { Client } from "../../../index.js";
|
|
35
35
|
*
|
|
36
36
|
* const client = new Client({ token: process.env["API_TOKEN"]!! });
|
|
37
37
|
* const res = await client.v1.aiTalkingPhoto.generate(
|
|
@@ -40,7 +40,7 @@ class AiTalkingPhotoClient extends make_api_request_js_1.CoreResourceClient {
|
|
|
40
40
|
*
|
|
41
41
|
* @example
|
|
42
42
|
* ```typescript
|
|
43
|
-
* import Client from "../../../index.js";
|
|
43
|
+
* import { Client } from "../../../index.js";
|
|
44
44
|
*
|
|
45
45
|
* const client = new Client({ token: process.env["API_TOKEN"]!! });
|
|
46
46
|
* const res = await client.v1.aiTalkingPhoto.generate(
|
|
@@ -23,7 +23,7 @@ export declare class AiVoiceClonerClient extends CoreResourceClient {
|
|
|
23
23
|
*
|
|
24
24
|
* @example
|
|
25
25
|
* ```typescript
|
|
26
|
-
* import Client from "../../../index.js";
|
|
26
|
+
* import { Client } from "../../../index.js";
|
|
27
27
|
*
|
|
28
28
|
* const client = new Client({ token: process.env["API_TOKEN"]!! });
|
|
29
29
|
* const res = await client.v1.aiVoiceCloner.generate(
|
|
@@ -40,7 +40,7 @@ class AiVoiceClonerClient extends make_api_request_js_1.CoreResourceClient {
|
|
|
40
40
|
*
|
|
41
41
|
* @example
|
|
42
42
|
* ```typescript
|
|
43
|
-
* import Client from "../../../index.js";
|
|
43
|
+
* import { Client } from "../../../index.js";
|
|
44
44
|
*
|
|
45
45
|
* const client = new Client({ token: process.env["API_TOKEN"]!! });
|
|
46
46
|
* const res = await client.v1.aiVoiceCloner.generate(
|
|
@@ -14,7 +14,7 @@ export declare class AiVoiceGeneratorClient extends CoreResourceClient {
|
|
|
14
14
|
*
|
|
15
15
|
* @example
|
|
16
16
|
* ```typescript
|
|
17
|
-
* import Client from "../../../index.js";
|
|
17
|
+
* import { Client } from "../../../index.js";
|
|
18
18
|
*
|
|
19
19
|
* const client = new Client({ token: process.env["API_TOKEN"]!! });
|
|
20
20
|
* const res = await client.v1.aiVoiceGenerator.generate(
|
|
@@ -39,7 +39,7 @@ class AiVoiceGeneratorClient extends make_api_request_js_1.CoreResourceClient {
|
|
|
39
39
|
*
|
|
40
40
|
* @example
|
|
41
41
|
* ```typescript
|
|
42
|
-
* import Client from "../../../index.js";
|
|
42
|
+
* import { Client } from "../../../index.js";
|
|
43
43
|
*
|
|
44
44
|
* const client = new Client({ token: process.env["API_TOKEN"]!! });
|
|
45
45
|
* const res = await client.v1.aiVoiceGenerator.generate(
|
|
@@ -31,7 +31,7 @@ export declare class AnimationClient extends CoreResourceClient {
|
|
|
31
31
|
*
|
|
32
32
|
* @example
|
|
33
33
|
* ```typescript
|
|
34
|
-
* import Client from "../../../index.js";
|
|
34
|
+
* import { Client } from "../../../index.js";
|
|
35
35
|
*
|
|
36
36
|
* const client = new Client({ token: process.env["API_TOKEN"]!! });
|
|
37
37
|
* const res = await client.v1.animation.generate(
|
|
@@ -40,7 +40,7 @@ class AnimationClient extends make_api_request_js_1.CoreResourceClient {
|
|
|
40
40
|
*
|
|
41
41
|
* @example
|
|
42
42
|
* ```typescript
|
|
43
|
-
* import Client from "../../../index.js";
|
|
43
|
+
* import { Client } from "../../../index.js";
|
|
44
44
|
*
|
|
45
45
|
* const client = new Client({ token: process.env["API_TOKEN"]!! });
|
|
46
46
|
* const res = await client.v1.animation.generate(
|
|
@@ -23,7 +23,7 @@ export declare class AutoSubtitleGeneratorClient extends CoreResourceClient {
|
|
|
23
23
|
*
|
|
24
24
|
* @example
|
|
25
25
|
* ```typescript
|
|
26
|
-
* import Client from "../../../index.js";
|
|
26
|
+
* import { Client } from "../../../index.js";
|
|
27
27
|
*
|
|
28
28
|
* const client = new Client({ token: process.env["API_TOKEN"]!! });
|
|
29
29
|
* const res = await client.v1.autoSubtitleGenerator.generate(
|
|
@@ -40,7 +40,7 @@ class AutoSubtitleGeneratorClient extends make_api_request_js_1.CoreResourceClie
|
|
|
40
40
|
*
|
|
41
41
|
* @example
|
|
42
42
|
* ```typescript
|
|
43
|
-
* import Client from "../../../index.js";
|
|
43
|
+
* import { Client } from "../../../index.js";
|
|
44
44
|
*
|
|
45
45
|
* const client = new Client({ token: process.env["API_TOKEN"]!! });
|
|
46
46
|
* const res = await client.v1.autoSubtitleGenerator.generate(
|
|
@@ -48,7 +48,7 @@ export declare class FaceSwapClient extends CoreResourceClient {
|
|
|
48
48
|
*
|
|
49
49
|
* @example
|
|
50
50
|
* ```typescript
|
|
51
|
-
* import Client from "../../../index.js";
|
|
51
|
+
* import { Client } from "../../../index.js";
|
|
52
52
|
*
|
|
53
53
|
* const client = new Client({ token: process.env["API_TOKEN"]!! });
|
|
54
54
|
* const res = await client.v1.faceSwap.generate(
|
|
@@ -40,7 +40,7 @@ class FaceSwapClient extends make_api_request_js_1.CoreResourceClient {
|
|
|
40
40
|
*
|
|
41
41
|
* @example
|
|
42
42
|
* ```typescript
|
|
43
|
-
* import Client from "../../../index.js";
|
|
43
|
+
* import { Client } from "../../../index.js";
|
|
44
44
|
*
|
|
45
45
|
* const client = new Client({ token: process.env["API_TOKEN"]!! });
|
|
46
46
|
* const res = await client.v1.faceSwap.generate(
|
|
@@ -48,7 +48,7 @@ export declare class FaceSwapPhotoClient extends CoreResourceClient {
|
|
|
48
48
|
*
|
|
49
49
|
* @example
|
|
50
50
|
* ```typescript
|
|
51
|
-
* import Client from "../../../index.js";
|
|
51
|
+
* import { Client } from "../../../index.js";
|
|
52
52
|
*
|
|
53
53
|
* const client = new Client({ token: process.env["API_TOKEN"]!! });
|
|
54
54
|
* const res = await client.v1.faceSwapPhoto.generate(
|
|
@@ -40,7 +40,7 @@ class FaceSwapPhotoClient extends make_api_request_js_1.CoreResourceClient {
|
|
|
40
40
|
*
|
|
41
41
|
* @example
|
|
42
42
|
* ```typescript
|
|
43
|
-
* import Client from "../../../index.js";
|
|
43
|
+
* import { Client } from "../../../index.js";
|
|
44
44
|
*
|
|
45
45
|
* const client = new Client({ token: process.env["API_TOKEN"]!! });
|
|
46
46
|
* const res = await client.v1.faceSwapPhoto.generate(
|
|
@@ -41,11 +41,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
41
41
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
42
42
|
});
|
|
43
43
|
};
|
|
44
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
45
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
46
|
-
};
|
|
47
44
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
48
|
-
const magic_hour_1 =
|
|
45
|
+
const magic_hour_1 = require("../../../index.js");
|
|
49
46
|
const fs = __importStar(require("fs"));
|
|
50
47
|
const path = __importStar(require("path"));
|
|
51
48
|
const stream_1 = require("stream");
|
|
@@ -91,7 +88,7 @@ afterEach(() => server.resetHandlers());
|
|
|
91
88
|
describe("FilesClient.uploadFile", () => {
|
|
92
89
|
let client;
|
|
93
90
|
beforeEach(() => {
|
|
94
|
-
client = new magic_hour_1.
|
|
91
|
+
client = new magic_hour_1.Client({
|
|
95
92
|
token: "API_TOKEN",
|
|
96
93
|
});
|
|
97
94
|
// Reset all mocks
|
|
@@ -12,7 +12,7 @@ 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
|
|
15
|
+
* - audio: mp3, wav, aac, flac, webm, m4a
|
|
16
16
|
* - image: png, jpg, jpeg, heic, webp, avif, jp2, tiff, bmp
|
|
17
17
|
* - gif: gif, webp, webm
|
|
18
18
|
*
|
|
@@ -17,7 +17,7 @@ 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
|
|
20
|
+
* - audio: mp3, wav, aac, flac, webm, m4a
|
|
21
21
|
* - image: png, jpg, jpeg, heic, webp, avif, jp2, tiff, bmp
|
|
22
22
|
* - gif: gif, webp, webm
|
|
23
23
|
*
|
|
@@ -31,7 +31,7 @@ export declare class ImageBackgroundRemoverClient extends CoreResourceClient {
|
|
|
31
31
|
*
|
|
32
32
|
* @example
|
|
33
33
|
* ```typescript
|
|
34
|
-
* import Client from "../../../index.js";
|
|
34
|
+
* import { Client } from "../../../index.js";
|
|
35
35
|
*
|
|
36
36
|
* const client = new Client({ token: process.env["API_TOKEN"]!! });
|
|
37
37
|
* const res = await client.v1.imageBackgroundRemover.generate(
|
|
@@ -40,7 +40,7 @@ class ImageBackgroundRemoverClient extends make_api_request_js_1.CoreResourceCli
|
|
|
40
40
|
*
|
|
41
41
|
* @example
|
|
42
42
|
* ```typescript
|
|
43
|
-
* import Client from "../../../index.js";
|
|
43
|
+
* import { Client } from "../../../index.js";
|
|
44
44
|
*
|
|
45
45
|
* const client = new Client({ token: process.env["API_TOKEN"]!! });
|
|
46
46
|
* const res = await client.v1.imageBackgroundRemover.generate(
|
|
@@ -13,7 +13,7 @@ export type CreateRequest = {
|
|
|
13
13
|
* The total duration of the output video in seconds.
|
|
14
14
|
*
|
|
15
15
|
* Supported durations depend on the chosen model:
|
|
16
|
-
* * **Default**: 5-60 seconds (
|
|
16
|
+
* * **Default**: 5-60 seconds (2-12 seconds for 480p).
|
|
17
17
|
* * **Seedance**: 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12
|
|
18
18
|
* * **Kling 2.5 Audio**: 5, 10
|
|
19
19
|
* * **Sora 2**: 4, 8, 12, 24, 36, 48, 60
|
|
@@ -23,7 +23,7 @@ export declare class ImageToVideoClient extends CoreResourceClient {
|
|
|
23
23
|
*
|
|
24
24
|
* @example
|
|
25
25
|
* ```typescript
|
|
26
|
-
* import Client from "../../../index.js";
|
|
26
|
+
* import { Client } from "../../../index.js";
|
|
27
27
|
*
|
|
28
28
|
* const client = new Client({ token: process.env["API_TOKEN"]!! });
|
|
29
29
|
* const res = await client.v1.imageToVideo.generate(
|
|
@@ -40,7 +40,7 @@ class ImageToVideoClient extends make_api_request_js_1.CoreResourceClient {
|
|
|
40
40
|
*
|
|
41
41
|
* @example
|
|
42
42
|
* ```typescript
|
|
43
|
-
* import Client from "../../../index.js";
|
|
43
|
+
* import { Client } from "../../../index.js";
|
|
44
44
|
*
|
|
45
45
|
* const client = new Client({ token: process.env["API_TOKEN"]!! });
|
|
46
46
|
* const res = await client.v1.imageToVideo.generate(
|
|
@@ -31,7 +31,7 @@ export declare class LipSyncClient extends CoreResourceClient {
|
|
|
31
31
|
*
|
|
32
32
|
* @example
|
|
33
33
|
* ```typescript
|
|
34
|
-
* import Client from "../../../index.js";
|
|
34
|
+
* import { Client } from "../../../index.js";
|
|
35
35
|
*
|
|
36
36
|
* const client = new Client({ token: process.env["API_TOKEN"]!! });
|
|
37
37
|
* const res = await client.v1.lipSync.generate(
|
|
@@ -40,7 +40,7 @@ class LipSyncClient extends make_api_request_js_1.CoreResourceClient {
|
|
|
40
40
|
*
|
|
41
41
|
* @example
|
|
42
42
|
* ```typescript
|
|
43
|
-
* import Client from "../../../index.js";
|
|
43
|
+
* import { Client } from "../../../index.js";
|
|
44
44
|
*
|
|
45
45
|
* const client = new Client({ token: process.env["API_TOKEN"]!! });
|
|
46
46
|
* const res = await client.v1.lipSync.generate(
|
|
@@ -23,7 +23,7 @@ export declare class PhotoColorizerClient extends CoreResourceClient {
|
|
|
23
23
|
*
|
|
24
24
|
* @example
|
|
25
25
|
* ```typescript
|
|
26
|
-
* import Client from "../../../index.js";
|
|
26
|
+
* import { Client } from "../../../index.js";
|
|
27
27
|
*
|
|
28
28
|
* const client = new Client({ token: process.env["API_TOKEN"]!! });
|
|
29
29
|
* const res = await client.v1.photoColorizer.generate(
|
|
@@ -40,7 +40,7 @@ class PhotoColorizerClient extends make_api_request_js_1.CoreResourceClient {
|
|
|
40
40
|
*
|
|
41
41
|
* @example
|
|
42
42
|
* ```typescript
|
|
43
|
-
* import Client from "../../../index.js";
|
|
43
|
+
* import { Client } from "../../../index.js";
|
|
44
44
|
*
|
|
45
45
|
* const client = new Client({ token: process.env["API_TOKEN"]!! });
|
|
46
46
|
* const res = await client.v1.photoColorizer.generate(
|
|
@@ -18,7 +18,7 @@ export type CreateRequest = {
|
|
|
18
18
|
* The total duration of the output video in seconds.
|
|
19
19
|
*
|
|
20
20
|
* Supported durations depend on the chosen model:
|
|
21
|
-
* * **Default**: 5-60 seconds (
|
|
21
|
+
* * **Default**: 5-60 seconds (2-12 seconds for 480p).
|
|
22
22
|
* * **Seedance**: 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12
|
|
23
23
|
* * **Kling 2.5 Audio**: 5, 10
|
|
24
24
|
* * **Sora 2**: 4, 8, 12, 24, 36, 48, 60
|
|
@@ -14,7 +14,7 @@ export declare class TextToVideoClient extends CoreResourceClient {
|
|
|
14
14
|
*
|
|
15
15
|
* @example
|
|
16
16
|
* ```typescript
|
|
17
|
-
* import Client from "../../../index.js";
|
|
17
|
+
* import { Client } from "../../../index.js";
|
|
18
18
|
*
|
|
19
19
|
* const client = new Client({ token: process.env["API_TOKEN"]!! });
|
|
20
20
|
* const res = await client.v1.textToVideo.generate(
|
|
@@ -39,7 +39,7 @@ class TextToVideoClient extends make_api_request_js_1.CoreResourceClient {
|
|
|
39
39
|
*
|
|
40
40
|
* @example
|
|
41
41
|
* ```typescript
|
|
42
|
-
* import Client from "../../../index.js";
|
|
42
|
+
* import { Client } from "../../../index.js";
|
|
43
43
|
*
|
|
44
44
|
* const client = new Client({ token: process.env["API_TOKEN"]!! });
|
|
45
45
|
* const res = await client.v1.textToVideo.generate(
|
|
@@ -23,7 +23,7 @@ export declare class VideoToVideoClient extends CoreResourceClient {
|
|
|
23
23
|
*
|
|
24
24
|
* @example
|
|
25
25
|
* ```typescript
|
|
26
|
-
* import Client from "../../../index.js";
|
|
26
|
+
* import { Client } from "../../../index.js";
|
|
27
27
|
*
|
|
28
28
|
* const client = new Client({ token: process.env["API_TOKEN"]!! });
|
|
29
29
|
* const res = await client.v1.videoToVideo.generate(
|
|
@@ -40,7 +40,7 @@ class VideoToVideoClient extends make_api_request_js_1.CoreResourceClient {
|
|
|
40
40
|
*
|
|
41
41
|
* @example
|
|
42
42
|
* ```typescript
|
|
43
|
-
* import Client from "../../../index.js";
|
|
43
|
+
* import { Client } from "../../../index.js";
|
|
44
44
|
*
|
|
45
45
|
* const client = new Client({ token: process.env["API_TOKEN"]!! });
|
|
46
46
|
* const res = await client.v1.videoToVideo.generate(
|
package/dist/types/index.d.ts
CHANGED
|
@@ -15,7 +15,9 @@ export { V1AiHeadshotGeneratorCreateBodyAssets } from "./v1-ai-headshot-generato
|
|
|
15
15
|
export { V1AiHeadshotGeneratorCreateBodyStyle } from "./v1-ai-headshot-generator-create-body-style";
|
|
16
16
|
export { V1AiHeadshotGeneratorCreateResponse } from "./v1-ai-headshot-generator-create-response";
|
|
17
17
|
export { V1AiImageEditorCreateBody } from "./v1-ai-image-editor-create-body";
|
|
18
|
+
export { V1AiImageEditorCreateBodyAspectRatioEnum } from "./v1-ai-image-editor-create-body-aspect-ratio-enum";
|
|
18
19
|
export { V1AiImageEditorCreateBodyAssets } from "./v1-ai-image-editor-create-body-assets";
|
|
20
|
+
export { V1AiImageEditorCreateBodyModelEnum } from "./v1-ai-image-editor-create-body-model-enum";
|
|
19
21
|
export { V1AiImageEditorCreateBodyStyle } from "./v1-ai-image-editor-create-body-style";
|
|
20
22
|
export { V1AiImageEditorCreateBodyStyleModelEnum } from "./v1-ai-image-editor-create-body-style-model-enum";
|
|
21
23
|
export { V1AiImageEditorCreateResponse } from "./v1-ai-image-editor-create-response";
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The AI model to use for image editing. Each model has different capabilities and costs.
|
|
3
|
+
*
|
|
4
|
+
* **Models:**
|
|
5
|
+
* - `default` - Use the model we recommend, which will change over time. This is recommended unless you need a specific model. This is the default behavior.
|
|
6
|
+
* - `qwen-edit` - 10 credits/image
|
|
7
|
+
* - Available for tiers: free, creator, pro, business
|
|
8
|
+
* - Image count allowed: 1
|
|
9
|
+
* - Max additional input images: 2
|
|
10
|
+
* - `nano-banana` - 50 credits/image
|
|
11
|
+
* - Available for tiers: free, creator, pro, business
|
|
12
|
+
* - Image count allowed: 1
|
|
13
|
+
* - Max additional input images: 9
|
|
14
|
+
* - `seedream-v4` - 50 credits/image
|
|
15
|
+
* - Available for tiers: free, creator, pro, business
|
|
16
|
+
* - Image count allowed: 1
|
|
17
|
+
* - Max additional input images: 9
|
|
18
|
+
* - `nano-banana-pro` - 150 credits/image
|
|
19
|
+
* - Available for tiers: creator, pro, business
|
|
20
|
+
* - Image count allowed: 1, 4, 9, 16
|
|
21
|
+
* - Max additional input images: 9
|
|
22
|
+
* - `seedream-v4.5` - 100 credits/image
|
|
23
|
+
* - Available for tiers: creator, pro, business
|
|
24
|
+
* - Image count allowed: 1
|
|
25
|
+
* - Max additional input images: 9
|
|
26
|
+
*
|
|
27
|
+
*/
|
|
28
|
+
export type V1AiImageEditorCreateBodyModelEnum = "default" | "nano-banana" | "nano-banana-pro" | "qwen-edit" | "seedream-v4" | "seedream-v4.5";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* The AI model to use for image editing.
|
|
2
|
+
* Deprecated: Please use `model` instead. The AI model to use for image editing.
|
|
3
3
|
* * `Nano Banana` - Precise, realistic edits with consistent results
|
|
4
4
|
* * `Seedream` - Creative, imaginative images with artistic freedom
|
|
5
5
|
* * `default` - Use the model we recommend, which will change over time. This is recommended unless you need a specific model. This is the default behavior.
|
|
@@ -4,7 +4,7 @@ import * as z from "zod";
|
|
|
4
4
|
*/
|
|
5
5
|
export type V1AiImageEditorCreateBodyStyle = {
|
|
6
6
|
/**
|
|
7
|
-
* The AI model to use for image editing.
|
|
7
|
+
* Deprecated: Please use `model` instead. The AI model to use for image editing.
|
|
8
8
|
* * `Nano Banana` - Precise, realistic edits with consistent results
|
|
9
9
|
* * `Seedream` - Creative, imaginative images with artistic freedom
|
|
10
10
|
* * `default` - Use the model we recommend, which will change over time. This is recommended unless you need a specific model. This is the default behavior.
|
|
@@ -5,10 +5,46 @@ import { External$V1AiImageEditorCreateBodyStyle, V1AiImageEditorCreateBodyStyle
|
|
|
5
5
|
* V1AiImageEditorCreateBody
|
|
6
6
|
*/
|
|
7
7
|
export type V1AiImageEditorCreateBody = {
|
|
8
|
+
/**
|
|
9
|
+
* The aspect ratio of the output image(s). If not specified, defaults to `auto`.
|
|
10
|
+
*/
|
|
11
|
+
aspectRatio?: ("16:9" | "1:1" | "2:3" | "3:2" | "4:3" | "4:5" | "9:16" | "auto") | undefined;
|
|
8
12
|
/**
|
|
9
13
|
* Provide the assets for image edit
|
|
10
14
|
*/
|
|
11
15
|
assets: V1AiImageEditorCreateBodyAssets;
|
|
16
|
+
/**
|
|
17
|
+
* Number of images to generate. Maximum varies by model. Defaults to 1 if not specified.
|
|
18
|
+
*/
|
|
19
|
+
imageCount?: number | undefined;
|
|
20
|
+
/**
|
|
21
|
+
* The AI model to use for image editing. Each model has different capabilities and costs.
|
|
22
|
+
*
|
|
23
|
+
* **Models:**
|
|
24
|
+
* - `default` - Use the model we recommend, which will change over time. This is recommended unless you need a specific model. This is the default behavior.
|
|
25
|
+
* - `qwen-edit` - 10 credits/image
|
|
26
|
+
* - Available for tiers: free, creator, pro, business
|
|
27
|
+
* - Image count allowed: 1
|
|
28
|
+
* - Max additional input images: 2
|
|
29
|
+
* - `nano-banana` - 50 credits/image
|
|
30
|
+
* - Available for tiers: free, creator, pro, business
|
|
31
|
+
* - Image count allowed: 1
|
|
32
|
+
* - Max additional input images: 9
|
|
33
|
+
* - `seedream-v4` - 50 credits/image
|
|
34
|
+
* - Available for tiers: free, creator, pro, business
|
|
35
|
+
* - Image count allowed: 1
|
|
36
|
+
* - Max additional input images: 9
|
|
37
|
+
* - `nano-banana-pro` - 150 credits/image
|
|
38
|
+
* - Available for tiers: creator, pro, business
|
|
39
|
+
* - Image count allowed: 1, 4, 9, 16
|
|
40
|
+
* - Max additional input images: 9
|
|
41
|
+
* - `seedream-v4.5` - 100 credits/image
|
|
42
|
+
* - Available for tiers: creator, pro, business
|
|
43
|
+
* - Image count allowed: 1
|
|
44
|
+
* - Max additional input images: 9
|
|
45
|
+
*
|
|
46
|
+
*/
|
|
47
|
+
model?: ("default" | "nano-banana" | "nano-banana-pro" | "qwen-edit" | "seedream-v4" | "seedream-v4.5") | undefined;
|
|
12
48
|
/**
|
|
13
49
|
* Give your image a custom name for easy identification.
|
|
14
50
|
*/
|
|
@@ -21,7 +57,10 @@ export type V1AiImageEditorCreateBody = {
|
|
|
21
57
|
* we expect to come in as network data
|
|
22
58
|
*/
|
|
23
59
|
export type External$V1AiImageEditorCreateBody = {
|
|
60
|
+
aspect_ratio?: ("16:9" | "1:1" | "2:3" | "3:2" | "4:3" | "4:5" | "9:16" | "auto") | undefined;
|
|
24
61
|
assets: External$V1AiImageEditorCreateBodyAssets;
|
|
62
|
+
image_count?: number | undefined;
|
|
63
|
+
model?: ("default" | "nano-banana" | "nano-banana-pro" | "qwen-edit" | "seedream-v4" | "seedream-v4.5") | undefined;
|
|
25
64
|
name?: string | undefined;
|
|
26
65
|
style: External$V1AiImageEditorCreateBodyStyle;
|
|
27
66
|
};
|
|
@@ -43,13 +43,30 @@ const v1_ai_image_editor_create_body_style_1 = require("./v1-ai-image-editor-cre
|
|
|
43
43
|
*/
|
|
44
44
|
const SchemaIn$V1AiImageEditorCreateBody = z
|
|
45
45
|
.object({
|
|
46
|
+
aspect_ratio: z
|
|
47
|
+
.enum(["16:9", "1:1", "2:3", "3:2", "4:3", "4:5", "9:16", "auto"])
|
|
48
|
+
.optional(),
|
|
46
49
|
assets: v1_ai_image_editor_create_body_assets_1.Schemas$V1AiImageEditorCreateBodyAssets.in,
|
|
50
|
+
image_count: z.number().optional(),
|
|
51
|
+
model: z
|
|
52
|
+
.enum([
|
|
53
|
+
"default",
|
|
54
|
+
"nano-banana",
|
|
55
|
+
"nano-banana-pro",
|
|
56
|
+
"qwen-edit",
|
|
57
|
+
"seedream-v4",
|
|
58
|
+
"seedream-v4.5",
|
|
59
|
+
])
|
|
60
|
+
.optional(),
|
|
47
61
|
name: z.string().optional(),
|
|
48
62
|
style: v1_ai_image_editor_create_body_style_1.Schemas$V1AiImageEditorCreateBodyStyle.in,
|
|
49
63
|
})
|
|
50
64
|
.transform((obj) => {
|
|
51
65
|
return (0, make_api_request_js_1.zodTransform)(obj, {
|
|
66
|
+
aspect_ratio: "aspectRatio",
|
|
52
67
|
assets: "assets",
|
|
68
|
+
image_count: "imageCount",
|
|
69
|
+
model: "model",
|
|
53
70
|
name: "name",
|
|
54
71
|
style: "style",
|
|
55
72
|
});
|
|
@@ -60,13 +77,30 @@ const SchemaIn$V1AiImageEditorCreateBody = z
|
|
|
60
77
|
*/
|
|
61
78
|
const SchemaOut$V1AiImageEditorCreateBody = z
|
|
62
79
|
.object({
|
|
80
|
+
aspectRatio: z
|
|
81
|
+
.enum(["16:9", "1:1", "2:3", "3:2", "4:3", "4:5", "9:16", "auto"])
|
|
82
|
+
.optional(),
|
|
63
83
|
assets: v1_ai_image_editor_create_body_assets_1.Schemas$V1AiImageEditorCreateBodyAssets.out,
|
|
84
|
+
imageCount: z.number().optional(),
|
|
85
|
+
model: z
|
|
86
|
+
.enum([
|
|
87
|
+
"default",
|
|
88
|
+
"nano-banana",
|
|
89
|
+
"nano-banana-pro",
|
|
90
|
+
"qwen-edit",
|
|
91
|
+
"seedream-v4",
|
|
92
|
+
"seedream-v4.5",
|
|
93
|
+
])
|
|
94
|
+
.optional(),
|
|
64
95
|
name: z.string().optional(),
|
|
65
96
|
style: v1_ai_image_editor_create_body_style_1.Schemas$V1AiImageEditorCreateBodyStyle.out,
|
|
66
97
|
})
|
|
67
98
|
.transform((obj) => {
|
|
68
99
|
return (0, make_api_request_js_1.zodTransform)(obj, {
|
|
100
|
+
aspectRatio: "aspect_ratio",
|
|
69
101
|
assets: "assets",
|
|
102
|
+
imageCount: "image_count",
|
|
103
|
+
model: "model",
|
|
70
104
|
name: "name",
|
|
71
105
|
style: "style",
|
|
72
106
|
});
|
|
@@ -4,7 +4,7 @@ import * as z from "zod";
|
|
|
4
4
|
*/
|
|
5
5
|
export type V1FilesUploadUrlsCreateBodyItemsItem = {
|
|
6
6
|
/**
|
|
7
|
-
* The extension of the file to upload. Do not include the dot (.) before the extension. Possible extensions are mp4,m4v,mov,webm,mp3,wav,aac,flac,webm,png,jpg,jpeg,heic,webp,avif,jp2,tiff,bmp,gif,webp,webm
|
|
7
|
+
* The extension of the file to upload. Do not include the dot (.) before the extension. Possible extensions are mp4,m4v,mov,webm,mp3,wav,aac,flac,webm,m4a,png,jpg,jpeg,heic,webp,avif,jp2,tiff,bmp,gif,webp,webm
|
|
8
8
|
*/
|
|
9
9
|
extension: string;
|
|
10
10
|
/**
|
|
@@ -42,7 +42,7 @@ export type V1ImageProjectsGetResponse = {
|
|
|
42
42
|
*/
|
|
43
43
|
totalFrameCost: number;
|
|
44
44
|
/**
|
|
45
|
-
* The type of the image project. Possible values are AI_HEADSHOT, AI_IMAGE, IMAGE_UPSCALER, FACE_SWAP, PHOTO_EDITOR, QR_CODE, BACKGROUND_REMOVER, CLOTHES_CHANGER, AI_MEME, FACE_EDITOR, PHOTO_COLORIZER, AI_GIF, AI_SELFIE, AI_IMAGE_EDITOR, HEAD_SWAP
|
|
45
|
+
* The type of the image project. Possible values are AI_HEADSHOT, AI_IMAGE, IMAGE_UPSCALER, FACE_SWAP, PHOTO_EDITOR, QR_CODE, BACKGROUND_REMOVER, CLOTHES_CHANGER, AI_MEME, FACE_EDITOR, PHOTO_COLORIZER, AI_GIF, AI_SELFIE, AI_IMAGE_EDITOR, HEAD_SWAP, STORYBOARD
|
|
46
46
|
*/
|
|
47
47
|
type: string;
|
|
48
48
|
};
|
|
@@ -13,7 +13,7 @@ export type V1ImageToVideoCreateBody = {
|
|
|
13
13
|
* The total duration of the output video in seconds.
|
|
14
14
|
*
|
|
15
15
|
* Supported durations depend on the chosen model:
|
|
16
|
-
* * **Default**: 5-60 seconds (
|
|
16
|
+
* * **Default**: 5-60 seconds (2-12 seconds for 480p).
|
|
17
17
|
* * **Seedance**: 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12
|
|
18
18
|
* * **Kling 2.5 Audio**: 5, 10
|
|
19
19
|
* * **Sora 2**: 4, 8, 12, 24, 36, 48, 60
|
|
@@ -18,7 +18,7 @@ export type V1TextToVideoCreateBody = {
|
|
|
18
18
|
* The total duration of the output video in seconds.
|
|
19
19
|
*
|
|
20
20
|
* Supported durations depend on the chosen model:
|
|
21
|
-
* * **Default**: 5-60 seconds (
|
|
21
|
+
* * **Default**: 5-60 seconds (2-12 seconds for 480p).
|
|
22
22
|
* * **Seedance**: 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12
|
|
23
23
|
* * **Kling 2.5 Audio**: 5, 10
|
|
24
24
|
* * **Sora 2**: 4, 8, 12, 24, 36, 48, 60
|