vidspotai-shared 1.0.29 → 1.0.30

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.
@@ -1,4 +1,10 @@
1
1
  export declare enum EVideoGenModels {
2
+ PIXVERSE_V5_6 = "pixverse-v5.6",
3
+ PIXVERSE_V5_5 = "pixverse-v5.5",
4
+ PIXVERSE_V5 = "pixverse-v5",
5
+ BYTEDANCE_SEEDANCE_1_5_PRO = "bytedance-seedance-1.5-pro",
6
+ BYTEDANCE_SEEDANCE_1_0_PRO_FAST = "bytedance-seedance-1.0-pro-fast",
7
+ BYTEDANCE_SEEDANCE_1_0_PRO = "bytedance-seedance-1.0-pro",
2
8
  GOOGLE_VEO_3_1_PREVIEW = "google-veo-3.1-preview",
3
9
  GOOGLE_VEO_3_1__FAST_PREVIEW = "google-veo-3.1-fast-preview",
4
10
  GOOGLE_VEO_3 = "google-veo-3",
@@ -6,16 +12,14 @@ export declare enum EVideoGenModels {
6
12
  GOOGLE_VEO_2 = "google-veo-2",
7
13
  RUNWAY_GEN4_TURBO = "runway-gen4-turbo",
8
14
  RUNWAY_GEN4_ALEPH = "runway-gen4-aleph",
9
- KLING_V1 = "kling-v1",
10
- KLING_V1_6 = "kling-v1.6",
11
15
  KLING_V2_MASTER = "kling-v2-master",
16
+ KLING_V2_1 = "kling-v2.1",
12
17
  KLING_V2_1_MASTER = "kling-v2.1-master",
18
+ KLING_V2_5_TURBO = "kling-v2.5-turbo",
19
+ KLING_V2_6 = "kling-v2.6",
20
+ MINIMAX_HAILUO_2_3_FAST = "minimax-hailuo-2.3-fast",
21
+ MINIMAX_HAILUO_2_3 = "minimax-hailuo-2.3",
13
22
  MINIMAX_HAILUO_02 = "minimax-hailuo-02",
14
- T2V_01_DIRECTOR = "T2V-01-Director",
15
- T2V_01 = "T2V-01",
16
- AZURE_SORA = "azure-sora",
17
- ALIBABA_WAN_2_5 = "alibaba-wan-2.5",
18
- ALIBABA_WAN_2_2 = "alibaba-wan-2.2",
19
23
  OPENAI_SORA_2 = "openai-sora-2",
20
24
  OPENAI_SORA_2_PRO = "openai-sora-2-pro"
21
25
  }
@@ -34,8 +38,8 @@ export type TAiGenModel = EVideoGenModels | ETextGenModels;
34
38
  type GenerationType = "text-to-video" | "image-to-video" | "video-to-video" | "text-to-text" | "image-to-text";
35
39
  interface ISchemaField {
36
40
  required?: boolean;
37
- allowedValues?: string[] | number[];
38
- default?: string | number;
41
+ allowedValues?: string[] | number[] | boolean[];
42
+ default?: string | number | boolean;
39
43
  }
40
44
  interface ICostTable {
41
45
  [key: string]: {
@@ -56,6 +60,7 @@ interface IModelSchema {
56
60
  per1KTokens?: number;
57
61
  table?: ICostTable;
58
62
  fixed?: number;
63
+ [key: string]: any;
59
64
  };
60
65
  }
61
66
  export declare const aiModelConfigs: Record<TAiGenModel, IModelSchema>;
@@ -1 +1 @@
1
- {"version":3,"file":"aiModels.d.ts","sourceRoot":"","sources":["../../src/globals/aiModels.ts"],"names":[],"mappings":"AAwBA,oBAAY,eAAe;IACzB,sBAAsB,2BAA2B;IACjD,4BAA4B,gCAAgC;IAC5D,YAAY,iBAAiB;IAC7B,iBAAiB,sBAAsB;IACvC,YAAY,iBAAiB;IAC7B,iBAAiB,sBAAsB;IACvC,iBAAiB,sBAAsB;IACvC,QAAQ,aAAa;IACrB,UAAU,eAAe;IACzB,eAAe,oBAAoB;IACnC,iBAAiB,sBAAsB;IACvC,iBAAiB,sBAAsB;IACvC,eAAe,oBAAoB;IACnC,MAAM,WAAW;IACjB,UAAU,eAAe;IACzB,eAAe,oBAAoB;IACnC,eAAe,oBAAoB;IACnC,aAAa,kBAAkB;IAC/B,iBAAiB,sBAAsB;CACxC;AAaD,eAAO,MAAM,eAAe;;;;;;CAMlB,CAAC;AAaX,oBAAY,cAAc;IAExB,kBAAkB,uBAAuB;IACzC,iBAAiB,sBAAsB;CAIxC;AAID,MAAM,MAAM,WAAW,GAAG,eAAe,GAAG,cAAc,CAAC;AAG3D,KA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,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC;IACzC,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,IAAI,CAAC,EAAE;QACL,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,WAAW,CAAC,EAAE,MAAM,CAAC;QACrB,KAAK,CAAC,EAAE,UAAU,CAAC;QACnB,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;KACpB,CAAC;CACH;AAGD,eAAO,MAAM,cAAc,EAAE,MAAM,CAAC,WAAW,EAAE,YAAY,CA+xB5D,CAAC"}
@@ -2,23 +2,19 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.aiModelConfigs = exports.ETextGenModels = exports.EImageGenModels = exports.EVideoGenModels = void 0;
4
4
  const types_1 = require("../services/aiGen/providers/runway/types");
5
- // export const EVideoGenModels = {
6
- // GOOGLE_VEO_3: "google-veo-3",
7
- // GOOGLE_VEO_3_FAST: "google-veo-3-fast",
8
- // GOOGLE_VEO_2: "google-veo-2",
9
- // RUNWAY_GEN4_TURBO: "runway-gen4-turbo",
10
- // RUNWAY_GEN4_ALEPH: "runway-gen4-aleph",
11
- // KLING_V1: "kling-v1",
12
- // KLING_V1_6: "kling-v1.6",
13
- // KLING_V2_MASTER: "kling-v2-master",
14
- // KLING_V2_1_MASTER: "kling-v2.1-master",
15
- // MINIMAX_HAILUO_02: "minimax-hailuo-02",
16
- // T2V_01_DIRECTOR: "T2V-01-Director",
17
- // T2V_01: "T2V-01",
18
- // OPENAI_SORA: "openai-sora",
19
- // } as const;
20
5
  var EVideoGenModels;
21
6
  (function (EVideoGenModels) {
7
+ EVideoGenModels["PIXVERSE_V5_6"] = "pixverse-v5.6";
8
+ EVideoGenModels["PIXVERSE_V5_5"] = "pixverse-v5.5";
9
+ EVideoGenModels["PIXVERSE_V5"] = "pixverse-v5";
10
+ // PIXVERSE_V4_5 = "pixverse-v4.5",
11
+ // PIXVERSE_V4 = "pixverse-v4",
12
+ // PIXVERSE_V3_5 = "pixverse-v3.5",
13
+ EVideoGenModels["BYTEDANCE_SEEDANCE_1_5_PRO"] = "bytedance-seedance-1.5-pro";
14
+ EVideoGenModels["BYTEDANCE_SEEDANCE_1_0_PRO_FAST"] = "bytedance-seedance-1.0-pro-fast";
15
+ EVideoGenModels["BYTEDANCE_SEEDANCE_1_0_PRO"] = "bytedance-seedance-1.0-pro";
16
+ // BYTEDANCE_SEEDANCE_1_0_LITE_T2V = "bytedance-seedance-1.0-lite-t2v",
17
+ // BYTEDANCE_SEEDANCE_1_0_LITE_I2V = "bytedance-seedance-1.0-lite-i2v",
22
18
  EVideoGenModels["GOOGLE_VEO_3_1_PREVIEW"] = "google-veo-3.1-preview";
23
19
  EVideoGenModels["GOOGLE_VEO_3_1__FAST_PREVIEW"] = "google-veo-3.1-fast-preview";
24
20
  EVideoGenModels["GOOGLE_VEO_3"] = "google-veo-3";
@@ -26,28 +22,25 @@ var EVideoGenModels;
26
22
  EVideoGenModels["GOOGLE_VEO_2"] = "google-veo-2";
27
23
  EVideoGenModels["RUNWAY_GEN4_TURBO"] = "runway-gen4-turbo";
28
24
  EVideoGenModels["RUNWAY_GEN4_ALEPH"] = "runway-gen4-aleph";
29
- EVideoGenModels["KLING_V1"] = "kling-v1";
30
- EVideoGenModels["KLING_V1_6"] = "kling-v1.6";
25
+ // KLING_V1 = "kling-v1",
26
+ // KLING_V1_6 = "kling-v1.6",
31
27
  EVideoGenModels["KLING_V2_MASTER"] = "kling-v2-master";
28
+ EVideoGenModels["KLING_V2_1"] = "kling-v2.1";
32
29
  EVideoGenModels["KLING_V2_1_MASTER"] = "kling-v2.1-master";
30
+ EVideoGenModels["KLING_V2_5_TURBO"] = "kling-v2.5-turbo";
31
+ EVideoGenModels["KLING_V2_6"] = "kling-v2.6";
32
+ // KLING_VIDEO_O1 = "kling-video-o1",
33
+ EVideoGenModels["MINIMAX_HAILUO_2_3_FAST"] = "minimax-hailuo-2.3-fast";
34
+ EVideoGenModels["MINIMAX_HAILUO_2_3"] = "minimax-hailuo-2.3";
33
35
  EVideoGenModels["MINIMAX_HAILUO_02"] = "minimax-hailuo-02";
34
- EVideoGenModels["T2V_01_DIRECTOR"] = "T2V-01-Director";
35
- EVideoGenModels["T2V_01"] = "T2V-01";
36
- EVideoGenModels["AZURE_SORA"] = "azure-sora";
37
- EVideoGenModels["ALIBABA_WAN_2_5"] = "alibaba-wan-2.5";
38
- EVideoGenModels["ALIBABA_WAN_2_2"] = "alibaba-wan-2.2";
36
+ // T2V_01_DIRECTOR = "T2V-01-Director",
37
+ // T2V_01 = "T2V-01",
38
+ // AZURE_SORA = "azure-sora",
39
+ // ALIBABA_WAN_2_5 = "alibaba-wan-2.5",
40
+ // ALIBABA_WAN_2_2 = "alibaba-wan-2.2",
39
41
  EVideoGenModels["OPENAI_SORA_2"] = "openai-sora-2";
40
42
  EVideoGenModels["OPENAI_SORA_2_PRO"] = "openai-sora-2-pro";
41
43
  })(EVideoGenModels || (exports.EVideoGenModels = EVideoGenModels = {}));
42
- // export type TVideoGenModel =
43
- // (typeof EVideoGenModels)[keyof typeof EVideoGenModels];
44
- // export const EImageGenModels = {
45
- // OPENAI_DALLE_3: "openai-dalle-3",
46
- // STABILITY_STABLE_DIFFUSION: "stability-stable-diffusion",
47
- // MIDJOURNEY_V6: "midjourney-v6",
48
- // FLUX_1_1: "flux-1.1",
49
- // IDEOGRAM_1_0: "ideogram-1.0",
50
- // } as const;
51
44
  exports.EImageGenModels = {
52
45
  OPENAI_DALLE_3: "openai-dalle-3",
53
46
  STABILITY_STABLE_DIFFUSION: "stability-stable-diffusion",
@@ -55,15 +48,6 @@ exports.EImageGenModels = {
55
48
  FLUX_1_1: "flux-1.1",
56
49
  IDEOGRAM_1_0: "ideogram-1.0",
57
50
  };
58
- // export type ImageGenModel =
59
- // (typeof EImageGenModels)[keyof typeof EImageGenModels];
60
- // export const ETextGenModels = {
61
- // // OPENAI_GPT_4O: "openai-gpt-4o",
62
- // OPENAI_GPT_4O_MINI: "openai-gpt-4o-mini",
63
- // // OPENAI_GPT_3_5_TURBO: "openai-gpt-3.5-turbo",
64
- // // ANTHROPIC_CLAUDE_3: "anthropic-claude-3",
65
- // // ANTHROPIC_CLAUDE_INSTANT_100K: "anthropic-claude-instant-100k",
66
- // } as const;
67
51
  var ETextGenModels;
68
52
  (function (ETextGenModels) {
69
53
  // OPENAI_GPT_4O = "openai-gpt-4o",
@@ -75,6 +59,225 @@ var ETextGenModels;
75
59
  })(ETextGenModels || (exports.ETextGenModels = ETextGenModels = {}));
76
60
  // Combined config
77
61
  exports.aiModelConfigs = {
62
+ // --- Pixverse models ---
63
+ "pixverse-v5.6": {
64
+ modelId: "v5.6",
65
+ type: ["text-to-video", "image-to-video"],
66
+ fields: {
67
+ prompt: { required: true },
68
+ aspectRatio: { allowedValues: ["16:9", "9:16", "1:1"] },
69
+ resolution: { allowedValues: ["360p", "540p", "720p", "1080p"] },
70
+ duration: { allowedValues: [5, 8, 10] },
71
+ audio: {},
72
+ },
73
+ durationRules: {
74
+ 5: ["360p", "540p", "720p", "1080p"],
75
+ 8: ["360p", "540p", "720p", "1080p"],
76
+ 10: ["360p", "540p", "720p"], // 1080p not available for 10s
77
+ },
78
+ concurrentRequests: 5,
79
+ cost: {
80
+ noAudio: {
81
+ table: {
82
+ "360p": { 5: 0.35, 8: 0.7, 10: 0.77 },
83
+ "540p": { 5: 0.35, 8: 0.7, 10: 0.77 },
84
+ "720p": { 5: 0.45, 8: 0.9, 10: 0.99 },
85
+ "1080p": { 5: 0.75, 8: 1.5 },
86
+ },
87
+ },
88
+ audio: {
89
+ table: {
90
+ "360p": { 5: 0.8, 8: 1.15, 10: 1.22 },
91
+ "540p": { 5: 0.8, 8: 1.15, 10: 1.22 },
92
+ "720p": { 5: 0.8, 8: 1.35, 10: 1.44 },
93
+ "1080p": { 5: 1.5, 8: 1.95 },
94
+ },
95
+ },
96
+ },
97
+ },
98
+ "pixverse-v5.5": {
99
+ modelId: "v5.5",
100
+ type: ["text-to-video", "image-to-video", "video-to-video"],
101
+ fields: {
102
+ prompt: { required: true },
103
+ multiClip: { default: false },
104
+ resolution: { allowedValues: ["360p", "540p", "720p", "1080p"] },
105
+ duration: { allowedValues: [5, 8, 10] },
106
+ audio: {},
107
+ },
108
+ cost: {
109
+ noAudio: {
110
+ singleClip: {
111
+ table: {
112
+ "360p": { 5: 0.45, 8: 0.9, 10: 0.99 },
113
+ "540p": { 5: 0.45, 8: 0.9, 10: 0.99 },
114
+ "720p": { 5: 0.6, 8: 1.2, 10: 1.32 },
115
+ "1080p": { 5: 1.2, 8: 2.4 },
116
+ },
117
+ },
118
+ multiClip: {
119
+ table: {
120
+ "360p": { 5: 0.75, 8: 1.2, 10: 1.29 },
121
+ "540p": { 5: 0.75, 8: 1.2, 10: 1.29 },
122
+ "720p": { 5: 0.9, 8: 1.5, 10: 1.62 },
123
+ "1080p": { 5: 1.5, 8: 2.7 },
124
+ },
125
+ },
126
+ },
127
+ audio: {
128
+ singleClip: {
129
+ table: {
130
+ "360p": { 5: 0.55, 8: 1.0, 10: 1.09 },
131
+ "540p": { 5: 0.55, 8: 1.0, 10: 1.09 },
132
+ "720p": { 5: 0.7, 8: 1.3, 10: 1.42 },
133
+ "1080p": { 5: 1.3, 8: 2.5 },
134
+ },
135
+ },
136
+ multiClip: {
137
+ table: {
138
+ "360p": { 5: 0.85, 8: 1.3, 10: 1.39 },
139
+ "540p": { 5: 0.85, 8: 1.3, 10: 1.39 },
140
+ "720p": { 5: 1.0, 8: 1.6, 10: 1.72 },
141
+ "1080p": { 5: 1.6, 8: 2.8 },
142
+ },
143
+ },
144
+ },
145
+ },
146
+ },
147
+ "pixverse-v5": {
148
+ modelId: "v5",
149
+ type: ["text-to-video", "image-to-video"],
150
+ fields: {
151
+ prompt: { required: true },
152
+ resolution: { allowedValues: ["360p", "540p", "720p", "1080p"] },
153
+ duration: { allowedValues: [5, 8] },
154
+ },
155
+ cost: {
156
+ noAudio: {
157
+ table: {
158
+ "360p": { 5: 0.45, 8: 0.9 },
159
+ "540p": { 5: 0.45, 8: 0.9 },
160
+ "720p": { 5: 0.6, 8: 1.2 },
161
+ "1080p": { 5: 1.2, 8: 2.4 },
162
+ },
163
+ },
164
+ },
165
+ },
166
+ // "pixverse-v4.5": {
167
+ // modelId: "pixverse-v4.5",
168
+ // type: ["text-to-video", "image-to-video"],
169
+ // fields: {
170
+ // prompt: { required: true },
171
+ // motionMode: { allowedValues: ["normal", "fast"], default: "normal" },
172
+ // resolution: { allowedValues: ["360p", "540p", "720p", "1080p"] },
173
+ // duration: { allowedValues: [5, 8] },
174
+ // },
175
+ // cost: {
176
+ // table: {
177
+ // "360p": { 5: 0.45, 8: 0.9 },
178
+ // "540p": { 5: 0.45, 8: 0.9 },
179
+ // "720p": { 5: 0.6, 8: 1.2 },
180
+ // "1080p": { 5: 1.2 },
181
+ // },
182
+ // },
183
+ // },
184
+ // --- ByteDance models ---
185
+ "bytedance-seedance-1.5-pro": {
186
+ modelId: "seedance-1-5-pro-251215",
187
+ type: ["text-to-video", "image-to-video"],
188
+ fields: {
189
+ prompt: { required: true }, // not required for image-to-video, but we can ignore that for simplicity
190
+ aspectRatio: {
191
+ allowedValues: ["21:9", "16:9", "9:16", "1:1", "4:3", "3:4"],
192
+ },
193
+ resolution: { allowedValues: ["480p", "720p", "1080p"] },
194
+ duration: { allowedValues: [4, 5, 6, 7, 8, 9, 10, 11, 12] }, // in seconds
195
+ audio: {},
196
+ // firstFrame: {},
197
+ // lastFrame: {},
198
+ // referenceVideo: {},
199
+ },
200
+ requestPerMin: 600,
201
+ concurrentRequests: 10,
202
+ cost: {
203
+ audio: {
204
+ per1KTokens: 0.0024,
205
+ },
206
+ noAudio: {
207
+ per1KTokens: 0.0012,
208
+ },
209
+ },
210
+ },
211
+ // width * height for each aspect ratio and resolution
212
+ // with and without audio
213
+ "bytedance-seedance-1.0-pro-fast": {
214
+ modelId: "seedance-1-0-pro-fast-251015",
215
+ type: ["text-to-video", "image-to-video"],
216
+ fields: {
217
+ prompt: { required: true },
218
+ aspectRatio: {
219
+ allowedValues: ["21:9", "16:9", "9:16", "1:1", "4:3", "3:4"],
220
+ },
221
+ resolution: { allowedValues: ["480p", "720p", "1080p"] },
222
+ duration: { allowedValues: [2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12] }, // in seconds
223
+ },
224
+ requestPerMin: 600,
225
+ concurrentRequests: 10,
226
+ cost: {
227
+ per1KTokens: 0.001,
228
+ },
229
+ },
230
+ "bytedance-seedance-1.0-pro": {
231
+ modelId: "seedance-1-0-pro-250528",
232
+ type: ["text-to-video", "image-to-video"],
233
+ fields: {
234
+ prompt: { required: true },
235
+ aspectRatio: {
236
+ allowedValues: ["21:9", "16:9", "9:16", "1:1", "4:3", "3:4"],
237
+ },
238
+ resolution: { allowedValues: ["480p", "720p", "1080p"] },
239
+ duration: { allowedValues: [2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12] }, // in seconds
240
+ },
241
+ requestPerMin: 600,
242
+ concurrentRequests: 10,
243
+ cost: {
244
+ per1KTokens: 0.0025,
245
+ },
246
+ },
247
+ // "bytedance-seedance-1.0-lite-t2v": {
248
+ // modelId: "seedance-1-0-lite-t2v-250428",
249
+ // type: ["text-to-video", "image-to-video"],
250
+ // fields: {
251
+ // prompt: { required: true },
252
+ // aspectRatio: {
253
+ // allowedValues: ["21:9", "16:9", "9:16", "1:1", "4:3", "3:4"],
254
+ // },
255
+ // resolution: { allowedValues: ["480p", "720p", "1080p"] },
256
+ // duration: { allowedValues: [2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12] }, // in seconds
257
+ // },
258
+ // requestPerMin: 300,
259
+ // concurrentRequests: 5,
260
+ // cost: {
261
+ // per1KTokens: 0.0018,
262
+ // },
263
+ // },
264
+ // "bytedance-seedance-1.0-lite-i2v": {
265
+ // modelId: "seedance-1-0-lite-i2v-250428",
266
+ // type: ["text-to-video", "image-to-video"],
267
+ // fields: {
268
+ // prompt: { required: true },
269
+ // aspectRatio: {
270
+ // allowedValues: ["21:9", "16:9", "9:16", "1:1", "4:3", "3:4"],
271
+ // },
272
+ // resolution: { allowedValues: ["480p", "720p", "1080p"] },
273
+ // duration: { allowedValues: [2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12] }, // in seconds
274
+ // },
275
+ // requestPerMin: 300,
276
+ // concurrentRequests: 5,
277
+ // cost: {
278
+ // per1KTokens: 0.0018,
279
+ // },
280
+ // },
78
281
  // --- Google models ---
79
282
  "google-veo-3.1-preview": {
80
283
  modelId: "veo-3.1-generate-preview",
@@ -213,49 +416,95 @@ exports.aiModelConfigs = {
213
416
  perSecond: 0.15,
214
417
  },
215
418
  },
216
- /// --- Kling models ---
217
- "kling-v1": {
218
- modelId: "kling-v1",
219
- type: ["text-to-video"],
419
+ // --- Kling models ---
420
+ // "kling-v1": {
421
+ // modelId: "kling-v1",
422
+ // type: ["text-to-video"],
423
+ // fields: {
424
+ // prompt: { required: true },
425
+ // aspectRatio: { allowedValues: ["16:9", "9:16", "1:1"] }, // default 16:9
426
+ // duration: { allowedValues: [5, 10] }, // seconds (5 or 10)
427
+ // cfg_scale: {}, // float, probably between 0 and 1
428
+ // negative_prompt: {},
429
+ // mode: { allowedValues: ["std", "pro"] },
430
+ // },
431
+ // concurrentRequests: 3,
432
+ // // "std" = Standard mode, "pro" = Professional mode
433
+ // cost: {
434
+ // table: {
435
+ // std: { 5: 0.14, 10: 0.28 },
436
+ // pro: { 5: 0.49, 10: 0.98 },
437
+ // },
438
+ // },
439
+ // },
440
+ //
441
+ // "kling-v1.6": {
442
+ // modelId: "kling-v1-6",
443
+ // type: ["text-to-video"],
444
+ // fields: {
445
+ // prompt: { required: true },
446
+ // aspectRatio: { allowedValues: ["16:9", "9:16", "1:1"] }, // assumed similar to v1
447
+ // duration: { allowedValues: [5, 10] }, // likely same limits
448
+ // cfg_scale: {},
449
+ // mode: { allowedValues: ["std", "pro"] },
450
+ // negative_prompt: {},
451
+ // },
452
+ // concurrentRequests: 3,
453
+ // cost: {
454
+ // table: {
455
+ // std: { 5: 0.28, 10: 0.56 },
456
+ // pro: { 5: 0.49, 10: 0.98 },
457
+ // },
458
+ // },
459
+ // },
460
+ // "kling-video-o1": {}
461
+ "kling-v2.6": {
462
+ modelId: "kling-v2-6",
463
+ type: ["text-to-video", "image-to-video"],
220
464
  fields: {
221
465
  prompt: { required: true },
222
- aspectRatio: { allowedValues: ["16:9", "9:16", "1:1"] }, // default 16:9
223
- duration: { allowedValues: [5, 10] }, // seconds (5 or 10)
224
- cfg_scale: {}, // float, probably between 0 and 1
225
- negative_prompt: {},
466
+ aspectRatio: { allowedValues: ["16:9", "9:16", "1:1"] },
467
+ duration: { allowedValues: [5, 10] },
226
468
  mode: { allowedValues: ["std", "pro"] },
469
+ negative_prompt: {},
227
470
  },
228
471
  concurrentRequests: 3,
229
- // "std" = Standard mode, "pro" = Professional mode
230
472
  cost: {
231
- table: {
232
- std: { 5: 0.14, 10: 0.28 },
233
- pro: { 5: 0.49, 10: 0.98 },
473
+ audio: {
474
+ table: {
475
+ std: { 5: 0.21, 10: 0.42 },
476
+ pro: { 5: 0.35, 10: 0.7 },
477
+ },
478
+ },
479
+ noAudio: {
480
+ table: {
481
+ std: { 5: 0.7, 10: 1.4 },
482
+ pro: { 5: 0.84, 10: 1.68 },
483
+ },
234
484
  },
235
485
  },
236
486
  },
237
- "kling-v1.6": {
238
- modelId: "kling-v1-6",
239
- type: ["text-to-video"],
487
+ "kling-v2.5-turbo": {
488
+ modelId: "kling-v2-5-turbo",
489
+ type: ["text-to-video", "image-to-video"],
240
490
  fields: {
241
491
  prompt: { required: true },
242
- aspectRatio: { allowedValues: ["16:9", "9:16", "1:1"] }, // assumed similar to v1
243
- duration: { allowedValues: [5, 10] }, // likely same limits
244
- cfg_scale: {},
492
+ aspectRatio: { allowedValues: ["16:9", "9:16", "1:1"] },
493
+ duration: { allowedValues: [5, 10] },
245
494
  mode: { allowedValues: ["std", "pro"] },
246
495
  negative_prompt: {},
247
496
  },
248
497
  concurrentRequests: 3,
249
498
  cost: {
250
499
  table: {
251
- std: { 5: 0.28, 10: 0.56 },
252
- pro: { 5: 0.49, 10: 0.98 },
500
+ std: { 5: 0.21, 10: 0.42 },
501
+ pro: { 5: 0.35, 10: 0.7 },
253
502
  },
254
503
  },
255
504
  },
256
505
  "kling-v2-master": {
257
506
  modelId: "kling-v2-master",
258
- type: ["text-to-video"],
507
+ type: ["text-to-video", "image-to-video"],
259
508
  fields: {
260
509
  prompt: { required: true },
261
510
  aspectRatio: { allowedValues: ["16:9", "9:16", "1:1"] },
@@ -270,9 +519,27 @@ exports.aiModelConfigs = {
270
519
  },
271
520
  },
272
521
  },
522
+ "kling-v2.1": {
523
+ modelId: "kling-v2-1",
524
+ type: ["image-to-video"],
525
+ fields: {
526
+ prompt: { required: true },
527
+ aspectRatio: { allowedValues: ["16:9", "9:16", "1:1"] },
528
+ duration: { allowedValues: [5, 10] },
529
+ mode: { allowedValues: ["std", "pro"] },
530
+ negative_prompt: {},
531
+ },
532
+ concurrentRequests: 3,
533
+ cost: {
534
+ table: {
535
+ std: { 5: 0.28, 10: 0.56 },
536
+ pro: { 5: 0.49, 10: 0.98 },
537
+ },
538
+ },
539
+ },
273
540
  "kling-v2.1-master": {
274
541
  modelId: "kling-v2-1-master",
275
- type: ["text-to-video"],
542
+ type: ["text-to-video", "image-to-video"],
276
543
  fields: {
277
544
  prompt: { required: true },
278
545
  aspectRatio: { allowedValues: ["16:9", "9:16", "1:1"] },
@@ -288,9 +555,9 @@ exports.aiModelConfigs = {
288
555
  },
289
556
  },
290
557
  // --- MINIMAX model ---
291
- "minimax-hailuo-02": {
292
- modelId: "MiniMax-Hailuo-02",
293
- type: ["text-to-video"],
558
+ "minimax-hailuo-2.3-fast": {
559
+ modelId: "MiniMax-Hailuo-2.3-Fast",
560
+ type: ["text-to-video", "image-to-video"],
294
561
  fields: {
295
562
  prompt: { required: true },
296
563
  resolution: { allowedValues: ["768P", "1080P"] }, // 768P as default
@@ -303,115 +570,156 @@ exports.aiModelConfigs = {
303
570
  // parallelRequests: 1,
304
571
  cost: {
305
572
  table: {
306
- "768P": { 6: 0.28, 10: 0.56 },
307
- "1080P": { 6: 0.49 },
573
+ "768P": { 6: 0.19, 10: 0.32 },
574
+ "1080P": { 6: 0.33 },
308
575
  },
309
576
  },
310
577
  },
311
- "T2V-01-Director": {
312
- modelId: "T2V-01-Director",
578
+ "minimax-hailuo-2.3": {
579
+ modelId: "MiniMax-Hailuo-2.3",
313
580
  type: ["text-to-video"],
314
581
  fields: {
315
582
  prompt: { required: true },
316
- resolution: { allowedValues: ["720P"] }, // 720P as default
317
- duration: { allowedValues: [6] }, // in seconds, 5s as default
583
+ resolution: { allowedValues: ["768P", "1080P"] }, // 768P as default
584
+ duration: { allowedValues: [6, 10] }, // in seconds, 6s as default
318
585
  },
319
586
  durationRules: {
320
- 6: ["720P"],
587
+ 6: ["768P", "1080P"],
588
+ 10: ["768P"],
321
589
  },
322
590
  // parallelRequests: 1,
323
- cost: {
324
- fixed: 0.28, // cost per video generation
325
- },
326
- },
327
- "T2V-01": {
328
- modelId: "T2V-01",
329
- type: ["text-to-video"],
330
- fields: {
331
- prompt: { required: true },
332
- resolution: { allowedValues: ["720P"] }, // 720P as default
333
- duration: { allowedValues: [6] }, // in seconds, 5s as default
334
- },
335
- durationRules: {
336
- 6: ["720P"],
337
- },
338
- // parallelRequests: 1,
339
- cost: { fixed: 0.28 },
340
- },
341
- // --- Alibaba models ---
342
- "alibaba-wan-2.5": {
343
- modelId: "wan2.5-t2v-preview",
344
- type: ["text-to-video"],
345
- fields: {
346
- prompt: { required: true },
347
- resolution: {
348
- allowedValues: ["480p", "720p", "1080p"],
349
- default: "1080p",
350
- },
351
- aspectRatio: {
352
- allowedValues: ["16:9", "9:16", "1:1", "4:3", "3:4"],
353
- default: "16:9",
354
- },
355
- duration: {
356
- allowedValues: [5, 10],
357
- default: 5,
358
- },
359
- },
360
- resolutionRules: {
361
- "480p": ["16:9", "9:16", "1:1"],
362
- "720p": ["16:9", "9:16", "1:1", "4:3", "3:4"],
363
- "1080p": ["16:9", "1:1", "4:3", "3:4"],
364
- },
365
591
  cost: {
366
592
  table: {
367
- "832x480": { 5: 0.25, 10: 0.5 },
368
- "480x832": { 5: 0.25, 10: 0.5 },
369
- "624x624": { 5: 0.25, 10: 0.5 },
370
- "1280x720": { 5: 0.5, 10: 1.0 },
371
- "720x1280": { 5: 0.5, 10: 1.0 },
372
- "960x960": { 5: 0.5, 10: 1.0 },
373
- "1088x832": { 5: 0.5, 10: 1.0 },
374
- "832x1088": { 5: 0.5, 10: 1.0 },
375
- "1920x1080": { 5: 0.75, 10: 1.5 },
376
- "1080x1920": { 5: 0.75, 10: 1.5 },
377
- "1440x1440": { 5: 0.75, 10: 1.5 },
378
- "1632x1248": { 5: 0.75, 10: 1.5 },
379
- "1248x1632": { 5: 0.75, 10: 1.5 },
593
+ "768P": { 6: 0.28, 10: 0.56 },
594
+ "1080P": { 6: 0.49 },
380
595
  },
381
596
  },
382
597
  },
383
- "alibaba-wan-2.2": {
384
- modelId: "wan2.2-t2v-plus",
598
+ "minimax-hailuo-02": {
599
+ modelId: "MiniMax-Hailuo-02",
385
600
  type: ["text-to-video"],
386
601
  fields: {
387
602
  prompt: { required: true },
388
- resolution: {
389
- allowedValues: ["480p", "1080p"],
390
- },
391
- aspectRatio: {
392
- allowedValues: ["16:9", "9:16", "1:1", "4:3", "3:4"],
393
- },
394
- duration: {
395
- allowedValues: [5],
396
- },
603
+ resolution: { allowedValues: ["512P", "768P", "1080P"] }, // 768P as default
604
+ duration: { allowedValues: [6, 10] }, // in seconds, 6s as default
397
605
  },
398
- resolutionRules: {
399
- "480p": ["16:9", "9:16", "1:1"],
400
- "1080p": ["16:9", "1:1", "4:3", "3:4"],
606
+ durationRules: {
607
+ 6: ["512P", "768P", "1080P"],
608
+ 10: ["512P", "768P"],
401
609
  },
610
+ // parallelRequests: 1,
402
611
  cost: {
403
612
  table: {
404
- "832x480": { 5: 0.1 }, // 0.02/sec × 5s
405
- "480x832": { 5: 0.1 },
406
- "624x624": { 5: 0.1 },
407
- "1920x1080": { 5: 0.5 }, // 0.10/sec × 5s
408
- "1080x1920": { 5: 0.5 },
409
- "1440x1440": { 5: 0.5 },
410
- "1632x1248": { 5: 0.5 },
411
- "1248x1632": { 5: 0.5 },
613
+ "512P": { 6: 0.1, 10: 0.15 },
614
+ "768P": { 6: 0.28, 10: 0.56 },
615
+ "1080P": { 6: 0.49 },
412
616
  },
413
617
  },
414
618
  },
619
+ // "T2V-01-Director": {
620
+ // modelId: "T2V-01-Director",
621
+ // type: ["text-to-video"],
622
+ // fields: {
623
+ // prompt: { required: true },
624
+ // resolution: { allowedValues: ["720P"] }, // 720P as default
625
+ // duration: { allowedValues: [6] }, // in seconds, 5s as default
626
+ // },
627
+ // durationRules: {
628
+ // 6: ["720P"],
629
+ // },
630
+ // // parallelRequests: 1,
631
+ // cost: {
632
+ // fixed: 0.28, // cost per video generation
633
+ // },
634
+ // },
635
+ // "T2V-01": {
636
+ // modelId: "T2V-01",
637
+ // type: ["text-to-video"],
638
+ // fields: {
639
+ // prompt: { required: true },
640
+ // resolution: { allowedValues: ["720P"] }, // 720P as default
641
+ // duration: { allowedValues: [6] }, // in seconds, 5s as default
642
+ // },
643
+ // durationRules: {
644
+ // 6: ["720P"],
645
+ // },
646
+ // // parallelRequests: 1,
647
+ // cost: { fixed: 0.28 },
648
+ // },
649
+ // --- Alibaba models ---
650
+ // "alibaba-wan-2.5": {
651
+ // modelId: "wan2.5-t2v-preview",
652
+ // type: ["text-to-video"],
653
+ // fields: {
654
+ // prompt: { required: true },
655
+ // resolution: {
656
+ // allowedValues: ["480p", "720p", "1080p"],
657
+ // default: "1080p",
658
+ // },
659
+ // aspectRatio: {
660
+ // allowedValues: ["16:9", "9:16", "1:1", "4:3", "3:4"],
661
+ // default: "16:9",
662
+ // },
663
+ // duration: {
664
+ // allowedValues: [5, 10],
665
+ // default: 5,
666
+ // },
667
+ // },
668
+ // resolutionRules: {
669
+ // "480p": ["16:9", "9:16", "1:1"],
670
+ // "720p": ["16:9", "9:16", "1:1", "4:3", "3:4"],
671
+ // "1080p": ["16:9", "1:1", "4:3", "3:4"],
672
+ // },
673
+ // cost: {
674
+ // table: {
675
+ // "832x480": { 5: 0.25, 10: 0.5 },
676
+ // "480x832": { 5: 0.25, 10: 0.5 },
677
+ // "624x624": { 5: 0.25, 10: 0.5 },
678
+ // "1280x720": { 5: 0.5, 10: 1.0 },
679
+ // "720x1280": { 5: 0.5, 10: 1.0 },
680
+ // "960x960": { 5: 0.5, 10: 1.0 },
681
+ // "1088x832": { 5: 0.5, 10: 1.0 },
682
+ // "832x1088": { 5: 0.5, 10: 1.0 },
683
+ // "1920x1080": { 5: 0.75, 10: 1.5 },
684
+ // "1080x1920": { 5: 0.75, 10: 1.5 },
685
+ // "1440x1440": { 5: 0.75, 10: 1.5 },
686
+ // "1632x1248": { 5: 0.75, 10: 1.5 },
687
+ // "1248x1632": { 5: 0.75, 10: 1.5 },
688
+ // },
689
+ // },
690
+ // },
691
+ // "alibaba-wan-2.2": {
692
+ // modelId: "wan2.2-t2v-plus",
693
+ // type: ["text-to-video"],
694
+ // fields: {
695
+ // prompt: { required: true },
696
+ // resolution: {
697
+ // allowedValues: ["480p", "1080p"],
698
+ // },
699
+ // aspectRatio: {
700
+ // allowedValues: ["16:9", "9:16", "1:1", "4:3", "3:4"],
701
+ // },
702
+ // duration: {
703
+ // allowedValues: [5],
704
+ // },
705
+ // },
706
+ // resolutionRules: {
707
+ // "480p": ["16:9", "9:16", "1:1"],
708
+ // "1080p": ["16:9", "1:1", "4:3", "3:4"],
709
+ // },
710
+ // cost: {
711
+ // table: {
712
+ // "832x480": { 5: 0.1 }, // 0.02/sec × 5s
713
+ // "480x832": { 5: 0.1 },
714
+ // "624x624": { 5: 0.1 },
715
+ // "1920x1080": { 5: 0.5 }, // 0.10/sec × 5s
716
+ // "1080x1920": { 5: 0.5 },
717
+ // "1440x1440": { 5: 0.5 },
718
+ // "1632x1248": { 5: 0.5 },
719
+ // "1248x1632": { 5: 0.5 },
720
+ // },
721
+ // },
722
+ // },
415
723
  "openai-sora-2": {
416
724
  modelId: "sora-2",
417
725
  type: ["text-to-video", "image-to-video", "video-to-video"],
@@ -460,44 +768,44 @@ exports.aiModelConfigs = {
460
768
  },
461
769
  requestPerMin: 10,
462
770
  },
463
- "azure-sora": {
464
- modelId: "sora",
465
- type: ["text-to-video", "image-to-video", "video-to-video"],
466
- fields: {
467
- prompt: { required: true },
468
- dimensions: {
469
- allowedValues: [
470
- "480x480",
471
- "480x854",
472
- "854x480",
473
- "720x720",
474
- "720x1280",
475
- "1280x720",
476
- "1080x1080",
477
- "1080x1920",
478
- "1920x1080",
479
- ],
480
- default: "480x480",
481
- },
482
- duration: {
483
- allowedValues: [1, 5, 10, 15, 20], // in seconds
484
- default: 5,
485
- },
486
- imageUrl: { required: false }, // up to 2
487
- videoUrl: { required: false }, // up to 5s
488
- },
489
- // parallelRequests: 1,
490
- cost: {
491
- table: {
492
- "480x480": { 5: 0.15, 10: 0.15, 15: 0.15, 20: 0.15 },
493
- "480x854": { 5: 0.2, 10: 0.2, 15: 0.2, 20: 0.2 },
494
- "720x720": { 5: 0.3, 10: 0.3, 15: 0.3, 20: 0.3 },
495
- "1280x720": { 5: 0.45, 10: 0.5, 15: 0.65, 20: 0.75 },
496
- "1080x1080": { 5: 0.6, 10: 0.75, 15: 1.1, 20: 1.35 },
497
- "1920x1080": { 5: 1.3, 10: 1.85, 15: 2.9, 20: 3.6 },
498
- },
499
- },
500
- },
771
+ // "azure-sora": {
772
+ // modelId: "sora",
773
+ // type: ["text-to-video", "image-to-video", "video-to-video"],
774
+ // fields: {
775
+ // prompt: { required: true },
776
+ // dimensions: {
777
+ // allowedValues: [
778
+ // "480x480",
779
+ // "480x854",
780
+ // "854x480",
781
+ // "720x720",
782
+ // "720x1280",
783
+ // "1280x720",
784
+ // "1080x1080",
785
+ // "1080x1920",
786
+ // "1920x1080",
787
+ // ],
788
+ // default: "480x480",
789
+ // },
790
+ // duration: {
791
+ // allowedValues: [1, 5, 10, 15, 20], // in seconds
792
+ // default: 5,
793
+ // },
794
+ // imageUrl: { required: false }, // up to 2
795
+ // videoUrl: { required: false }, // up to 5s
796
+ // },
797
+ // // parallelRequests: 1,
798
+ // cost: {
799
+ // table: {
800
+ // "480x480": { 5: 0.15, 10: 0.15, 15: 0.15, 20: 0.15 },
801
+ // "480x854": { 5: 0.2, 10: 0.2, 15: 0.2, 20: 0.2 },
802
+ // "720x720": { 5: 0.3, 10: 0.3, 15: 0.3, 20: 0.3 },
803
+ // "1280x720": { 5: 0.45, 10: 0.5, 15: 0.65, 20: 0.75 },
804
+ // "1080x1080": { 5: 0.6, 10: 0.75, 15: 1.1, 20: 1.35 },
805
+ // "1920x1080": { 5: 1.3, 10: 1.85, 15: 2.9, 20: 3.6 },
806
+ // },
807
+ // },
808
+ // },
501
809
  // --- TEXT GEN models ---
502
810
  "openai-gpt-4o-mini": {
503
811
  modelId: "gpt-4o-mini",
@@ -32,6 +32,11 @@ export interface IVideoJobModel {
32
32
  totalCreditsUsed?: number;
33
33
  estimatedCredits?: number;
34
34
  durationType?: EVideoDurationType;
35
+ feedback?: {
36
+ rating?: number;
37
+ comment?: string;
38
+ createdAt?: FieldValue;
39
+ };
35
40
  duration?: number;
36
41
  mode?: EVideoMode;
37
42
  dimensions?: string;
@@ -1 +1 @@
1
- {"version":3,"file":"video.model.d.ts","sourceRoot":"","sources":["../../src/models/video.model.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AACtD,OAAO,EAAe,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACnE,OAAO,EACL,kBAAkB,EAClB,eAAe,EACf,iBAAiB,EACjB,aAAa,EACb,WAAW,EACZ,MAAM,kBAA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B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,WAAW,EAAE,CAAC;IACvB,WAAW,CAAC,EAAE,WAAW,CAAC;IAC1B,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,YAAY,CAAC,EAAE,kBAAkB,CAAC;IAClC,QAAQ,CAAC,EAAE;QACT,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,OAAO,CAAC,EAAE,MAAM,CAAC;QACjB,SAAS,CAAC,EAAE,UAAU,CAAC;KACxB,CAAA;IAGD,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,IAAI,CAAC,EAAE,UAAU,CAAC;IAClB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,aAAa,CAAC,EAAE,MAAM,CAAC;IAGvB,SAAS,EAAE,UAAU,CAAC;IACtB,SAAS,EAAE,UAAU,CAAC;CACvB"}
@@ -0,0 +1,9 @@
1
+ import { BaseAiGenProviderService } from "../baseAiGenProvider.service";
2
+ import { CreditUsageParams, VideoGenerationParams, VideoGenerationResult, VideoStatusParams, VideoStatusResult } from "../types";
3
+ export declare class ByteDanceService extends BaseAiGenProviderService {
4
+ private readonly baseUrl;
5
+ generateVideo(params: VideoGenerationParams): Promise<VideoGenerationResult>;
6
+ checkVideoStatus({ task, outputFilename, outputFilePath, }: VideoStatusParams): Promise<VideoStatusResult>;
7
+ getCreditUsed(params: CreditUsageParams): number;
8
+ }
9
+ //# sourceMappingURL=bytedance.service.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bytedance.service.d.ts","sourceRoot":"","sources":["../../../../../src/services/aiGen/providers/bytedance/bytedance.service.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,wBAAwB,EAAE,MAAM,8BAA8B,CAAC;AACxE,OAAO,EACL,iBAAiB,EACjB,qBAAqB,EACrB,qBAAqB,EACrB,iBAAiB,EACjB,iBAAiB,EAClB,MAAM,UAAU,CAAC;AASlB,qBAAa,gBAAiB,SAAQ,wBAAwB;IAC5D,OAAO,CAAC,QAAQ,CAAC,OAAO,CACsD;IAExE,aAAa,CACjB,MAAM,EAAE,qBAAqB,GAC5B,OAAO,CAAC,qBAAqB,CAAC;IA4D3B,gBAAgB,CAAC,EACrB,IAAI,EACJ,cAAc,EACd,cAAyB,GAC1B,EAAE,iBAAiB,GAAG,OAAO,CAAC,iBAAiB,CAAC;IA4FjD,aAAa,CAAC,MAAM,EAAE,iBAAiB,GAAG,MAAM;CAoCjD"}
@@ -0,0 +1,159 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.ByteDanceService = void 0;
7
+ // bytedance.service.ts
8
+ const baseAiGenProvider_service_1 = require("../baseAiGenProvider.service");
9
+ const helpers_1 = require("../../helpers");
10
+ const aiModels_1 = require("../../../../globals/aiModels");
11
+ const types_1 = require("../../../../globals/types");
12
+ const firebase_1 = require("../../../../libs/firebase");
13
+ const helpers_2 = require("../../../../utils/helpers");
14
+ const logger_1 = require("../../../../utils/logger");
15
+ const crypto_1 = __importDefault(require("crypto"));
16
+ class ByteDanceService extends baseAiGenProvider_service_1.BaseAiGenProviderService {
17
+ constructor() {
18
+ super(...arguments);
19
+ this.baseUrl = "https://ark.ap-southeast.bytepluses.com/api/v3/contents/generations/tasks";
20
+ }
21
+ async generateVideo(params) {
22
+ (0, helpers_1.validateParams)(params);
23
+ const modelConfig = aiModels_1.aiModelConfigs[params.modelKey];
24
+ const modelId = modelConfig.modelId;
25
+ const content = [
26
+ {
27
+ type: "text",
28
+ text: params.prompt,
29
+ },
30
+ ];
31
+ // Optional image → Image-to-Video (first frame)
32
+ if (params.inputImageUrl) {
33
+ content.push({
34
+ type: "image",
35
+ image_url: params.inputImageUrl,
36
+ });
37
+ }
38
+ const body = {
39
+ model: modelId,
40
+ content,
41
+ ratio: params.aspectRatio, // e.g. 16:9
42
+ resolution: params.resolution, // e.g. 720p
43
+ duration: params.duration, // seconds
44
+ watermark: false,
45
+ service_tier: "default",
46
+ execution_expires_after: 172800, // 48h
47
+ };
48
+ const resp = await fetch(this.baseUrl, {
49
+ method: "POST",
50
+ headers: {
51
+ "Content-Type": "application/json",
52
+ Authorization: `Bearer ${process.env.BYTEDANCE_API_KEY}`,
53
+ },
54
+ body: JSON.stringify(body),
55
+ });
56
+ if (!resp.ok) {
57
+ const errText = await resp.text();
58
+ throw new Error(`ByteDance generateVideo failed (${resp.status}): ${errText}`);
59
+ }
60
+ const data = await resp.json();
61
+ if (!data.id) {
62
+ throw new Error("ByteDance API did not return task id");
63
+ }
64
+ return {
65
+ task: data.id,
66
+ status: types_1.EVideoSceneStatus.TRIGGERED,
67
+ };
68
+ }
69
+ async checkVideoStatus({ task, outputFilename, outputFilePath = "videos", }) {
70
+ const url = `https://ark.ap-southeast.bytepluses.com/api/v3/contents/generations/tasks/${task}`;
71
+ const resp = await fetch(url, {
72
+ method: "GET",
73
+ headers: {
74
+ "Content-Type": "application/json",
75
+ Authorization: `Bearer ${process.env.BYTEDANCE_API_KEY}`,
76
+ },
77
+ });
78
+ if (!resp.ok) {
79
+ const errText = await resp.text();
80
+ throw new Error(`ByteDance checkVideoStatus failed (${resp.status}): ${errText}`);
81
+ }
82
+ const data = await resp.json();
83
+ // ---- Status mapping ----
84
+ switch (data.status) {
85
+ case "queued":
86
+ case "running":
87
+ return { status: types_1.EVideoSceneStatus.PENDING };
88
+ case "failed":
89
+ case "expired":
90
+ case "cancelled":
91
+ return {
92
+ status: types_1.EVideoSceneStatus.FAILED,
93
+ errorMessage: data.error
94
+ ? JSON.stringify(data.error)
95
+ : "ByteDance video generation failed",
96
+ };
97
+ case "succeeded":
98
+ break;
99
+ default:
100
+ return {
101
+ status: types_1.EVideoSceneStatus.FAILED,
102
+ errorMessage: `Unknown ByteDance task status: ${data.status}`,
103
+ };
104
+ }
105
+ // ---- Success path ----
106
+ const sourceVideoUrl = data.content?.video_url;
107
+ if (!sourceVideoUrl) {
108
+ return {
109
+ status: types_1.EVideoSceneStatus.FAILED,
110
+ errorMessage: "ByteDance response missing video_url",
111
+ };
112
+ }
113
+ // Download generated video
114
+ const videoResp = await fetch(sourceVideoUrl);
115
+ if (!videoResp.ok) {
116
+ throw new Error(`Failed to download ByteDance video (${videoResp.status})`);
117
+ }
118
+ const buffer = Buffer.from(await videoResp.arrayBuffer());
119
+ // ---- Upload to Firebase Storage (PUBLIC URL) ----
120
+ const filePath = `${outputFilePath}/${outputFilename}.mp4`;
121
+ const bucket = (0, firebase_1.getBucket)();
122
+ const file = bucket.file(filePath);
123
+ const downloadToken = crypto_1.default.randomUUID();
124
+ await file.save(buffer, {
125
+ contentType: "video/mp4",
126
+ resumable: false,
127
+ metadata: {
128
+ firebaseStorageDownloadTokens: downloadToken,
129
+ cacheControl: "public, max-age=31536000",
130
+ },
131
+ });
132
+ const publicVideoUrl = `https://firebasestorage.googleapis.com/v0/b/${bucket.name}` +
133
+ `/o/${encodeURIComponent(filePath)}?alt=media&token=${downloadToken}`;
134
+ return {
135
+ videoUrl: publicVideoUrl,
136
+ status: types_1.EVideoSceneStatus.COMPLETED,
137
+ };
138
+ }
139
+ getCreditUsed(params) {
140
+ const modelConfig = aiModels_1.aiModelConfigs[params.modelKey];
141
+ if (!modelConfig.cost?.per1KTokens ||
142
+ !params.resolution ||
143
+ !params.aspectRatio ||
144
+ !params.duration) {
145
+ logger_1.logger.warn(`Missing cost or parameters for credit calculation. Returning default credits. Params: ${JSON.stringify(params)}, ModelConfig: ${JSON.stringify(modelConfig)}`);
146
+ return 10; // default fallback
147
+ }
148
+ const dims = dimensionsMap[params.resolution]?.[params.aspectRatio];
149
+ if (!dims) {
150
+ logger_1.logger.warn(`Unsupported resolution/aspectRatio for credit calculation. Returning default credits. Params: ${JSON.stringify(params)}`);
151
+ return 10; // default fallback
152
+ }
153
+ const FRAME_RATE = 24;
154
+ const tokensConsumed = Math.ceil((dims?.width * dims?.height * FRAME_RATE * params.duration) / 1024);
155
+ const cost = (modelConfig.cost.per1KTokens * tokensConsumed) / 1000;
156
+ return (0, helpers_2.getCreditsFromCost)(cost);
157
+ }
158
+ }
159
+ exports.ByteDanceService = ByteDanceService;
@@ -0,0 +1,2 @@
1
+ declare const dimensionsMap: Record<string, Record<string, VideoDimensions>>;
2
+ //# sourceMappingURL=constants.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../../src/services/aiGen/providers/bytedance/constants.ts"],"names":[],"mappings":"AAEA,QAAA,MAAM,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,eAAe,CAAC,CAyBlE,CAAC"}
@@ -0,0 +1,27 @@
1
+ "use strict";
2
+ const dimensionsMap = {
3
+ "480p": {
4
+ "21:9": { width: 960, height: 416 },
5
+ "16:9": { width: 864, height: 480 },
6
+ "9:16": { width: 480, height: 864 },
7
+ "1:1": { width: 640, height: 640 },
8
+ "4:3": { width: 736, height: 544 },
9
+ "3:4": { width: 544, height: 736 },
10
+ },
11
+ "720p": {
12
+ "21:9": { width: 1504, height: 640 },
13
+ "16:9": { width: 1248, height: 704 },
14
+ "9:16": { width: 704, height: 1248 },
15
+ "1:1": { width: 960, height: 960 },
16
+ "4:3": { width: 1120, height: 832 },
17
+ "3:4": { width: 832, height: 1120 },
18
+ },
19
+ "1080p": {
20
+ "21:9": { width: 2176, height: 928 },
21
+ "16:9": { width: 1920, height: 1088 },
22
+ "9:16": { width: 1088, height: 1920 },
23
+ "1:1": { width: 1440, height: 1440 },
24
+ "4:3": { width: 1664, height: 1248 },
25
+ "3:4": { width: 1248, height: 1664 },
26
+ },
27
+ };
@@ -0,0 +1,2 @@
1
+ export * from "./bytedance.service";
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/services/aiGen/providers/bytedance/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC"}
@@ -0,0 +1,17 @@
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 __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./bytedance.service"), exports);
@@ -0,0 +1,5 @@
1
+ type VideoDimensions = {
2
+ width: number;
3
+ height: number;
4
+ };
5
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../src/services/aiGen/providers/bytedance/types.ts"],"names":[],"mappings":"AAAA,KAAK,eAAe,GAAG;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC"}
@@ -0,0 +1 @@
1
+ "use strict";
@@ -12,5 +12,12 @@ export declare class GSheetService extends GCPService {
12
12
  private mergeHeaders;
13
13
  private ensureSheetExists;
14
14
  private columnLetter;
15
+ upsertRowByKey<T extends Record<string, any>>({ spreadsheetId, sheetName, header, row, keyColumn, }: {
16
+ spreadsheetId: string;
17
+ sheetName: string;
18
+ header: string[];
19
+ row: T;
20
+ keyColumn: string;
21
+ }): Promise<void>;
15
22
  }
16
23
  //# sourceMappingURL=gsheet.service.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"gsheet.service.d.ts","sourceRoot":"","sources":["../../../src/services/gcp/gsheet.service.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAE,4BAA4B,EAAE,MAAM,SAAS,CAAC;AAEvD,qBAAa,aAAc,SAAQ,UAAU;IAC3C,OAAO,CAAC,MAAM,CAAmB;;IAWjC;;OAEG;IACG,oBAAoB,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EACtD,MAAM,EAAE,4BAA4B,CAAC,CAAC,CAAC,GACtC,OAAO,CAAC,IAAI,CAAC;YAsDF,SAAS;YAYT,WAAW;IAezB,OAAO,CAAC,YAAY;YAMN,iBAAiB;IA4B/B,OAAO,CAAC,YAAY;CASrB"}
1
+ {"version":3,"file":"gsheet.service.d.ts","sourceRoot":"","sources":["../../../src/services/gcp/gsheet.service.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAE,4BAA4B,EAAE,MAAM,SAAS,CAAC;AAEvD,qBAAa,aAAc,SAAQ,UAAU;IAC3C,OAAO,CAAC,MAAM,CAAmB;;IAWjC;;OAEG;IACG,oBAAoB,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EACtD,MAAM,EAAE,4BAA4B,CAAC,CAAC,CAAC,GACtC,OAAO,CAAC,IAAI,CAAC;YAsDF,SAAS;YAYT,WAAW;IAezB,OAAO,CAAC,YAAY;YAMN,iBAAiB;IA4B/B,OAAO,CAAC,YAAY;IAUd,cAAc,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE,EAClD,aAAa,EACb,SAAS,EACT,MAAM,EACN,GAAG,EACH,SAAS,GACV,EAAE;QACD,aAAa,EAAE,MAAM,CAAC;QACtB,SAAS,EAAE,MAAM,CAAC;QAClB,MAAM,EAAE,MAAM,EAAE,CAAC;QACjB,GAAG,EAAE,CAAC,CAAC;QACP,SAAS,EAAE,MAAM,CAAC;KACnB;CA2DF"}
@@ -99,5 +99,51 @@ class GSheetService extends gcp_service_1.GCPService {
99
99
  }
100
100
  return letter;
101
101
  }
102
+ async upsertRowByKey({ spreadsheetId, sheetName, header, row, keyColumn, }) {
103
+ await this.ensureSheetExists(spreadsheetId, sheetName);
104
+ const existingHeader = await this.getHeader(spreadsheetId, sheetName);
105
+ const finalHeader = existingHeader.length === 0
106
+ ? header
107
+ : this.mergeHeaders(existingHeader, header);
108
+ if (existingHeader.length === 0) {
109
+ await this.writeHeader(spreadsheetId, sheetName, finalHeader);
110
+ }
111
+ const keyIndex = finalHeader.indexOf(keyColumn);
112
+ if (keyIndex === -1) {
113
+ throw new Error(`Key column ${keyColumn} not found in header`);
114
+ }
115
+ // Get all data
116
+ const res = await this.sheets.spreadsheets.values.get({
117
+ spreadsheetId,
118
+ range: `${sheetName}!A2:${this.columnLetter(finalHeader.length)}`,
119
+ });
120
+ const rows = res.data.values ?? [];
121
+ const existingRowIndex = rows.findIndex((r) => r[keyIndex] === row[keyColumn]);
122
+ const values = finalHeader.map((col) => row[col] !== undefined ? row[col] : "");
123
+ if (existingRowIndex >= 0) {
124
+ // UPDATE existing row
125
+ const actualRowNumber = existingRowIndex + 2;
126
+ await this.sheets.spreadsheets.values.update({
127
+ spreadsheetId,
128
+ range: `${sheetName}!A${actualRowNumber}`,
129
+ valueInputOption: "USER_ENTERED",
130
+ requestBody: {
131
+ values: [values],
132
+ },
133
+ });
134
+ }
135
+ else {
136
+ // APPEND new row
137
+ await this.sheets.spreadsheets.values.append({
138
+ spreadsheetId,
139
+ range: `${sheetName}!A:${this.columnLetter(finalHeader.length)}`,
140
+ valueInputOption: "USER_ENTERED",
141
+ insertDataOption: "INSERT_ROWS",
142
+ requestBody: {
143
+ values: [values],
144
+ },
145
+ });
146
+ }
147
+ }
102
148
  }
103
149
  exports.GSheetService = GSheetService;
@@ -49,8 +49,8 @@ const getPriceIdByType = (type, freq = types_1.ERENEWAL_FREQUENCY.MONTHLY) => {
49
49
  };
50
50
  exports.getPriceIdByType = getPriceIdByType;
51
51
  const getCreditsFromCost = (cost) => {
52
- const margin = 0.2;
53
- const costPerCredit = 0.1;
52
+ const margin = 0.2; // 20% margin
53
+ const costPerCredit = 0.1; // multiple
54
54
  const minCredits = 10;
55
55
  if (cost <= 0)
56
56
  return 0;
@@ -1,6 +1,7 @@
1
- import { Logger } from "winston";
1
+ import winston, { Logger } from "winston";
2
2
  /**
3
3
  * Logger factory
4
4
  */
5
5
  export declare function createLogger(serviceName: string): Logger;
6
+ export declare const logger: winston.Logger;
6
7
  //# sourceMappingURL=logger.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../../src/utils/logger.ts"],"names":[],"mappings":"AAAA,OAAgB,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AA0B1C;;GAEG;AACH,wBAAgB,YAAY,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,CAsExD"}
1
+ {"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../../src/utils/logger.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,EAAE,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AA0B1C;;GAEG;AACH,wBAAgB,YAAY,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,CAsExD;AAED,eAAO,MAAM,MAAM,gBAAyB,CAAC"}
@@ -3,6 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.logger = void 0;
6
7
  exports.createLogger = createLogger;
7
8
  const winston_1 = __importDefault(require("winston"));
8
9
  const winston_slack_webhook_transport_1 = __importDefault(require("winston-slack-webhook-transport"));
@@ -83,3 +84,4 @@ function createLogger(serviceName) {
83
84
  exitOnError: false,
84
85
  });
85
86
  }
87
+ exports.logger = createLogger("shared");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vidspotai-shared",
3
- "version": "1.0.29",
3
+ "version": "1.0.30",
4
4
  "main": "lib/index.js",
5
5
  "types": "lib/index.d.ts",
6
6
  "exports": {