mulmocast 2.6.5 → 2.6.7
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/lib/actions/audio.js +7 -35
- package/lib/actions/graph_option.d.ts +4 -0
- package/lib/actions/graph_option.js +19 -0
- package/lib/actions/image_references.js +3 -3
- package/lib/actions/images.d.ts +2 -3
- package/lib/actions/images.js +5 -19
- package/lib/actions/movie.d.ts +3 -0
- package/lib/actions/movie.js +38 -5
- package/lib/agents/add_bgm_agent.d.ts +10 -0
- package/lib/agents/add_bgm_agent.js +26 -4
- package/lib/agents/movie_genai_agent.js +1 -1
- package/lib/agents/movie_replicate_agent.js +29 -5
- package/lib/methods/mulmo_presentation_style.d.ts +5 -1
- package/lib/methods/mulmo_presentation_style.js +27 -3
- package/lib/types/provider2agent.d.ts +2 -0
- package/lib/types/provider2agent.js +78 -5
- package/lib/types/schema.d.ts +55 -4
- package/lib/types/schema.js +12 -1
- package/lib/utils/context.d.ts +28 -2
- package/lib/utils/image_plugins/html_tailwind.d.ts +5 -0
- package/lib/utils/image_plugins/html_tailwind.js +56 -5
- package/package.json +18 -16
- package/scripts/test/fixtures/movie_tone_high.mov +0 -0
- package/scripts/test/fixtures/movie_tone_low.mov +0 -0
- package/scripts/test/fixtures/movie_tone_mid.mov +0 -0
- package/scripts/test/glb/sample_2026-03-15T172907.296_compat.glb +0 -0
- package/scripts/test/test_audio_mix.json +91 -0
- package/scripts/test/test_audio_mix_beat_vol.json +100 -0
- package/scripts/test/test_audio_mix_ducking.json +91 -0
- package/scripts/test/test_audio_mix_legacy.json +90 -0
- package/scripts/test/test_grok.json +57 -0
- package/scripts/test/test_image_references.json +74 -0
- package/scripts/test/test_kling_v3.json +54 -0
- package/scripts/test/test_kling_v3_omni.json +54 -0
- package/scripts/test/test_lipsync2.json +48 -52
- package/scripts/test/test_lipsync5.json +66 -0
- package/scripts/test/test_runway.json +54 -0
- package/scripts/test/test_threejs.json +241 -0
- package/scripts/test/test_threejs_glb.json +154 -0
- package/scripts/test/test_veo31_lite.json +39 -0
|
@@ -92,6 +92,9 @@ export const provider2MovieAgent = {
|
|
|
92
92
|
"kwaivgi/kling-v2.1-master",
|
|
93
93
|
"google/veo-2",
|
|
94
94
|
"google/veo-3",
|
|
95
|
+
"google/veo-3.1",
|
|
96
|
+
"google/veo-3.1-fast",
|
|
97
|
+
"google/veo-3.1-lite",
|
|
95
98
|
"google/veo-3-fast",
|
|
96
99
|
"minimax/video-01",
|
|
97
100
|
"minimax/hailuo-02",
|
|
@@ -99,6 +102,11 @@ export const provider2MovieAgent = {
|
|
|
99
102
|
"pixverse/pixverse-v4.5",
|
|
100
103
|
"wan-video/wan-2.2-i2v-fast",
|
|
101
104
|
"wan-video/wan-2.2-t2v-fast",
|
|
105
|
+
"xai/grok-imagine-video",
|
|
106
|
+
"xai/grok-imagine-r2v",
|
|
107
|
+
"runwayml/gen-4.5",
|
|
108
|
+
"kwaivgi/kling-v3-omni-video",
|
|
109
|
+
"kwaivgi/kling-v3-video",
|
|
102
110
|
],
|
|
103
111
|
modelParams: {
|
|
104
112
|
"bytedance/seedance-1-lite": {
|
|
@@ -138,6 +146,25 @@ export const provider2MovieAgent = {
|
|
|
138
146
|
start_image: "image",
|
|
139
147
|
price_per_sec: 0.75,
|
|
140
148
|
},
|
|
149
|
+
"google/veo-3.1": {
|
|
150
|
+
durations: [4, 6, 8],
|
|
151
|
+
start_image: "image",
|
|
152
|
+
last_image: "last_frame_image",
|
|
153
|
+
reference_images_param: "reference_images",
|
|
154
|
+
price_per_sec: 0.75,
|
|
155
|
+
},
|
|
156
|
+
"google/veo-3.1-fast": {
|
|
157
|
+
durations: [4, 6, 8],
|
|
158
|
+
start_image: "image",
|
|
159
|
+
last_image: "last_frame_image",
|
|
160
|
+
price_per_sec: 0.4,
|
|
161
|
+
},
|
|
162
|
+
"google/veo-3.1-lite": {
|
|
163
|
+
durations: [4, 6, 8],
|
|
164
|
+
start_image: "image",
|
|
165
|
+
last_image: "last_frame",
|
|
166
|
+
price_per_sec: 0.05,
|
|
167
|
+
},
|
|
141
168
|
"google/veo-3-fast": {
|
|
142
169
|
durations: [8],
|
|
143
170
|
start_image: "image",
|
|
@@ -175,28 +202,68 @@ export const provider2MovieAgent = {
|
|
|
175
202
|
start_image: undefined,
|
|
176
203
|
price_per_sec: 0.012,
|
|
177
204
|
},
|
|
205
|
+
"xai/grok-imagine-video": {
|
|
206
|
+
durations: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15],
|
|
207
|
+
start_image: "image",
|
|
208
|
+
price_per_sec: 0.08,
|
|
209
|
+
},
|
|
210
|
+
"xai/grok-imagine-r2v": {
|
|
211
|
+
durations: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10],
|
|
212
|
+
start_image: undefined,
|
|
213
|
+
reference_images_param: "reference_images",
|
|
214
|
+
price_per_sec: 0.08,
|
|
215
|
+
},
|
|
216
|
+
"runwayml/gen-4.5": {
|
|
217
|
+
durations: [5, 10],
|
|
218
|
+
start_image: "image",
|
|
219
|
+
price_per_sec: 0.25,
|
|
220
|
+
},
|
|
221
|
+
"kwaivgi/kling-v3-omni-video": {
|
|
222
|
+
durations: [3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15],
|
|
223
|
+
start_image: "start_image",
|
|
224
|
+
last_image: "end_image",
|
|
225
|
+
reference_images_param: "reference_images",
|
|
226
|
+
price_per_sec: 0.3,
|
|
227
|
+
},
|
|
228
|
+
"kwaivgi/kling-v3-video": {
|
|
229
|
+
durations: [3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15],
|
|
230
|
+
start_image: "start_image",
|
|
231
|
+
last_image: "end_image",
|
|
232
|
+
reference_images_param: "reference_images",
|
|
233
|
+
price_per_sec: 0.3,
|
|
234
|
+
},
|
|
178
235
|
},
|
|
179
236
|
},
|
|
180
237
|
google: {
|
|
181
238
|
agentName: "movieGenAIAgent",
|
|
182
239
|
defaultModel: "veo-2.0-generate-001",
|
|
183
|
-
models: ["veo-2.0-generate-001", "veo-3.0-generate-001", "veo-3.1-generate-preview"],
|
|
240
|
+
models: ["veo-2.0-generate-001", "veo-3.0-generate-001", "veo-3.1-generate-preview", "veo-3.1-lite-generate-preview"],
|
|
184
241
|
keyName: "GEMINI_API_KEY",
|
|
185
242
|
modelParams: {
|
|
243
|
+
"veo-3.1-lite-generate-preview": {
|
|
244
|
+
durations: [4, 6, 8],
|
|
245
|
+
supportsDuration: true,
|
|
246
|
+
supportsLastFrame: true,
|
|
247
|
+
supportsReferenceImages: false,
|
|
248
|
+
supportsPersonGeneration: false,
|
|
249
|
+
},
|
|
186
250
|
"veo-3.1-generate-preview": {
|
|
187
251
|
durations: [4, 6, 8],
|
|
252
|
+
supportsDuration: true,
|
|
188
253
|
supportsLastFrame: true,
|
|
189
254
|
supportsReferenceImages: true,
|
|
190
255
|
supportsPersonGeneration: false,
|
|
191
256
|
},
|
|
192
257
|
"veo-3.0-generate-001": {
|
|
193
|
-
durations: [
|
|
258
|
+
durations: [8],
|
|
259
|
+
supportsDuration: false, // Veo 3.0 always generates 8s
|
|
194
260
|
supportsLastFrame: false,
|
|
195
261
|
supportsReferenceImages: false,
|
|
196
262
|
supportsPersonGeneration: false,
|
|
197
263
|
},
|
|
198
264
|
"veo-2.0-generate-001": {
|
|
199
|
-
durations: [5, 6,
|
|
265
|
+
durations: [5, 6, 8],
|
|
266
|
+
supportsDuration: true,
|
|
200
267
|
supportsLastFrame: false, // Vertex AI only
|
|
201
268
|
supportsReferenceImages: false,
|
|
202
269
|
supportsPersonGeneration: true,
|
|
@@ -229,7 +296,7 @@ export const provider2LipSyncAgent = {
|
|
|
229
296
|
agentName: "lipSyncReplicateAgent",
|
|
230
297
|
defaultModel: "bytedance/omni-human",
|
|
231
298
|
keyName: "REPLICATE_API_TOKEN",
|
|
232
|
-
models: ["bytedance/latentsync", "tmappdev/lipsync", "bytedance/omni-human"],
|
|
299
|
+
models: ["bytedance/latentsync", "tmappdev/lipsync", "bytedance/omni-human", "pixverse/lipsync"],
|
|
233
300
|
modelParams: {
|
|
234
301
|
"bytedance/latentsync": {
|
|
235
302
|
identifier: "bytedance/latentsync:637ce1919f807ca20da3a448ddc2743535d2853649574cd52a933120e9b9e293",
|
|
@@ -247,14 +314,20 @@ export const provider2LipSyncAgent = {
|
|
|
247
314
|
audio: "audio",
|
|
248
315
|
price_per_sec: 0.14,
|
|
249
316
|
},
|
|
317
|
+
"pixverse/lipsync": {
|
|
318
|
+
identifier: "pixverse/lipsync:3ca6d73f4fb9e1d77a4b6e14f8998ee18926e4dc462838e31fa2bb5e662c1e2c",
|
|
319
|
+
video: "video",
|
|
320
|
+
audio: "audio",
|
|
321
|
+
},
|
|
250
322
|
/* NOTE: This model does not work with large base64 urls.
|
|
251
323
|
"sync/lipsync-2": {
|
|
252
324
|
video: "video",
|
|
253
325
|
audio: "audio",
|
|
254
326
|
},
|
|
255
327
|
*/
|
|
256
|
-
/* NOTE: This model does not work
|
|
328
|
+
/* NOTE: This model does not work with base64 data URIs (error 1201).
|
|
257
329
|
"kwaivgi/kling-lip-sync": {
|
|
330
|
+
identifier: "kwaivgi/kling-lip-sync:8311467f07043d4b3feb44584d2586bfa2fc70203eca612ed26f84d0b55df3ce",
|
|
258
331
|
video: "video_url",
|
|
259
332
|
audio: "audio_file",
|
|
260
333
|
},
|
package/lib/types/schema.d.ts
CHANGED
|
@@ -3299,6 +3299,7 @@ export declare const mulmoImageParamsSchema: z.ZodObject<{
|
|
|
3299
3299
|
}>>;
|
|
3300
3300
|
opacity: z.ZodOptional<z.ZodNumber>;
|
|
3301
3301
|
}, z.core.$strip>]>>>;
|
|
3302
|
+
concurrency: z.ZodOptional<z.ZodNumber>;
|
|
3302
3303
|
}, z.core.$strict>;
|
|
3303
3304
|
export declare const textSlideParamsSchema: z.ZodObject<{
|
|
3304
3305
|
cssStyles: z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>;
|
|
@@ -3370,7 +3371,7 @@ export declare const mulmoSlideParamsSchema: z.ZodObject<{
|
|
|
3370
3371
|
}, z.core.$strict>;
|
|
3371
3372
|
export declare const beatAudioParamsSchema: z.ZodObject<{
|
|
3372
3373
|
padding: z.ZodOptional<z.ZodNumber>;
|
|
3373
|
-
movieVolume: z.
|
|
3374
|
+
movieVolume: z.ZodOptional<z.ZodNumber>;
|
|
3374
3375
|
}, z.core.$strict>;
|
|
3375
3376
|
export declare const mulmoHtmlImageParamsSchema: z.ZodObject<{
|
|
3376
3377
|
model: z.ZodOptional<z.ZodString>;
|
|
@@ -3393,6 +3394,12 @@ export declare const audioParamsSchema: z.ZodObject<{
|
|
|
3393
3394
|
bgmVolume: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
3394
3395
|
audioVolume: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
3395
3396
|
suppressSpeech: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
3397
|
+
movieVolume: z.ZodOptional<z.ZodNumber>;
|
|
3398
|
+
ttsVolume: z.ZodOptional<z.ZodNumber>;
|
|
3399
|
+
ducking: z.ZodOptional<z.ZodObject<{
|
|
3400
|
+
ratio: z.ZodOptional<z.ZodNumber>;
|
|
3401
|
+
}, z.core.$strip>>;
|
|
3402
|
+
concurrency: z.ZodOptional<z.ZodNumber>;
|
|
3396
3403
|
}, z.core.$strict>;
|
|
3397
3404
|
export declare const htmlPromptParamsSchema: z.ZodObject<{
|
|
3398
3405
|
systemPrompt: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
@@ -3683,6 +3690,7 @@ export declare const mulmoMovieParamsSchema: z.ZodObject<{
|
|
|
3683
3690
|
STYLE: "STYLE";
|
|
3684
3691
|
}>;
|
|
3685
3692
|
}, z.core.$strip>>>;
|
|
3693
|
+
concurrency: z.ZodOptional<z.ZodNumber>;
|
|
3686
3694
|
}, z.core.$strip>;
|
|
3687
3695
|
export declare const mulmoBeatSchema: z.ZodObject<{
|
|
3688
3696
|
speaker: z.ZodOptional<z.ZodString>;
|
|
@@ -6336,7 +6344,7 @@ export declare const mulmoBeatSchema: z.ZodObject<{
|
|
|
6336
6344
|
}, z.core.$strict>>;
|
|
6337
6345
|
audioParams: z.ZodOptional<z.ZodObject<{
|
|
6338
6346
|
padding: z.ZodOptional<z.ZodNumber>;
|
|
6339
|
-
movieVolume: z.
|
|
6347
|
+
movieVolume: z.ZodOptional<z.ZodNumber>;
|
|
6340
6348
|
}, z.core.$strict>>;
|
|
6341
6349
|
movieParams: z.ZodOptional<z.ZodObject<{
|
|
6342
6350
|
provider: z.ZodOptional<z.ZodEnum<{
|
|
@@ -6576,6 +6584,7 @@ export declare const mulmoBeatSchema: z.ZodObject<{
|
|
|
6576
6584
|
STYLE: "STYLE";
|
|
6577
6585
|
}>;
|
|
6578
6586
|
}, z.core.$strip>>>;
|
|
6587
|
+
concurrency: z.ZodOptional<z.ZodNumber>;
|
|
6579
6588
|
speed: z.ZodOptional<z.ZodNumber>;
|
|
6580
6589
|
}, z.core.$strip>>;
|
|
6581
6590
|
soundEffectParams: z.ZodOptional<z.ZodObject<{
|
|
@@ -6824,6 +6833,7 @@ export declare const mulmoPresentationStyleSchema: z.ZodObject<{
|
|
|
6824
6833
|
}>>;
|
|
6825
6834
|
opacity: z.ZodOptional<z.ZodNumber>;
|
|
6826
6835
|
}, z.core.$strip>]>>>;
|
|
6836
|
+
concurrency: z.ZodOptional<z.ZodNumber>;
|
|
6827
6837
|
}, z.core.$strict>>>;
|
|
6828
6838
|
movieParams: z.ZodDefault<z.ZodOptional<z.ZodObject<{
|
|
6829
6839
|
provider: z.ZodOptional<z.ZodEnum<{
|
|
@@ -7063,6 +7073,7 @@ export declare const mulmoPresentationStyleSchema: z.ZodObject<{
|
|
|
7063
7073
|
STYLE: "STYLE";
|
|
7064
7074
|
}>;
|
|
7065
7075
|
}, z.core.$strip>>>;
|
|
7076
|
+
concurrency: z.ZodOptional<z.ZodNumber>;
|
|
7066
7077
|
}, z.core.$strip>>>;
|
|
7067
7078
|
soundEffectParams: z.ZodDefault<z.ZodOptional<z.ZodObject<{
|
|
7068
7079
|
provider: z.ZodOptional<z.ZodDefault<z.ZodEnum<{
|
|
@@ -7181,6 +7192,12 @@ export declare const mulmoPresentationStyleSchema: z.ZodObject<{
|
|
|
7181
7192
|
bgmVolume: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
7182
7193
|
audioVolume: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
7183
7194
|
suppressSpeech: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
7195
|
+
movieVolume: z.ZodOptional<z.ZodNumber>;
|
|
7196
|
+
ttsVolume: z.ZodOptional<z.ZodNumber>;
|
|
7197
|
+
ducking: z.ZodOptional<z.ZodObject<{
|
|
7198
|
+
ratio: z.ZodOptional<z.ZodNumber>;
|
|
7199
|
+
}, z.core.$strip>>;
|
|
7200
|
+
concurrency: z.ZodOptional<z.ZodNumber>;
|
|
7184
7201
|
}, z.core.$strict>>;
|
|
7185
7202
|
}, z.core.$strip>;
|
|
7186
7203
|
export declare const mulmoReferenceSchema: z.ZodObject<{
|
|
@@ -7320,6 +7337,7 @@ export declare const mulmoScriptSchema: z.ZodObject<{
|
|
|
7320
7337
|
}>>;
|
|
7321
7338
|
opacity: z.ZodOptional<z.ZodNumber>;
|
|
7322
7339
|
}, z.core.$strip>]>>>;
|
|
7340
|
+
concurrency: z.ZodOptional<z.ZodNumber>;
|
|
7323
7341
|
}, z.core.$strict>>>;
|
|
7324
7342
|
movieParams: z.ZodDefault<z.ZodOptional<z.ZodObject<{
|
|
7325
7343
|
provider: z.ZodOptional<z.ZodEnum<{
|
|
@@ -7559,6 +7577,7 @@ export declare const mulmoScriptSchema: z.ZodObject<{
|
|
|
7559
7577
|
STYLE: "STYLE";
|
|
7560
7578
|
}>;
|
|
7561
7579
|
}, z.core.$strip>>>;
|
|
7580
|
+
concurrency: z.ZodOptional<z.ZodNumber>;
|
|
7562
7581
|
}, z.core.$strip>>>;
|
|
7563
7582
|
soundEffectParams: z.ZodDefault<z.ZodOptional<z.ZodObject<{
|
|
7564
7583
|
provider: z.ZodOptional<z.ZodDefault<z.ZodEnum<{
|
|
@@ -7677,6 +7696,12 @@ export declare const mulmoScriptSchema: z.ZodObject<{
|
|
|
7677
7696
|
bgmVolume: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
7678
7697
|
audioVolume: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
7679
7698
|
suppressSpeech: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
7699
|
+
movieVolume: z.ZodOptional<z.ZodNumber>;
|
|
7700
|
+
ttsVolume: z.ZodOptional<z.ZodNumber>;
|
|
7701
|
+
ducking: z.ZodOptional<z.ZodObject<{
|
|
7702
|
+
ratio: z.ZodOptional<z.ZodNumber>;
|
|
7703
|
+
}, z.core.$strip>>;
|
|
7704
|
+
concurrency: z.ZodOptional<z.ZodNumber>;
|
|
7680
7705
|
}, z.core.$strict>>;
|
|
7681
7706
|
title: z.ZodOptional<z.ZodString>;
|
|
7682
7707
|
description: z.ZodOptional<z.ZodString>;
|
|
@@ -10345,7 +10370,7 @@ export declare const mulmoScriptSchema: z.ZodObject<{
|
|
|
10345
10370
|
}, z.core.$strict>>;
|
|
10346
10371
|
audioParams: z.ZodOptional<z.ZodObject<{
|
|
10347
10372
|
padding: z.ZodOptional<z.ZodNumber>;
|
|
10348
|
-
movieVolume: z.
|
|
10373
|
+
movieVolume: z.ZodOptional<z.ZodNumber>;
|
|
10349
10374
|
}, z.core.$strict>>;
|
|
10350
10375
|
movieParams: z.ZodOptional<z.ZodObject<{
|
|
10351
10376
|
provider: z.ZodOptional<z.ZodEnum<{
|
|
@@ -10585,6 +10610,7 @@ export declare const mulmoScriptSchema: z.ZodObject<{
|
|
|
10585
10610
|
STYLE: "STYLE";
|
|
10586
10611
|
}>;
|
|
10587
10612
|
}, z.core.$strip>>>;
|
|
10613
|
+
concurrency: z.ZodOptional<z.ZodNumber>;
|
|
10588
10614
|
speed: z.ZodOptional<z.ZodNumber>;
|
|
10589
10615
|
}, z.core.$strip>>;
|
|
10590
10616
|
soundEffectParams: z.ZodOptional<z.ZodObject<{
|
|
@@ -10908,6 +10934,7 @@ export declare const mulmoStudioSchema: z.ZodObject<{
|
|
|
10908
10934
|
}>>;
|
|
10909
10935
|
opacity: z.ZodOptional<z.ZodNumber>;
|
|
10910
10936
|
}, z.core.$strip>]>>>;
|
|
10937
|
+
concurrency: z.ZodOptional<z.ZodNumber>;
|
|
10911
10938
|
}, z.core.$strict>>>;
|
|
10912
10939
|
movieParams: z.ZodDefault<z.ZodOptional<z.ZodObject<{
|
|
10913
10940
|
provider: z.ZodOptional<z.ZodEnum<{
|
|
@@ -11147,6 +11174,7 @@ export declare const mulmoStudioSchema: z.ZodObject<{
|
|
|
11147
11174
|
STYLE: "STYLE";
|
|
11148
11175
|
}>;
|
|
11149
11176
|
}, z.core.$strip>>>;
|
|
11177
|
+
concurrency: z.ZodOptional<z.ZodNumber>;
|
|
11150
11178
|
}, z.core.$strip>>>;
|
|
11151
11179
|
soundEffectParams: z.ZodDefault<z.ZodOptional<z.ZodObject<{
|
|
11152
11180
|
provider: z.ZodOptional<z.ZodDefault<z.ZodEnum<{
|
|
@@ -11265,6 +11293,12 @@ export declare const mulmoStudioSchema: z.ZodObject<{
|
|
|
11265
11293
|
bgmVolume: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
11266
11294
|
audioVolume: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
11267
11295
|
suppressSpeech: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
11296
|
+
movieVolume: z.ZodOptional<z.ZodNumber>;
|
|
11297
|
+
ttsVolume: z.ZodOptional<z.ZodNumber>;
|
|
11298
|
+
ducking: z.ZodOptional<z.ZodObject<{
|
|
11299
|
+
ratio: z.ZodOptional<z.ZodNumber>;
|
|
11300
|
+
}, z.core.$strip>>;
|
|
11301
|
+
concurrency: z.ZodOptional<z.ZodNumber>;
|
|
11268
11302
|
}, z.core.$strict>>;
|
|
11269
11303
|
title: z.ZodOptional<z.ZodString>;
|
|
11270
11304
|
description: z.ZodOptional<z.ZodString>;
|
|
@@ -13933,7 +13967,7 @@ export declare const mulmoStudioSchema: z.ZodObject<{
|
|
|
13933
13967
|
}, z.core.$strict>>;
|
|
13934
13968
|
audioParams: z.ZodOptional<z.ZodObject<{
|
|
13935
13969
|
padding: z.ZodOptional<z.ZodNumber>;
|
|
13936
|
-
movieVolume: z.
|
|
13970
|
+
movieVolume: z.ZodOptional<z.ZodNumber>;
|
|
13937
13971
|
}, z.core.$strict>>;
|
|
13938
13972
|
movieParams: z.ZodOptional<z.ZodObject<{
|
|
13939
13973
|
provider: z.ZodOptional<z.ZodEnum<{
|
|
@@ -14173,6 +14207,7 @@ export declare const mulmoStudioSchema: z.ZodObject<{
|
|
|
14173
14207
|
STYLE: "STYLE";
|
|
14174
14208
|
}>;
|
|
14175
14209
|
}, z.core.$strip>>>;
|
|
14210
|
+
concurrency: z.ZodOptional<z.ZodNumber>;
|
|
14176
14211
|
speed: z.ZodOptional<z.ZodNumber>;
|
|
14177
14212
|
}, z.core.$strip>>;
|
|
14178
14213
|
soundEffectParams: z.ZodOptional<z.ZodObject<{
|
|
@@ -14432,6 +14467,7 @@ export declare const mulmoPromptTemplateSchema: z.ZodObject<{
|
|
|
14432
14467
|
}>>;
|
|
14433
14468
|
opacity: z.ZodOptional<z.ZodNumber>;
|
|
14434
14469
|
}, z.core.$strip>]>>>;
|
|
14470
|
+
concurrency: z.ZodOptional<z.ZodNumber>;
|
|
14435
14471
|
}, z.core.$strict>>>;
|
|
14436
14472
|
movieParams: z.ZodDefault<z.ZodOptional<z.ZodObject<{
|
|
14437
14473
|
provider: z.ZodOptional<z.ZodEnum<{
|
|
@@ -14671,6 +14707,7 @@ export declare const mulmoPromptTemplateSchema: z.ZodObject<{
|
|
|
14671
14707
|
STYLE: "STYLE";
|
|
14672
14708
|
}>;
|
|
14673
14709
|
}, z.core.$strip>>>;
|
|
14710
|
+
concurrency: z.ZodOptional<z.ZodNumber>;
|
|
14674
14711
|
}, z.core.$strip>>>;
|
|
14675
14712
|
soundEffectParams: z.ZodDefault<z.ZodOptional<z.ZodObject<{
|
|
14676
14713
|
provider: z.ZodOptional<z.ZodDefault<z.ZodEnum<{
|
|
@@ -14789,6 +14826,12 @@ export declare const mulmoPromptTemplateSchema: z.ZodObject<{
|
|
|
14789
14826
|
bgmVolume: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
14790
14827
|
audioVolume: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
14791
14828
|
suppressSpeech: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
14829
|
+
movieVolume: z.ZodOptional<z.ZodNumber>;
|
|
14830
|
+
ttsVolume: z.ZodOptional<z.ZodNumber>;
|
|
14831
|
+
ducking: z.ZodOptional<z.ZodObject<{
|
|
14832
|
+
ratio: z.ZodOptional<z.ZodNumber>;
|
|
14833
|
+
}, z.core.$strip>>;
|
|
14834
|
+
concurrency: z.ZodOptional<z.ZodNumber>;
|
|
14792
14835
|
}, z.core.$strict>>;
|
|
14793
14836
|
}, z.core.$strip>>;
|
|
14794
14837
|
}, z.core.$strict>;
|
|
@@ -14922,6 +14965,7 @@ export declare const mulmoPromptTemplateFileSchema: z.ZodObject<{
|
|
|
14922
14965
|
}>>;
|
|
14923
14966
|
opacity: z.ZodOptional<z.ZodNumber>;
|
|
14924
14967
|
}, z.core.$strip>]>>>;
|
|
14968
|
+
concurrency: z.ZodOptional<z.ZodNumber>;
|
|
14925
14969
|
}, z.core.$strict>>>;
|
|
14926
14970
|
movieParams: z.ZodDefault<z.ZodOptional<z.ZodObject<{
|
|
14927
14971
|
provider: z.ZodOptional<z.ZodEnum<{
|
|
@@ -15161,6 +15205,7 @@ export declare const mulmoPromptTemplateFileSchema: z.ZodObject<{
|
|
|
15161
15205
|
STYLE: "STYLE";
|
|
15162
15206
|
}>;
|
|
15163
15207
|
}, z.core.$strip>>>;
|
|
15208
|
+
concurrency: z.ZodOptional<z.ZodNumber>;
|
|
15164
15209
|
}, z.core.$strip>>>;
|
|
15165
15210
|
soundEffectParams: z.ZodDefault<z.ZodOptional<z.ZodObject<{
|
|
15166
15211
|
provider: z.ZodOptional<z.ZodDefault<z.ZodEnum<{
|
|
@@ -15279,6 +15324,12 @@ export declare const mulmoPromptTemplateFileSchema: z.ZodObject<{
|
|
|
15279
15324
|
bgmVolume: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
15280
15325
|
audioVolume: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
15281
15326
|
suppressSpeech: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
15327
|
+
movieVolume: z.ZodOptional<z.ZodNumber>;
|
|
15328
|
+
ttsVolume: z.ZodOptional<z.ZodNumber>;
|
|
15329
|
+
ducking: z.ZodOptional<z.ZodObject<{
|
|
15330
|
+
ratio: z.ZodOptional<z.ZodNumber>;
|
|
15331
|
+
}, z.core.$strip>>;
|
|
15332
|
+
concurrency: z.ZodOptional<z.ZodNumber>;
|
|
15282
15333
|
}, z.core.$strict>>;
|
|
15283
15334
|
}, z.core.$strip>>;
|
|
15284
15335
|
filename: z.ZodString;
|
package/lib/types/schema.js
CHANGED
|
@@ -393,6 +393,7 @@ export const mulmoImageParamsSchema = mulmoBeatImageParamsSchema
|
|
|
393
393
|
.extend({
|
|
394
394
|
images: mulmoImageParamsImagesSchema.optional(),
|
|
395
395
|
backgroundImage: backgroundImageSchema,
|
|
396
|
+
concurrency: z.number().int().positive().optional().describe("Max concurrent image generation requests"),
|
|
396
397
|
})
|
|
397
398
|
.strict();
|
|
398
399
|
export const textSlideParamsSchema = z
|
|
@@ -409,7 +410,7 @@ export const mulmoSlideParamsSchema = z
|
|
|
409
410
|
export const beatAudioParamsSchema = z
|
|
410
411
|
.object({
|
|
411
412
|
padding: z.number().optional().describe("Padding between beats"), // seconds
|
|
412
|
-
movieVolume: z.number().
|
|
413
|
+
movieVolume: z.number().min(0).max(1).optional().describe("Audio volume of the imported or generated movie"),
|
|
413
414
|
})
|
|
414
415
|
.strict();
|
|
415
416
|
export const mulmoHtmlImageParamsSchema = z
|
|
@@ -428,6 +429,15 @@ export const audioParamsSchema = z
|
|
|
428
429
|
bgmVolume: z.number().optional().default(0.2).describe("Volume of the background music"),
|
|
429
430
|
audioVolume: z.number().optional().default(1.0).describe("Volume of the audio"),
|
|
430
431
|
suppressSpeech: z.boolean().optional().default(false).describe("Suppress speech generation"),
|
|
432
|
+
movieVolume: z.number().min(0).max(1).optional().describe("Default movie audio volume for all beats"),
|
|
433
|
+
ttsVolume: z.number().min(0).max(2).optional().describe("TTS narration volume before mixing with BGM/movie audio"),
|
|
434
|
+
ducking: z
|
|
435
|
+
.object({
|
|
436
|
+
ratio: z.number().min(0).max(1).optional().describe("Movie volume ratio during TTS beats (default 0.3)"),
|
|
437
|
+
})
|
|
438
|
+
.optional()
|
|
439
|
+
.describe("Auto-reduce movie audio when TTS is playing"),
|
|
440
|
+
concurrency: z.number().int().positive().optional().describe("Max concurrent TTS generation requests"),
|
|
431
441
|
})
|
|
432
442
|
.strict();
|
|
433
443
|
export const htmlPromptParamsSchema = z
|
|
@@ -488,6 +498,7 @@ export const mulmoMovieParamsSchema = z.object({
|
|
|
488
498
|
.array(movieReferenceImageSchema)
|
|
489
499
|
.optional()
|
|
490
500
|
.describe("Style/asset reference images (Veo 3.1). Mutually exclusive with imageName/lastFrameImageName"),
|
|
501
|
+
concurrency: z.number().int().positive().optional().describe("Max concurrent movie generation requests"),
|
|
491
502
|
});
|
|
492
503
|
export const mulmoBeatSchema = z
|
|
493
504
|
.object({
|
package/lib/utils/context.d.ts
CHANGED
|
@@ -115,6 +115,7 @@ export declare const createStudioData: (_mulmoScript: MulmoScript, fileName: str
|
|
|
115
115
|
size?: "contain" | "cover" | "fill" | "auto" | undefined;
|
|
116
116
|
opacity?: number | undefined;
|
|
117
117
|
} | null | undefined;
|
|
118
|
+
concurrency?: number | undefined;
|
|
118
119
|
};
|
|
119
120
|
movieParams: {
|
|
120
121
|
provider?: string | undefined;
|
|
@@ -280,6 +281,7 @@ export declare const createStudioData: (_mulmoScript: MulmoScript, fileName: str
|
|
|
280
281
|
imageName: string;
|
|
281
282
|
referenceType: "ASSET" | "STYLE";
|
|
282
283
|
}[] | undefined;
|
|
284
|
+
concurrency?: number | undefined;
|
|
283
285
|
};
|
|
284
286
|
soundEffectParams: {
|
|
285
287
|
provider?: string | undefined;
|
|
@@ -303,6 +305,12 @@ export declare const createStudioData: (_mulmoScript: MulmoScript, fileName: str
|
|
|
303
305
|
kind: "path";
|
|
304
306
|
path: string;
|
|
305
307
|
} | undefined;
|
|
308
|
+
movieVolume?: number | undefined;
|
|
309
|
+
ttsVolume?: number | undefined;
|
|
310
|
+
ducking?: {
|
|
311
|
+
ratio?: number | undefined;
|
|
312
|
+
} | undefined;
|
|
313
|
+
concurrency?: number | undefined;
|
|
306
314
|
};
|
|
307
315
|
lang: string;
|
|
308
316
|
beats: {
|
|
@@ -1846,8 +1854,8 @@ export declare const createStudioData: (_mulmoScript: MulmoScript, fileName: str
|
|
|
1846
1854
|
vertexai_location?: string | undefined;
|
|
1847
1855
|
} | undefined;
|
|
1848
1856
|
audioParams?: {
|
|
1849
|
-
movieVolume: number;
|
|
1850
1857
|
padding?: number | undefined;
|
|
1858
|
+
movieVolume?: number | undefined;
|
|
1851
1859
|
} | undefined;
|
|
1852
1860
|
movieParams?: {
|
|
1853
1861
|
provider?: string | undefined;
|
|
@@ -2013,6 +2021,7 @@ export declare const createStudioData: (_mulmoScript: MulmoScript, fileName: str
|
|
|
2013
2021
|
imageName: string;
|
|
2014
2022
|
referenceType: "ASSET" | "STYLE";
|
|
2015
2023
|
}[] | undefined;
|
|
2024
|
+
concurrency?: number | undefined;
|
|
2016
2025
|
speed?: number | undefined;
|
|
2017
2026
|
} | undefined;
|
|
2018
2027
|
soundEffectParams?: {
|
|
@@ -2342,6 +2351,7 @@ export declare const initializeContextFromFiles: (files: FileObject, raiseError:
|
|
|
2342
2351
|
size?: "contain" | "cover" | "fill" | "auto" | undefined;
|
|
2343
2352
|
opacity?: number | undefined;
|
|
2344
2353
|
} | null | undefined;
|
|
2354
|
+
concurrency?: number | undefined;
|
|
2345
2355
|
};
|
|
2346
2356
|
movieParams: {
|
|
2347
2357
|
provider?: string | undefined;
|
|
@@ -2507,6 +2517,7 @@ export declare const initializeContextFromFiles: (files: FileObject, raiseError:
|
|
|
2507
2517
|
imageName: string;
|
|
2508
2518
|
referenceType: "ASSET" | "STYLE";
|
|
2509
2519
|
}[] | undefined;
|
|
2520
|
+
concurrency?: number | undefined;
|
|
2510
2521
|
};
|
|
2511
2522
|
soundEffectParams: {
|
|
2512
2523
|
provider?: string | undefined;
|
|
@@ -2530,6 +2541,12 @@ export declare const initializeContextFromFiles: (files: FileObject, raiseError:
|
|
|
2530
2541
|
kind: "path";
|
|
2531
2542
|
path: string;
|
|
2532
2543
|
} | undefined;
|
|
2544
|
+
movieVolume?: number | undefined;
|
|
2545
|
+
ttsVolume?: number | undefined;
|
|
2546
|
+
ducking?: {
|
|
2547
|
+
ratio?: number | undefined;
|
|
2548
|
+
} | undefined;
|
|
2549
|
+
concurrency?: number | undefined;
|
|
2533
2550
|
};
|
|
2534
2551
|
lang: string;
|
|
2535
2552
|
beats: {
|
|
@@ -4073,8 +4090,8 @@ export declare const initializeContextFromFiles: (files: FileObject, raiseError:
|
|
|
4073
4090
|
vertexai_location?: string | undefined;
|
|
4074
4091
|
} | undefined;
|
|
4075
4092
|
audioParams?: {
|
|
4076
|
-
movieVolume: number;
|
|
4077
4093
|
padding?: number | undefined;
|
|
4094
|
+
movieVolume?: number | undefined;
|
|
4078
4095
|
} | undefined;
|
|
4079
4096
|
movieParams?: {
|
|
4080
4097
|
provider?: string | undefined;
|
|
@@ -4240,6 +4257,7 @@ export declare const initializeContextFromFiles: (files: FileObject, raiseError:
|
|
|
4240
4257
|
imageName: string;
|
|
4241
4258
|
referenceType: "ASSET" | "STYLE";
|
|
4242
4259
|
}[] | undefined;
|
|
4260
|
+
concurrency?: number | undefined;
|
|
4243
4261
|
speed?: number | undefined;
|
|
4244
4262
|
} | undefined;
|
|
4245
4263
|
soundEffectParams?: {
|
|
@@ -4576,6 +4594,7 @@ export declare const initializeContextFromFiles: (files: FileObject, raiseError:
|
|
|
4576
4594
|
size?: "contain" | "cover" | "fill" | "auto" | undefined;
|
|
4577
4595
|
opacity?: number | undefined;
|
|
4578
4596
|
} | null | undefined;
|
|
4597
|
+
concurrency?: number | undefined;
|
|
4579
4598
|
};
|
|
4580
4599
|
movieParams: {
|
|
4581
4600
|
provider?: string | undefined;
|
|
@@ -4741,6 +4760,7 @@ export declare const initializeContextFromFiles: (files: FileObject, raiseError:
|
|
|
4741
4760
|
imageName: string;
|
|
4742
4761
|
referenceType: "ASSET" | "STYLE";
|
|
4743
4762
|
}[] | undefined;
|
|
4763
|
+
concurrency?: number | undefined;
|
|
4744
4764
|
};
|
|
4745
4765
|
soundEffectParams: {
|
|
4746
4766
|
provider?: string | undefined;
|
|
@@ -4764,6 +4784,12 @@ export declare const initializeContextFromFiles: (files: FileObject, raiseError:
|
|
|
4764
4784
|
kind: "path";
|
|
4765
4785
|
path: string;
|
|
4766
4786
|
} | undefined;
|
|
4787
|
+
movieVolume?: number | undefined;
|
|
4788
|
+
ttsVolume?: number | undefined;
|
|
4789
|
+
ducking?: {
|
|
4790
|
+
ratio?: number | undefined;
|
|
4791
|
+
} | undefined;
|
|
4792
|
+
concurrency?: number | undefined;
|
|
4767
4793
|
};
|
|
4768
4794
|
lipSyncParams?: {
|
|
4769
4795
|
provider?: string | undefined;
|
|
@@ -15,6 +15,11 @@ export declare const resolveMovieRefs: (html: string, movieRefs: Record<string,
|
|
|
15
15
|
* Paths starting with http://, https://, file://, data:, image:, or / are left unchanged.
|
|
16
16
|
*/
|
|
17
17
|
export declare const resolveRelativeImagePaths: (html: string, baseDirPath: string) => string;
|
|
18
|
+
/**
|
|
19
|
+
* Resolve relative modelUrl assignment in user scripts to file:// absolute paths.
|
|
20
|
+
* e.g. const modelUrl = "models/a.glb" -> const modelUrl = "file:///abs/models/a.glb"
|
|
21
|
+
*/
|
|
22
|
+
export declare const resolveRelativeModelPathsInScript: (html: string, baseDirPath: string) => string;
|
|
18
23
|
export declare const process: (params: ImageProcessorParams) => Promise<string | undefined>;
|
|
19
24
|
export declare const path: (params: ImageProcessorParams) => string;
|
|
20
25
|
export declare const html: (params: ImageProcessorParams) => Promise<string | undefined>;
|
|
@@ -38,8 +38,16 @@ export const resolveMovieRefs = (html, movieRefs) => {
|
|
|
38
38
|
* Paths starting with http://, https://, file://, data:, image:, or / are left unchanged.
|
|
39
39
|
*/
|
|
40
40
|
export const resolveRelativeImagePaths = (html, baseDirPath) => {
|
|
41
|
-
return html.replace(/(\bsrc\s*=\s*)(["'])(
|
|
42
|
-
const
|
|
41
|
+
return html.replace(/(\bsrc\s*=\s*)(["'])([^"']+)\2/gi, (_, prefix, quote, pathValue) => {
|
|
42
|
+
const isAbsoluteLike = pathValue.startsWith("http://") ||
|
|
43
|
+
pathValue.startsWith("https://") ||
|
|
44
|
+
pathValue.startsWith("file://") ||
|
|
45
|
+
pathValue.startsWith("data:") ||
|
|
46
|
+
pathValue.startsWith("image:") ||
|
|
47
|
+
pathValue.startsWith("/");
|
|
48
|
+
if (isAbsoluteLike)
|
|
49
|
+
return `${prefix}${quote}${pathValue}${quote}`;
|
|
50
|
+
const absolutePath = nodePath.resolve(baseDirPath, pathValue);
|
|
43
51
|
return `${prefix}${quote}file://${absolutePath}${quote}`;
|
|
44
52
|
});
|
|
45
53
|
};
|
|
@@ -52,7 +60,48 @@ const buildUserScript = (script) => {
|
|
|
52
60
|
if (!script)
|
|
53
61
|
return "";
|
|
54
62
|
const code = Array.isArray(script) ? script.join("\n") : script;
|
|
55
|
-
|
|
63
|
+
// If user script contains ESM import/export, emit module script so imports work.
|
|
64
|
+
const isModule = code.split("\n").some((line) => {
|
|
65
|
+
const trimmed = line.trimStart();
|
|
66
|
+
return trimmed.startsWith("import ") || trimmed.startsWith("export ");
|
|
67
|
+
});
|
|
68
|
+
return isModule ? `<script type="module">\n${code}\n</script>` : `<script>\n${code}\n</script>`;
|
|
69
|
+
};
|
|
70
|
+
/**
|
|
71
|
+
* Resolve relative modelUrl assignment in user scripts to file:// absolute paths.
|
|
72
|
+
* e.g. const modelUrl = "models/a.glb" -> const modelUrl = "file:///abs/models/a.glb"
|
|
73
|
+
*/
|
|
74
|
+
export const resolveRelativeModelPathsInScript = (html, baseDirPath) => {
|
|
75
|
+
const lines = html.split("\n");
|
|
76
|
+
return lines
|
|
77
|
+
.map((line) => {
|
|
78
|
+
const hasModelDeclaration = line.includes("modelUrl") && (line.includes("const ") || line.includes("let ") || line.includes("var "));
|
|
79
|
+
if (!hasModelDeclaration || !line.includes("="))
|
|
80
|
+
return line;
|
|
81
|
+
const eqIndex = line.indexOf("=");
|
|
82
|
+
const afterEq = line.slice(eqIndex + 1);
|
|
83
|
+
const singleQuoteIndex = afterEq.indexOf("'");
|
|
84
|
+
const doubleQuoteIndex = afterEq.indexOf('"');
|
|
85
|
+
const quoteIndex = singleQuoteIndex >= 0 && (doubleQuoteIndex < 0 || singleQuoteIndex < doubleQuoteIndex) ? singleQuoteIndex : doubleQuoteIndex;
|
|
86
|
+
if (quoteIndex < 0)
|
|
87
|
+
return line;
|
|
88
|
+
const quoteChar = afterEq[quoteIndex];
|
|
89
|
+
const start = eqIndex + 1 + quoteIndex;
|
|
90
|
+
const end = line.indexOf(quoteChar, start + 1);
|
|
91
|
+
if (end < 0)
|
|
92
|
+
return line;
|
|
93
|
+
const rawPath = line.slice(start + 1, end);
|
|
94
|
+
const isAbsoluteLike = rawPath.startsWith("http://") ||
|
|
95
|
+
rawPath.startsWith("https://") ||
|
|
96
|
+
rawPath.startsWith("file://") ||
|
|
97
|
+
rawPath.startsWith("data:") ||
|
|
98
|
+
rawPath.startsWith("/");
|
|
99
|
+
if (isAbsoluteLike)
|
|
100
|
+
return line;
|
|
101
|
+
const absolutePath = nodePath.resolve(baseDirPath, rawPath);
|
|
102
|
+
return `${line.slice(0, start + 1)}file://${absolutePath}${line.slice(end)}`;
|
|
103
|
+
})
|
|
104
|
+
.join("\n");
|
|
56
105
|
};
|
|
57
106
|
/**
|
|
58
107
|
* Resolve HTML and script from beat image data.
|
|
@@ -106,7 +155,8 @@ const buildAnimatedHtml = (params, totalFrames, fps) => {
|
|
|
106
155
|
});
|
|
107
156
|
const resolvedImageRefs = resolveImageRefs(rawHtmlData, params.imageRefs ?? {});
|
|
108
157
|
const resolvedAllRefs = resolveMovieRefs(resolvedImageRefs, params.movieRefs ?? {});
|
|
109
|
-
|
|
158
|
+
const resolvedImages = resolveRelativeImagePaths(resolvedAllRefs, context.fileDirs.mulmoFileDirPath);
|
|
159
|
+
return resolveRelativeModelPathsInScript(resolvedImages, context.fileDirs.mulmoFileDirPath);
|
|
110
160
|
};
|
|
111
161
|
const processHtmlTailwindAnimated = async (params) => {
|
|
112
162
|
const { beat, imagePath, canvasSize } = params;
|
|
@@ -163,7 +213,8 @@ const processHtmlTailwindStatic = async (params) => {
|
|
|
163
213
|
});
|
|
164
214
|
const resolvedImageRefs = resolveImageRefs(rawHtmlData, params.imageRefs ?? {});
|
|
165
215
|
const resolvedAllRefs = resolveMovieRefs(resolvedImageRefs, params.movieRefs ?? {});
|
|
166
|
-
const
|
|
216
|
+
const resolvedImages = resolveRelativeImagePaths(resolvedAllRefs, context.fileDirs.mulmoFileDirPath);
|
|
217
|
+
const htmlData = resolveRelativeModelPathsInScript(resolvedImages, context.fileDirs.mulmoFileDirPath);
|
|
167
218
|
await renderHTMLToImage(htmlData, imagePath, canvasSize.width, canvasSize.height);
|
|
168
219
|
return imagePath;
|
|
169
220
|
};
|