mulmocast 0.0.9 → 0.0.10
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/assets/templates/akira_comic.json +2 -2
- package/assets/templates/drslump_comic.json +2 -2
- package/assets/templates/ghibli_comic.json +2 -2
- package/assets/templates/ghost_comic.json +2 -2
- package/assets/templates/onepiece_comic.json +2 -2
- package/assets/templates/portrait_movie.json +28 -0
- package/assets/templates/realistic_movie.json +28 -0
- package/lib/actions/audio.js +2 -2
- package/lib/actions/captions.js +2 -2
- package/lib/actions/images.js +53 -10
- package/lib/actions/movie.js +2 -2
- package/lib/actions/translate.js +2 -2
- package/lib/agents/image_openai_agent.js +1 -1
- package/lib/agents/movie_google_agent.d.ts +17 -0
- package/lib/agents/movie_google_agent.js +114 -0
- package/lib/cli/bin.js +12 -0
- package/lib/methods/mulmo_studio.d.ts +1 -1
- package/lib/tools/create_mulmo_script_from_url.js +2 -2
- package/lib/tools/create_mulmo_script_interactively.js +2 -2
- package/lib/tools/story_to_script.js +2 -2
- package/lib/types/schema.d.ts +134 -0
- package/lib/types/schema.js +13 -1
- package/lib/types/type.d.ts +3 -1
- package/lib/utils/preprocess.d.ts +7 -0
- package/lib/utils/utils.d.ts +1 -0
- package/lib/utils/utils.js +3 -0
- package/package.json +1 -1
- package/scripts/templates/movie_prompts_template.json +50 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
|
-
"title": "
|
|
3
|
-
"description": "Template for
|
|
2
|
+
"title": "Akira style",
|
|
3
|
+
"description": "Template for Akira style comic presentation.",
|
|
4
4
|
"systemPrompt": "Generate a script for a presentation of the given topic. Another AI will generate images for each beat based on the image prompt of that beat. Mention the reference in one of beats, if it exists. Use the JSON below as a template.",
|
|
5
5
|
"presentationStyle": {
|
|
6
6
|
"$mulmocast": {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
|
-
"title": "Dr. Slump Style
|
|
3
|
-
"description": "Template for Dr. Slump
|
|
2
|
+
"title": "Dr. Slump Style",
|
|
3
|
+
"description": "Template for Dr. Slump style comic presentation.",
|
|
4
4
|
"systemPrompt": "Generate a script for a presentation of the given topic. Another AI will generate images for each beat based on the image prompt of that beat. Mention the reference in one of beats, if it exists. Use the JSON below as a template.",
|
|
5
5
|
"presentationStyle": {
|
|
6
6
|
"$mulmocast": {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
|
-
"title": "
|
|
3
|
-
"description": "Template for
|
|
2
|
+
"title": "Ghibli comic style",
|
|
3
|
+
"description": "Template for Ghibli-style comic presentation.",
|
|
4
4
|
"systemPrompt": "Generate a script for a presentation of the given topic. Another AI will generate comic strips for each beat based on the text description of that beat. Mention the reference in one of beats, if it exists. Use the JSON below as a template.",
|
|
5
5
|
"presentationStyle": {
|
|
6
6
|
"$mulmocast": {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
|
-
"title": "
|
|
3
|
-
"description": "Template for
|
|
2
|
+
"title": "Ghost in the shell style",
|
|
3
|
+
"description": "Template for Ghost in the shell style comic presentation.",
|
|
4
4
|
"systemPrompt": "Generate a script for a presentation of the given topic. Another AI will generate images for each beat based on the image prompt of that beat. Mention the reference in one of beats, if it exists. Use the JSON below as a template.",
|
|
5
5
|
"presentationStyle": {
|
|
6
6
|
"$mulmocast": {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
|
-
"title": "
|
|
3
|
-
"description": "Template for
|
|
2
|
+
"title": "One Piece style",
|
|
3
|
+
"description": "Template for One Piece style comic presentation.",
|
|
4
4
|
"systemPrompt": "Generate a script for a presentation of the given topic. Another AI will generate images for each beat based on the image prompt of that beat. Mention the reference in one of beats, if it exists. Use the JSON below as a template.",
|
|
5
5
|
"presentationStyle": {
|
|
6
6
|
"$mulmocast": {
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
{
|
|
2
|
+
"title": "Photo realistic movie (portrait)",
|
|
3
|
+
"description": "Template for photo realistic movie in portrait mode.",
|
|
4
|
+
"systemPrompt": "Generate a script for a presentation of the given topic. Another AI will generate images for each beat based on the image prompt of that beat. Movie prompts must be written in English. Mention the reference in one of beats, if it exists. Use the JSON below as a template.",
|
|
5
|
+
"presentationStyle": {
|
|
6
|
+
"$mulmocast": {
|
|
7
|
+
"version": "1.0",
|
|
8
|
+
"credit": "closing"
|
|
9
|
+
},
|
|
10
|
+
"canvasSize": {
|
|
11
|
+
"width": 1024,
|
|
12
|
+
"height": 1536
|
|
13
|
+
},
|
|
14
|
+
"imageParams": {
|
|
15
|
+
"style": "<style>Photo realistic, cinematic.</style>",
|
|
16
|
+
"images": {
|
|
17
|
+
"presenter": {
|
|
18
|
+
"type": "image",
|
|
19
|
+
"source": {
|
|
20
|
+
"kind": "url",
|
|
21
|
+
"url": "https://raw.githubusercontent.com/receptron/mulmocast-media/refs/heads/main/characters/female_presenter.png"
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
"scriptName": "movie_prompts_template.json"
|
|
28
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
{
|
|
2
|
+
"title": "Photo realistic movie template",
|
|
3
|
+
"description": "Template for photo realistic movie.",
|
|
4
|
+
"systemPrompt": "Generate a script for a presentation of the given topic. Another AI will generate images for each beat based on the image prompt of that beat. Movie prompts must be written in English. Mention the reference in one of beats, if it exists. Use the JSON below as a template.",
|
|
5
|
+
"presentationStyle": {
|
|
6
|
+
"$mulmocast": {
|
|
7
|
+
"version": "1.0",
|
|
8
|
+
"credit": "closing"
|
|
9
|
+
},
|
|
10
|
+
"canvasSize": {
|
|
11
|
+
"width": 1536,
|
|
12
|
+
"height": 1024
|
|
13
|
+
},
|
|
14
|
+
"imageParams": {
|
|
15
|
+
"style": "<style>Photo realistic, cinematic.</style>",
|
|
16
|
+
"images": {
|
|
17
|
+
"presenter": {
|
|
18
|
+
"type": "image",
|
|
19
|
+
"source": {
|
|
20
|
+
"kind": "url",
|
|
21
|
+
"url": "https://raw.githubusercontent.com/receptron/mulmocast-media/refs/heads/main/characters/female_presenter.png"
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
"scriptName": "movie_prompts_template.json"
|
|
28
|
+
}
|
package/lib/actions/audio.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import "dotenv/config";
|
|
2
2
|
import { GraphAI } from "graphai";
|
|
3
|
-
import
|
|
3
|
+
import * as agents from "@graphai/vanilla";
|
|
4
4
|
import ttsNijivoiceAgent from "../agents/tts_nijivoice_agent.js";
|
|
5
5
|
import addBGMAgent from "../agents/add_bgm_agent.js";
|
|
6
6
|
import combineAudioFilesAgent from "../agents/combine_audio_files_agent.js";
|
|
@@ -12,7 +12,7 @@ import { fileCacheAgentFilter } from "../utils/filters.js";
|
|
|
12
12
|
import { getAudioArtifactFilePath, getAudioSegmentDirPath, getAudioCombinedFilePath, getOutputStudioFilePath, defaultBGMPath, mkdir, writingMessage, getAudioSegmentFilePath, resolveMediaSource, } from "../utils/file.js";
|
|
13
13
|
import { text2hash, localizedText } from "../utils/utils.js";
|
|
14
14
|
import { MulmoStudioMethods } from "../methods/mulmo_studio.js";
|
|
15
|
-
|
|
15
|
+
const vanillaAgents = agents.default ?? agents;
|
|
16
16
|
// const rion_takanashi_voice = "b9277ce3-ba1c-4f6f-9a65-c05ca102ded0"; // たかなし りおん
|
|
17
17
|
// const ben_carter_voice = "bc06c63f-fef6-43b6-92f7-67f919bd5dae"; // ベン・カーター
|
|
18
18
|
const provider_to_agent = {
|
package/lib/actions/captions.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { GraphAI, GraphAILogger } from "graphai";
|
|
2
|
-
import
|
|
2
|
+
import * as agents from "@graphai/vanilla";
|
|
3
3
|
import { getHTMLFile } from "../utils/file.js";
|
|
4
4
|
import { renderHTMLToImage, interpolate } from "../utils/markdown.js";
|
|
5
5
|
import { MulmoStudioMethods } from "../methods/mulmo_studio.js";
|
|
6
|
-
|
|
6
|
+
const vanillaAgents = agents.default ?? agents;
|
|
7
7
|
const graph_data = {
|
|
8
8
|
version: 0.5,
|
|
9
9
|
nodes: {
|
package/lib/actions/images.js
CHANGED
|
@@ -1,16 +1,17 @@
|
|
|
1
1
|
import dotenv from "dotenv";
|
|
2
2
|
import fs from "fs";
|
|
3
3
|
import { GraphAI, GraphAILogger } from "graphai";
|
|
4
|
-
import
|
|
4
|
+
import * as agents from "@graphai/vanilla";
|
|
5
5
|
import { fileWriteAgent } from "@graphai/vanilla_node_agents";
|
|
6
6
|
import { getOutputStudioFilePath, mkdir } from "../utils/file.js";
|
|
7
7
|
import { fileCacheAgentFilter } from "../utils/filters.js";
|
|
8
8
|
import imageGoogleAgent from "../agents/image_google_agent.js";
|
|
9
9
|
import imageOpenaiAgent from "../agents/image_openai_agent.js";
|
|
10
|
+
import movieGoogleAgent from "../agents/movie_google_agent.js";
|
|
10
11
|
import { MulmoScriptMethods, MulmoStudioContextMethods } from "../methods/index.js";
|
|
11
12
|
import { imagePlugins } from "../utils/image_plugins/index.js";
|
|
12
13
|
import { imagePrompt } from "../utils/prompt.js";
|
|
13
|
-
|
|
14
|
+
const vanillaAgents = agents.default ?? agents;
|
|
14
15
|
dotenv.config();
|
|
15
16
|
// const openai = new OpenAI();
|
|
16
17
|
import { GoogleAuth } from "google-auth-library";
|
|
@@ -24,6 +25,10 @@ const htmlStyle = (script, beat) => {
|
|
|
24
25
|
const imagePreprocessAgent = async (namedInputs) => {
|
|
25
26
|
const { context, beat, index, suffix, imageDirPath, imageAgentInfo, imageRefs } = namedInputs;
|
|
26
27
|
const imageParams = { ...imageAgentInfo.imageParams, ...beat.imageParams };
|
|
28
|
+
if (!imageParams.size) {
|
|
29
|
+
const canvasSize = MulmoScriptMethods.getCanvasSize(context.studio.script);
|
|
30
|
+
imageParams.size = `${canvasSize.width}x${canvasSize.height}`;
|
|
31
|
+
}
|
|
27
32
|
const imagePath = `${imageDirPath}/${context.studio.filename}/${index}${suffix}.png`;
|
|
28
33
|
const returnValue = {
|
|
29
34
|
aspectRatio: MulmoScriptMethods.getAspectRatio(context.studio.script),
|
|
@@ -111,14 +116,48 @@ const graph_data = {
|
|
|
111
116
|
},
|
|
112
117
|
defaultValue: {},
|
|
113
118
|
},
|
|
119
|
+
prepareMovie: {
|
|
120
|
+
agent: (namedInputs) => {
|
|
121
|
+
const { beat, imageDirPath, index, context } = namedInputs;
|
|
122
|
+
if (beat.moviePrompt) {
|
|
123
|
+
const movieFile = `${imageDirPath}/${context.studio.filename}/${index}.mov`;
|
|
124
|
+
return { movieFile };
|
|
125
|
+
}
|
|
126
|
+
return {};
|
|
127
|
+
},
|
|
128
|
+
inputs: {
|
|
129
|
+
result: ":imageGenerator", // to wait for imageGenerator to finish
|
|
130
|
+
imagePath: ":preprocessor.path",
|
|
131
|
+
beat: ":beat",
|
|
132
|
+
imageDirPath: ":imageDirPath",
|
|
133
|
+
index: ":__mapIndex",
|
|
134
|
+
context: ":context",
|
|
135
|
+
},
|
|
136
|
+
},
|
|
137
|
+
movieGenerator: {
|
|
138
|
+
if: ":prepareMovie.movieFile",
|
|
139
|
+
agent: "movieGoogleAgent",
|
|
140
|
+
inputs: {
|
|
141
|
+
prompt: ":beat.moviePrompt",
|
|
142
|
+
imagePath: ":preprocessor.path",
|
|
143
|
+
file: ":prepareMovie.movieFile",
|
|
144
|
+
studio: ":context.studio", // for cache
|
|
145
|
+
index: ":__mapIndex", // for cache
|
|
146
|
+
sessionType: "movie", // for cache
|
|
147
|
+
params: {
|
|
148
|
+
model: ":context.studio.script.movieParams.model",
|
|
149
|
+
aspectRatio: ":preprocessor.aspectRatio",
|
|
150
|
+
duration: ":beat.duration",
|
|
151
|
+
},
|
|
152
|
+
},
|
|
153
|
+
defaultValue: {},
|
|
154
|
+
},
|
|
114
155
|
output: {
|
|
115
156
|
agent: "copyAgent",
|
|
116
157
|
inputs: {
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
output: {
|
|
121
|
-
imageFile: ".image",
|
|
158
|
+
onComplete: ":movieGenerator",
|
|
159
|
+
imageFile: ":preprocessor.path",
|
|
160
|
+
movieFile: ":prepareMovie.movieFile",
|
|
122
161
|
},
|
|
123
162
|
isResult: true,
|
|
124
163
|
},
|
|
@@ -167,7 +206,7 @@ const generateImages = async (context) => {
|
|
|
167
206
|
{
|
|
168
207
|
name: "fileCacheAgentFilter",
|
|
169
208
|
agent: fileCacheAgentFilter,
|
|
170
|
-
nodeIds: ["imageGenerator"],
|
|
209
|
+
nodeIds: ["imageGenerator", "movieGenerator"],
|
|
171
210
|
},
|
|
172
211
|
];
|
|
173
212
|
const options = {
|
|
@@ -175,7 +214,7 @@ const generateImages = async (context) => {
|
|
|
175
214
|
};
|
|
176
215
|
const imageAgentInfo = MulmoScriptMethods.getImageAgentInfo(studio.script);
|
|
177
216
|
// We need to get google's auth token only if the google is the text2image provider.
|
|
178
|
-
if (imageAgentInfo.provider === "google") {
|
|
217
|
+
if (imageAgentInfo.provider === "google" || studio.script.movieParams?.provider === "google") {
|
|
179
218
|
GraphAILogger.log("google was specified as text2image engine");
|
|
180
219
|
const token = await googleAuth();
|
|
181
220
|
options.config = {
|
|
@@ -183,6 +222,10 @@ const generateImages = async (context) => {
|
|
|
183
222
|
projectId: process.env.GOOGLE_PROJECT_ID,
|
|
184
223
|
token,
|
|
185
224
|
},
|
|
225
|
+
movieGoogleAgent: {
|
|
226
|
+
projectId: process.env.GOOGLE_PROJECT_ID,
|
|
227
|
+
token,
|
|
228
|
+
},
|
|
186
229
|
};
|
|
187
230
|
}
|
|
188
231
|
if (imageAgentInfo.provider === "openai") {
|
|
@@ -219,7 +262,7 @@ const generateImages = async (context) => {
|
|
|
219
262
|
imageDirPath,
|
|
220
263
|
imageRefs,
|
|
221
264
|
};
|
|
222
|
-
const graph = new GraphAI(graph_data, { ...vanillaAgents, imageGoogleAgent, imageOpenaiAgent, fileWriteAgent }, options);
|
|
265
|
+
const graph = new GraphAI(graph_data, { ...vanillaAgents, imageGoogleAgent, movieGoogleAgent, imageOpenaiAgent, fileWriteAgent }, options);
|
|
223
266
|
Object.keys(injections).forEach((key) => {
|
|
224
267
|
graph.injectValue(key, injections[key]);
|
|
225
268
|
});
|
package/lib/actions/movie.js
CHANGED
|
@@ -74,8 +74,8 @@ const createVideo = async (audioArtifactFilePath, outputVideoPath, studio, capti
|
|
|
74
74
|
if (!studioBeat.imageFile || !studioBeat.duration) {
|
|
75
75
|
throw new Error(`studioBeat.imageFile or studioBeat.duration is not set: index=${index}`);
|
|
76
76
|
}
|
|
77
|
-
const inputIndex = FfmpegContextAddInput(ffmpegContext, studioBeat.imageFile);
|
|
78
|
-
const mediaType = MulmoScriptMethods.getImageType(studio.script, beat);
|
|
77
|
+
const inputIndex = FfmpegContextAddInput(ffmpegContext, studioBeat.movieFile ?? studioBeat.imageFile);
|
|
78
|
+
const mediaType = studioBeat.movieFile ? "movie" : MulmoScriptMethods.getImageType(studio.script, beat);
|
|
79
79
|
const extraPadding = (() => {
|
|
80
80
|
// We need to consider only intro and outro padding because the other paddings were already added to the beat.duration
|
|
81
81
|
if (index === 0) {
|
package/lib/actions/translate.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import "dotenv/config";
|
|
2
2
|
import { GraphAI, assert } from "graphai";
|
|
3
|
-
import
|
|
3
|
+
import * as agents from "@graphai/vanilla";
|
|
4
4
|
import { openAIAgent } from "@graphai/openai_agent";
|
|
5
5
|
import { fileWriteAgent } from "@graphai/vanilla_node_agents";
|
|
6
6
|
import { recursiveSplitJa, replacementsJa, replacePairsJa } from "../utils/string.js";
|
|
7
7
|
import { getOutputStudioFilePath, mkdir, writingMessage } from "../utils/file.js";
|
|
8
8
|
import { translateSystemPrompt, translatePrompts } from "../utils/prompt.js";
|
|
9
9
|
import { MulmoStudioMethods } from "../methods/mulmo_studio.js";
|
|
10
|
-
|
|
10
|
+
const vanillaAgents = agents.default ?? agents;
|
|
11
11
|
const translateGraph = {
|
|
12
12
|
version: 0.5,
|
|
13
13
|
nodes: {
|
|
@@ -9,7 +9,7 @@ export const imageOpenaiAgent = async ({ namedInputs, params }) => {
|
|
|
9
9
|
model: model ?? "dall-e-3",
|
|
10
10
|
prompt,
|
|
11
11
|
n: 1,
|
|
12
|
-
size: size
|
|
12
|
+
size: size ?? (model === "gpt-image-1" ? "1536x1024" : "1792x1024"),
|
|
13
13
|
};
|
|
14
14
|
if (model === "gpt-image-1") {
|
|
15
15
|
imageOptions.moderation = moderation || "auto";
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { AgentFunction, AgentFunctionInfo } from "graphai";
|
|
2
|
+
export type MovieGoogleConfig = {
|
|
3
|
+
projectId?: string;
|
|
4
|
+
token?: string;
|
|
5
|
+
};
|
|
6
|
+
export declare const movieGoogleAgent: AgentFunction<{
|
|
7
|
+
model: string;
|
|
8
|
+
aspectRatio: string;
|
|
9
|
+
duration?: number;
|
|
10
|
+
}, {
|
|
11
|
+
buffer: Buffer;
|
|
12
|
+
}, {
|
|
13
|
+
prompt: string;
|
|
14
|
+
imagePath: string;
|
|
15
|
+
}, MovieGoogleConfig>;
|
|
16
|
+
declare const movieGoogleAgentInfo: AgentFunctionInfo;
|
|
17
|
+
export default movieGoogleAgentInfo;
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import { readFileSync } from "fs";
|
|
2
|
+
import { GraphAILogger, sleep } from "graphai";
|
|
3
|
+
async function generateMovie(projectId, model, token, prompt, imagePath, aspectRatio, duration) {
|
|
4
|
+
const GOOGLE_IMAGEN_ENDPOINT = `https://us-central1-aiplatform.googleapis.com/v1/projects/${projectId}/locations/us-central1/publishers/google/models/${model}`;
|
|
5
|
+
// Prepare the payload for the API request
|
|
6
|
+
const buffer = readFileSync(imagePath);
|
|
7
|
+
const bytesBase64Encoded = buffer.toString("base64");
|
|
8
|
+
const payload = {
|
|
9
|
+
instances: [
|
|
10
|
+
{
|
|
11
|
+
prompt: prompt,
|
|
12
|
+
image: {
|
|
13
|
+
bytesBase64Encoded,
|
|
14
|
+
mimeType: "image/png",
|
|
15
|
+
},
|
|
16
|
+
},
|
|
17
|
+
],
|
|
18
|
+
parameters: {
|
|
19
|
+
sampleCount: 1,
|
|
20
|
+
aspectRatio: aspectRatio,
|
|
21
|
+
//safetySetting: "block_only_high",
|
|
22
|
+
durationSeconds: duration,
|
|
23
|
+
},
|
|
24
|
+
};
|
|
25
|
+
// Make the API call using fetch
|
|
26
|
+
const response = await fetch(`${GOOGLE_IMAGEN_ENDPOINT}:predictLongRunning`, {
|
|
27
|
+
method: "POST",
|
|
28
|
+
headers: {
|
|
29
|
+
Authorization: `Bearer ${token}`,
|
|
30
|
+
"Content-Type": "application/json",
|
|
31
|
+
},
|
|
32
|
+
body: JSON.stringify(payload),
|
|
33
|
+
});
|
|
34
|
+
if (!response.ok) {
|
|
35
|
+
throw new Error(`Error: ${response.status} - ${response.statusText}`);
|
|
36
|
+
}
|
|
37
|
+
const initialResponse = await response.json();
|
|
38
|
+
const fetchBody = {
|
|
39
|
+
operationName: initialResponse.name,
|
|
40
|
+
};
|
|
41
|
+
const completeResponse = await (async () => {
|
|
42
|
+
while (true) {
|
|
43
|
+
GraphAILogger.info("...waiting for movie generation...");
|
|
44
|
+
await sleep(3000);
|
|
45
|
+
const response = await fetch(`${GOOGLE_IMAGEN_ENDPOINT}:fetchPredictOperation`, {
|
|
46
|
+
method: "POST",
|
|
47
|
+
headers: {
|
|
48
|
+
Authorization: `Bearer ${token}`,
|
|
49
|
+
"Content-Type": "application/json",
|
|
50
|
+
},
|
|
51
|
+
body: JSON.stringify(fetchBody),
|
|
52
|
+
});
|
|
53
|
+
if (!response.ok) {
|
|
54
|
+
throw new Error(`Error: ${response.status} - ${response.statusText}`);
|
|
55
|
+
}
|
|
56
|
+
const responseData = await response.json();
|
|
57
|
+
if (responseData.done) {
|
|
58
|
+
if (responseData.error) {
|
|
59
|
+
GraphAILogger.info("Prompt: ", prompt);
|
|
60
|
+
throw new Error(`Error: ${responseData.error.message}`);
|
|
61
|
+
}
|
|
62
|
+
if (!responseData.response.videos) {
|
|
63
|
+
throw new Error(`No video: ${JSON.stringify(responseData, null, 2)}`);
|
|
64
|
+
}
|
|
65
|
+
return responseData.response;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
})();
|
|
69
|
+
const encodedMovie = completeResponse.videos[0].bytesBase64Encoded;
|
|
70
|
+
if (encodedMovie) {
|
|
71
|
+
return Buffer.from(encodedMovie, "base64");
|
|
72
|
+
}
|
|
73
|
+
return undefined;
|
|
74
|
+
}
|
|
75
|
+
export const movieGoogleAgent = async ({ namedInputs, params, config }) => {
|
|
76
|
+
const { prompt, imagePath } = namedInputs;
|
|
77
|
+
/*
|
|
78
|
+
if (prompt) {
|
|
79
|
+
const buffer = Buffer.from(prompt);
|
|
80
|
+
return { buffer };
|
|
81
|
+
}
|
|
82
|
+
*/
|
|
83
|
+
const aspectRatio = params.aspectRatio ?? "16:9";
|
|
84
|
+
const model = params.model ?? "veo-2.0-generate-001"; // "veo-3.0-generate-preview";
|
|
85
|
+
const duration = params.duration ?? 8;
|
|
86
|
+
//const projectId = process.env.GOOGLE_PROJECT_ID; // Your Google Cloud Project ID
|
|
87
|
+
const projectId = config?.projectId;
|
|
88
|
+
const token = config?.token;
|
|
89
|
+
try {
|
|
90
|
+
const buffer = await generateMovie(projectId, model, token, prompt, imagePath, aspectRatio, duration);
|
|
91
|
+
if (buffer) {
|
|
92
|
+
return { buffer };
|
|
93
|
+
}
|
|
94
|
+
throw new Error("ERROR: geneateImage returned undefined");
|
|
95
|
+
}
|
|
96
|
+
catch (error) {
|
|
97
|
+
GraphAILogger.info("Failed to generate movie:", error);
|
|
98
|
+
throw error;
|
|
99
|
+
}
|
|
100
|
+
};
|
|
101
|
+
const movieGoogleAgentInfo = {
|
|
102
|
+
name: "movieGoogleAgent",
|
|
103
|
+
agent: movieGoogleAgent,
|
|
104
|
+
mock: movieGoogleAgent,
|
|
105
|
+
samples: [],
|
|
106
|
+
description: "Google Movie agent",
|
|
107
|
+
category: ["movie"],
|
|
108
|
+
author: "Receptron Team",
|
|
109
|
+
repository: "https://github.com/receptron/mulmocast-cli/",
|
|
110
|
+
// source: "https://github.com/receptron/mulmocast-cli/blob/main/src/agents/image_google_agent.ts",
|
|
111
|
+
license: "MIT",
|
|
112
|
+
environmentVariables: [],
|
|
113
|
+
};
|
|
114
|
+
export default movieGoogleAgentInfo;
|
package/lib/cli/bin.js
CHANGED
|
@@ -36,6 +36,18 @@ export const main = async () => {
|
|
|
36
36
|
.demandCommand()
|
|
37
37
|
.strict()
|
|
38
38
|
.help()
|
|
39
|
+
.showHelpOnFail(false)
|
|
40
|
+
.fail((msg, err, y) => {
|
|
41
|
+
// if yargs detect error, show help and exit
|
|
42
|
+
if (msg) {
|
|
43
|
+
y.showHelp();
|
|
44
|
+
GraphAILogger.info("\\n" + msg);
|
|
45
|
+
process.exit(1);
|
|
46
|
+
}
|
|
47
|
+
if (err) {
|
|
48
|
+
throw err;
|
|
49
|
+
}
|
|
50
|
+
})
|
|
39
51
|
.alias("help", "h");
|
|
40
52
|
await cli.parseAsync();
|
|
41
53
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { MulmoStudio } from "../types/index.js";
|
|
2
2
|
type SessionType = "audio" | "image" | "video" | "multiLingual" | "caption" | "pdf";
|
|
3
|
-
type BeatSessionType = "audio" | "image" | "multiLingual" | "caption";
|
|
3
|
+
type BeatSessionType = "audio" | "image" | "multiLingual" | "caption" | "movie";
|
|
4
4
|
export declare const MulmoStudioMethods: {
|
|
5
5
|
setSessionState(studio: MulmoStudio, sessionType: SessionType, value: boolean): void;
|
|
6
6
|
setBeatSessionState(studio: MulmoStudio, sessionType: BeatSessionType, index: number, value: boolean): void;
|
|
@@ -4,7 +4,7 @@ import { openAIAgent } from "@graphai/openai_agent";
|
|
|
4
4
|
import { anthropicAgent } from "@graphai/anthropic_agent";
|
|
5
5
|
import { geminiAgent } from "@graphai/gemini_agent";
|
|
6
6
|
import { groqAgent } from "@graphai/groq_agent";
|
|
7
|
-
import
|
|
7
|
+
import * as agents from "@graphai/vanilla";
|
|
8
8
|
import { fileWriteAgent } from "@graphai/vanilla_node_agents";
|
|
9
9
|
import { browserlessAgent } from "@graphai/browserless_agent";
|
|
10
10
|
import validateSchemaAgent from "../agents/validate_schema_agent.js";
|
|
@@ -14,7 +14,7 @@ import { mulmoScriptSchema, urlsSchema } from "../types/schema.js";
|
|
|
14
14
|
import { cliLoadingPlugin } from "../utils/plugins.js";
|
|
15
15
|
import { graphDataScriptFromUrlPrompt } from "../utils/prompt.js";
|
|
16
16
|
import { llmPair } from "../utils/utils.js";
|
|
17
|
-
|
|
17
|
+
const vanillaAgents = agents.default ?? agents;
|
|
18
18
|
const graphData = {
|
|
19
19
|
version: 0.5,
|
|
20
20
|
// Execute sequentially because the free version of browserless API doesn't support concurrent execution.
|
|
@@ -6,7 +6,7 @@ import { openAIAgent } from "@graphai/openai_agent";
|
|
|
6
6
|
import { anthropicAgent } from "@graphai/anthropic_agent";
|
|
7
7
|
import { geminiAgent } from "@graphai/gemini_agent";
|
|
8
8
|
import { groqAgent } from "@graphai/groq_agent";
|
|
9
|
-
import
|
|
9
|
+
import * as agents from "@graphai/vanilla";
|
|
10
10
|
import { fileWriteAgent } from "@graphai/vanilla_node_agents";
|
|
11
11
|
import { readTemplatePrompt, mkdir } from "../utils/file.js";
|
|
12
12
|
import { browserlessCacheGenerator } from "../utils/filters.js";
|
|
@@ -16,7 +16,7 @@ import validateSchemaAgent from "../agents/validate_schema_agent.js";
|
|
|
16
16
|
import { llmPair } from "../utils/utils.js";
|
|
17
17
|
import { interactiveClarificationPrompt, prefixPrompt } from "../utils/prompt.js";
|
|
18
18
|
// import { cliLoadingPlugin } from "../utils/plugins.js";
|
|
19
|
-
|
|
19
|
+
const vanillaAgents = agents.default ?? agents;
|
|
20
20
|
const agentHeader = "\x1b[34m● \x1b[0m\x1b[1mAgent\x1b[0m:\x1b[0m";
|
|
21
21
|
const graphDataForScraping = {
|
|
22
22
|
version: 0.5,
|
|
@@ -5,14 +5,14 @@ import { openAIAgent } from "@graphai/openai_agent";
|
|
|
5
5
|
import { anthropicAgent } from "@graphai/anthropic_agent";
|
|
6
6
|
import { geminiAgent } from "@graphai/gemini_agent";
|
|
7
7
|
import { groqAgent } from "@graphai/groq_agent";
|
|
8
|
-
import
|
|
8
|
+
import * as agents from "@graphai/vanilla";
|
|
9
9
|
import { graphDataScriptGeneratePrompt, sceneToBeatsPrompt, storyToScriptInfoPrompt, storyToScriptPrompt } from "../utils/prompt.js";
|
|
10
10
|
import { fileWriteAgent } from "@graphai/vanilla_node_agents";
|
|
11
11
|
import validateSchemaAgent from "../agents/validate_schema_agent.js";
|
|
12
12
|
import { llmPair } from "../utils/utils.js";
|
|
13
13
|
import { storyToScriptGenerateMode } from "../utils/const.js";
|
|
14
14
|
import { cliLoadingPlugin } from "../utils/plugins.js";
|
|
15
|
-
|
|
15
|
+
const vanillaAgents = agents.default ?? agents;
|
|
16
16
|
const createValidatedScriptGraphData = ({ systemPrompt, prompt, schema, llmAgent, llmModel, maxTokens, }) => {
|
|
17
17
|
return {
|
|
18
18
|
loop: {
|
package/lib/types/schema.d.ts
CHANGED
|
@@ -1624,6 +1624,7 @@ export declare const mulmoBeatSchema: z.ZodObject<{
|
|
|
1624
1624
|
}>>;
|
|
1625
1625
|
imageNames: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
1626
1626
|
imagePrompt: z.ZodOptional<z.ZodString>;
|
|
1627
|
+
moviePrompt: z.ZodOptional<z.ZodString>;
|
|
1627
1628
|
}, "strict", z.ZodTypeAny, {
|
|
1628
1629
|
text: string;
|
|
1629
1630
|
speaker: string;
|
|
@@ -1780,6 +1781,7 @@ export declare const mulmoBeatSchema: z.ZodObject<{
|
|
|
1780
1781
|
} | undefined;
|
|
1781
1782
|
imageNames?: string[] | undefined;
|
|
1782
1783
|
imagePrompt?: string | undefined;
|
|
1784
|
+
moviePrompt?: string | undefined;
|
|
1783
1785
|
}, {
|
|
1784
1786
|
text: string;
|
|
1785
1787
|
duration?: number | undefined;
|
|
@@ -1936,6 +1938,7 @@ export declare const mulmoBeatSchema: z.ZodObject<{
|
|
|
1936
1938
|
} | undefined;
|
|
1937
1939
|
imageNames?: string[] | undefined;
|
|
1938
1940
|
imagePrompt?: string | undefined;
|
|
1941
|
+
moviePrompt?: string | undefined;
|
|
1939
1942
|
}>;
|
|
1940
1943
|
export declare const mulmoCanvasDimensionSchema: z.ZodDefault<z.ZodObject<{
|
|
1941
1944
|
width: z.ZodNumber;
|
|
@@ -2010,6 +2013,17 @@ export declare const mulmoSpeechParamsSchema: z.ZodObject<{
|
|
|
2010
2013
|
provider?: "openai" | "nijivoice" | "google" | undefined;
|
|
2011
2014
|
}>;
|
|
2012
2015
|
export declare const text2ImageProviderSchema: z.ZodDefault<z.ZodUnion<[z.ZodLiteral<"openai">, z.ZodLiteral<"google">]>>;
|
|
2016
|
+
export declare const text2MovieProviderSchema: z.ZodDefault<z.ZodUnion<[z.ZodLiteral<"openai">, z.ZodLiteral<"google">]>>;
|
|
2017
|
+
export declare const mulmoMovieParamsSchema: z.ZodObject<{
|
|
2018
|
+
provider: z.ZodOptional<z.ZodDefault<z.ZodUnion<[z.ZodLiteral<"openai">, z.ZodLiteral<"google">]>>>;
|
|
2019
|
+
model: z.ZodOptional<z.ZodString>;
|
|
2020
|
+
}, "strict", z.ZodTypeAny, {
|
|
2021
|
+
model?: string | undefined;
|
|
2022
|
+
provider?: "openai" | "google" | undefined;
|
|
2023
|
+
}, {
|
|
2024
|
+
model?: string | undefined;
|
|
2025
|
+
provider?: "openai" | "google" | undefined;
|
|
2026
|
+
}>;
|
|
2013
2027
|
export declare const mulmoPresentationStyleSchema: z.ZodObject<{
|
|
2014
2028
|
$mulmocast: z.ZodObject<{
|
|
2015
2029
|
version: z.ZodLiteral<"1.0">;
|
|
@@ -2204,6 +2218,16 @@ export declare const mulmoPresentationStyleSchema: z.ZodObject<{
|
|
|
2204
2218
|
}> | undefined;
|
|
2205
2219
|
provider?: "openai" | "google" | undefined;
|
|
2206
2220
|
}>>;
|
|
2221
|
+
movieParams: z.ZodOptional<z.ZodObject<{
|
|
2222
|
+
provider: z.ZodOptional<z.ZodDefault<z.ZodUnion<[z.ZodLiteral<"openai">, z.ZodLiteral<"google">]>>>;
|
|
2223
|
+
model: z.ZodOptional<z.ZodString>;
|
|
2224
|
+
}, "strict", z.ZodTypeAny, {
|
|
2225
|
+
model?: string | undefined;
|
|
2226
|
+
provider?: "openai" | "google" | undefined;
|
|
2227
|
+
}, {
|
|
2228
|
+
model?: string | undefined;
|
|
2229
|
+
provider?: "openai" | "google" | undefined;
|
|
2230
|
+
}>>;
|
|
2207
2231
|
textSlideParams: z.ZodOptional<z.ZodObject<{
|
|
2208
2232
|
cssStyles: z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>;
|
|
2209
2233
|
}, "strict", z.ZodTypeAny, {
|
|
@@ -2280,6 +2304,10 @@ export declare const mulmoPresentationStyleSchema: z.ZodObject<{
|
|
|
2280
2304
|
textSlideParams?: {
|
|
2281
2305
|
cssStyles: string | string[];
|
|
2282
2306
|
} | undefined;
|
|
2307
|
+
movieParams?: {
|
|
2308
|
+
model?: string | undefined;
|
|
2309
|
+
provider?: "openai" | "google" | undefined;
|
|
2310
|
+
} | undefined;
|
|
2283
2311
|
omitCaptions?: boolean | undefined;
|
|
2284
2312
|
}, {
|
|
2285
2313
|
$mulmocast: {
|
|
@@ -2333,6 +2361,10 @@ export declare const mulmoPresentationStyleSchema: z.ZodObject<{
|
|
|
2333
2361
|
}>;
|
|
2334
2362
|
provider?: "openai" | "nijivoice" | "google" | undefined;
|
|
2335
2363
|
} | undefined;
|
|
2364
|
+
movieParams?: {
|
|
2365
|
+
model?: string | undefined;
|
|
2366
|
+
provider?: "openai" | "google" | undefined;
|
|
2367
|
+
} | undefined;
|
|
2336
2368
|
omitCaptions?: boolean | undefined;
|
|
2337
2369
|
}>;
|
|
2338
2370
|
export declare const mulmoReferenceSchema: z.ZodObject<{
|
|
@@ -2545,6 +2577,16 @@ export declare const mulmoScriptSchema: z.ZodObject<{
|
|
|
2545
2577
|
}> | undefined;
|
|
2546
2578
|
provider?: "openai" | "google" | undefined;
|
|
2547
2579
|
}>>;
|
|
2580
|
+
movieParams: z.ZodOptional<z.ZodObject<{
|
|
2581
|
+
provider: z.ZodOptional<z.ZodDefault<z.ZodUnion<[z.ZodLiteral<"openai">, z.ZodLiteral<"google">]>>>;
|
|
2582
|
+
model: z.ZodOptional<z.ZodString>;
|
|
2583
|
+
}, "strict", z.ZodTypeAny, {
|
|
2584
|
+
model?: string | undefined;
|
|
2585
|
+
provider?: "openai" | "google" | undefined;
|
|
2586
|
+
}, {
|
|
2587
|
+
model?: string | undefined;
|
|
2588
|
+
provider?: "openai" | "google" | undefined;
|
|
2589
|
+
}>>;
|
|
2548
2590
|
textSlideParams: z.ZodOptional<z.ZodObject<{
|
|
2549
2591
|
cssStyles: z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>;
|
|
2550
2592
|
}, "strict", z.ZodTypeAny, {
|
|
@@ -3240,6 +3282,7 @@ export declare const mulmoScriptSchema: z.ZodObject<{
|
|
|
3240
3282
|
}>>;
|
|
3241
3283
|
imageNames: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
3242
3284
|
imagePrompt: z.ZodOptional<z.ZodString>;
|
|
3285
|
+
moviePrompt: z.ZodOptional<z.ZodString>;
|
|
3243
3286
|
}, "strict", z.ZodTypeAny, {
|
|
3244
3287
|
text: string;
|
|
3245
3288
|
speaker: string;
|
|
@@ -3396,6 +3439,7 @@ export declare const mulmoScriptSchema: z.ZodObject<{
|
|
|
3396
3439
|
} | undefined;
|
|
3397
3440
|
imageNames?: string[] | undefined;
|
|
3398
3441
|
imagePrompt?: string | undefined;
|
|
3442
|
+
moviePrompt?: string | undefined;
|
|
3399
3443
|
}, {
|
|
3400
3444
|
text: string;
|
|
3401
3445
|
duration?: number | undefined;
|
|
@@ -3552,6 +3596,7 @@ export declare const mulmoScriptSchema: z.ZodObject<{
|
|
|
3552
3596
|
} | undefined;
|
|
3553
3597
|
imageNames?: string[] | undefined;
|
|
3554
3598
|
imagePrompt?: string | undefined;
|
|
3599
|
+
moviePrompt?: string | undefined;
|
|
3555
3600
|
}>, "many">;
|
|
3556
3601
|
imagePath: z.ZodOptional<z.ZodString>;
|
|
3557
3602
|
__test_invalid__: z.ZodOptional<z.ZodBoolean>;
|
|
@@ -3737,6 +3782,7 @@ export declare const mulmoScriptSchema: z.ZodObject<{
|
|
|
3737
3782
|
} | undefined;
|
|
3738
3783
|
imageNames?: string[] | undefined;
|
|
3739
3784
|
imagePrompt?: string | undefined;
|
|
3785
|
+
moviePrompt?: string | undefined;
|
|
3740
3786
|
}[];
|
|
3741
3787
|
lang?: string | undefined;
|
|
3742
3788
|
title?: string | undefined;
|
|
@@ -3766,6 +3812,10 @@ export declare const mulmoScriptSchema: z.ZodObject<{
|
|
|
3766
3812
|
textSlideParams?: {
|
|
3767
3813
|
cssStyles: string | string[];
|
|
3768
3814
|
} | undefined;
|
|
3815
|
+
movieParams?: {
|
|
3816
|
+
model?: string | undefined;
|
|
3817
|
+
provider?: "openai" | "google" | undefined;
|
|
3818
|
+
} | undefined;
|
|
3769
3819
|
omitCaptions?: boolean | undefined;
|
|
3770
3820
|
description?: string | undefined;
|
|
3771
3821
|
references?: {
|
|
@@ -3937,6 +3987,7 @@ export declare const mulmoScriptSchema: z.ZodObject<{
|
|
|
3937
3987
|
} | undefined;
|
|
3938
3988
|
imageNames?: string[] | undefined;
|
|
3939
3989
|
imagePrompt?: string | undefined;
|
|
3990
|
+
moviePrompt?: string | undefined;
|
|
3940
3991
|
}[];
|
|
3941
3992
|
lang?: string | undefined;
|
|
3942
3993
|
title?: string | undefined;
|
|
@@ -3987,6 +4038,10 @@ export declare const mulmoScriptSchema: z.ZodObject<{
|
|
|
3987
4038
|
}>;
|
|
3988
4039
|
provider?: "openai" | "nijivoice" | "google" | undefined;
|
|
3989
4040
|
} | undefined;
|
|
4041
|
+
movieParams?: {
|
|
4042
|
+
model?: string | undefined;
|
|
4043
|
+
provider?: "openai" | "google" | undefined;
|
|
4044
|
+
} | undefined;
|
|
3990
4045
|
omitCaptions?: boolean | undefined;
|
|
3991
4046
|
description?: string | undefined;
|
|
3992
4047
|
references?: {
|
|
@@ -4003,18 +4058,21 @@ export declare const mulmoStudioBeatSchema: z.ZodObject<{
|
|
|
4003
4058
|
duration: z.ZodOptional<z.ZodNumber>;
|
|
4004
4059
|
audioFile: z.ZodOptional<z.ZodString>;
|
|
4005
4060
|
imageFile: z.ZodOptional<z.ZodString>;
|
|
4061
|
+
movieFile: z.ZodOptional<z.ZodString>;
|
|
4006
4062
|
captionFile: z.ZodOptional<z.ZodString>;
|
|
4007
4063
|
}, "strict", z.ZodTypeAny, {
|
|
4008
4064
|
duration?: number | undefined;
|
|
4009
4065
|
hash?: string | undefined;
|
|
4010
4066
|
audioFile?: string | undefined;
|
|
4011
4067
|
imageFile?: string | undefined;
|
|
4068
|
+
movieFile?: string | undefined;
|
|
4012
4069
|
captionFile?: string | undefined;
|
|
4013
4070
|
}, {
|
|
4014
4071
|
duration?: number | undefined;
|
|
4015
4072
|
hash?: string | undefined;
|
|
4016
4073
|
audioFile?: string | undefined;
|
|
4017
4074
|
imageFile?: string | undefined;
|
|
4075
|
+
movieFile?: string | undefined;
|
|
4018
4076
|
captionFile?: string | undefined;
|
|
4019
4077
|
}>;
|
|
4020
4078
|
export declare const mulmoStudioMultiLingualDataSchema: z.ZodObject<{
|
|
@@ -4117,15 +4175,18 @@ export declare const mulmoSessionStateSchema: z.ZodObject<{
|
|
|
4117
4175
|
inBeatSession: z.ZodObject<{
|
|
4118
4176
|
audio: z.ZodSet<z.ZodNumber>;
|
|
4119
4177
|
image: z.ZodSet<z.ZodNumber>;
|
|
4178
|
+
movie: z.ZodSet<z.ZodNumber>;
|
|
4120
4179
|
multiLingual: z.ZodSet<z.ZodNumber>;
|
|
4121
4180
|
caption: z.ZodSet<z.ZodNumber>;
|
|
4122
4181
|
}, "strip", z.ZodTypeAny, {
|
|
4123
4182
|
image: Set<number>;
|
|
4183
|
+
movie: Set<number>;
|
|
4124
4184
|
audio: Set<number>;
|
|
4125
4185
|
multiLingual: Set<number>;
|
|
4126
4186
|
caption: Set<number>;
|
|
4127
4187
|
}, {
|
|
4128
4188
|
image: Set<number>;
|
|
4189
|
+
movie: Set<number>;
|
|
4129
4190
|
audio: Set<number>;
|
|
4130
4191
|
multiLingual: Set<number>;
|
|
4131
4192
|
caption: Set<number>;
|
|
@@ -4141,6 +4202,7 @@ export declare const mulmoSessionStateSchema: z.ZodObject<{
|
|
|
4141
4202
|
};
|
|
4142
4203
|
inBeatSession: {
|
|
4143
4204
|
image: Set<number>;
|
|
4205
|
+
movie: Set<number>;
|
|
4144
4206
|
audio: Set<number>;
|
|
4145
4207
|
multiLingual: Set<number>;
|
|
4146
4208
|
caption: Set<number>;
|
|
@@ -4156,6 +4218,7 @@ export declare const mulmoSessionStateSchema: z.ZodObject<{
|
|
|
4156
4218
|
};
|
|
4157
4219
|
inBeatSession: {
|
|
4158
4220
|
image: Set<number>;
|
|
4221
|
+
movie: Set<number>;
|
|
4159
4222
|
audio: Set<number>;
|
|
4160
4223
|
multiLingual: Set<number>;
|
|
4161
4224
|
caption: Set<number>;
|
|
@@ -4356,6 +4419,16 @@ export declare const mulmoStudioSchema: z.ZodObject<{
|
|
|
4356
4419
|
}> | undefined;
|
|
4357
4420
|
provider?: "openai" | "google" | undefined;
|
|
4358
4421
|
}>>;
|
|
4422
|
+
movieParams: z.ZodOptional<z.ZodObject<{
|
|
4423
|
+
provider: z.ZodOptional<z.ZodDefault<z.ZodUnion<[z.ZodLiteral<"openai">, z.ZodLiteral<"google">]>>>;
|
|
4424
|
+
model: z.ZodOptional<z.ZodString>;
|
|
4425
|
+
}, "strict", z.ZodTypeAny, {
|
|
4426
|
+
model?: string | undefined;
|
|
4427
|
+
provider?: "openai" | "google" | undefined;
|
|
4428
|
+
}, {
|
|
4429
|
+
model?: string | undefined;
|
|
4430
|
+
provider?: "openai" | "google" | undefined;
|
|
4431
|
+
}>>;
|
|
4359
4432
|
textSlideParams: z.ZodOptional<z.ZodObject<{
|
|
4360
4433
|
cssStyles: z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>;
|
|
4361
4434
|
}, "strict", z.ZodTypeAny, {
|
|
@@ -5051,6 +5124,7 @@ export declare const mulmoStudioSchema: z.ZodObject<{
|
|
|
5051
5124
|
}>>;
|
|
5052
5125
|
imageNames: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
5053
5126
|
imagePrompt: z.ZodOptional<z.ZodString>;
|
|
5127
|
+
moviePrompt: z.ZodOptional<z.ZodString>;
|
|
5054
5128
|
}, "strict", z.ZodTypeAny, {
|
|
5055
5129
|
text: string;
|
|
5056
5130
|
speaker: string;
|
|
@@ -5207,6 +5281,7 @@ export declare const mulmoStudioSchema: z.ZodObject<{
|
|
|
5207
5281
|
} | undefined;
|
|
5208
5282
|
imageNames?: string[] | undefined;
|
|
5209
5283
|
imagePrompt?: string | undefined;
|
|
5284
|
+
moviePrompt?: string | undefined;
|
|
5210
5285
|
}, {
|
|
5211
5286
|
text: string;
|
|
5212
5287
|
duration?: number | undefined;
|
|
@@ -5363,6 +5438,7 @@ export declare const mulmoStudioSchema: z.ZodObject<{
|
|
|
5363
5438
|
} | undefined;
|
|
5364
5439
|
imageNames?: string[] | undefined;
|
|
5365
5440
|
imagePrompt?: string | undefined;
|
|
5441
|
+
moviePrompt?: string | undefined;
|
|
5366
5442
|
}>, "many">;
|
|
5367
5443
|
imagePath: z.ZodOptional<z.ZodString>;
|
|
5368
5444
|
__test_invalid__: z.ZodOptional<z.ZodBoolean>;
|
|
@@ -5548,6 +5624,7 @@ export declare const mulmoStudioSchema: z.ZodObject<{
|
|
|
5548
5624
|
} | undefined;
|
|
5549
5625
|
imageNames?: string[] | undefined;
|
|
5550
5626
|
imagePrompt?: string | undefined;
|
|
5627
|
+
moviePrompt?: string | undefined;
|
|
5551
5628
|
}[];
|
|
5552
5629
|
lang?: string | undefined;
|
|
5553
5630
|
title?: string | undefined;
|
|
@@ -5577,6 +5654,10 @@ export declare const mulmoStudioSchema: z.ZodObject<{
|
|
|
5577
5654
|
textSlideParams?: {
|
|
5578
5655
|
cssStyles: string | string[];
|
|
5579
5656
|
} | undefined;
|
|
5657
|
+
movieParams?: {
|
|
5658
|
+
model?: string | undefined;
|
|
5659
|
+
provider?: "openai" | "google" | undefined;
|
|
5660
|
+
} | undefined;
|
|
5580
5661
|
omitCaptions?: boolean | undefined;
|
|
5581
5662
|
description?: string | undefined;
|
|
5582
5663
|
references?: {
|
|
@@ -5748,6 +5829,7 @@ export declare const mulmoStudioSchema: z.ZodObject<{
|
|
|
5748
5829
|
} | undefined;
|
|
5749
5830
|
imageNames?: string[] | undefined;
|
|
5750
5831
|
imagePrompt?: string | undefined;
|
|
5832
|
+
moviePrompt?: string | undefined;
|
|
5751
5833
|
}[];
|
|
5752
5834
|
lang?: string | undefined;
|
|
5753
5835
|
title?: string | undefined;
|
|
@@ -5798,6 +5880,10 @@ export declare const mulmoStudioSchema: z.ZodObject<{
|
|
|
5798
5880
|
}>;
|
|
5799
5881
|
provider?: "openai" | "nijivoice" | "google" | undefined;
|
|
5800
5882
|
} | undefined;
|
|
5883
|
+
movieParams?: {
|
|
5884
|
+
model?: string | undefined;
|
|
5885
|
+
provider?: "openai" | "google" | undefined;
|
|
5886
|
+
} | undefined;
|
|
5801
5887
|
omitCaptions?: boolean | undefined;
|
|
5802
5888
|
description?: string | undefined;
|
|
5803
5889
|
references?: {
|
|
@@ -5815,18 +5901,21 @@ export declare const mulmoStudioSchema: z.ZodObject<{
|
|
|
5815
5901
|
duration: z.ZodOptional<z.ZodNumber>;
|
|
5816
5902
|
audioFile: z.ZodOptional<z.ZodString>;
|
|
5817
5903
|
imageFile: z.ZodOptional<z.ZodString>;
|
|
5904
|
+
movieFile: z.ZodOptional<z.ZodString>;
|
|
5818
5905
|
captionFile: z.ZodOptional<z.ZodString>;
|
|
5819
5906
|
}, "strict", z.ZodTypeAny, {
|
|
5820
5907
|
duration?: number | undefined;
|
|
5821
5908
|
hash?: string | undefined;
|
|
5822
5909
|
audioFile?: string | undefined;
|
|
5823
5910
|
imageFile?: string | undefined;
|
|
5911
|
+
movieFile?: string | undefined;
|
|
5824
5912
|
captionFile?: string | undefined;
|
|
5825
5913
|
}, {
|
|
5826
5914
|
duration?: number | undefined;
|
|
5827
5915
|
hash?: string | undefined;
|
|
5828
5916
|
audioFile?: string | undefined;
|
|
5829
5917
|
imageFile?: string | undefined;
|
|
5918
|
+
movieFile?: string | undefined;
|
|
5830
5919
|
captionFile?: string | undefined;
|
|
5831
5920
|
}>, "many">;
|
|
5832
5921
|
multiLingual: z.ZodArray<z.ZodObject<{
|
|
@@ -5892,15 +5981,18 @@ export declare const mulmoStudioSchema: z.ZodObject<{
|
|
|
5892
5981
|
inBeatSession: z.ZodObject<{
|
|
5893
5982
|
audio: z.ZodSet<z.ZodNumber>;
|
|
5894
5983
|
image: z.ZodSet<z.ZodNumber>;
|
|
5984
|
+
movie: z.ZodSet<z.ZodNumber>;
|
|
5895
5985
|
multiLingual: z.ZodSet<z.ZodNumber>;
|
|
5896
5986
|
caption: z.ZodSet<z.ZodNumber>;
|
|
5897
5987
|
}, "strip", z.ZodTypeAny, {
|
|
5898
5988
|
image: Set<number>;
|
|
5989
|
+
movie: Set<number>;
|
|
5899
5990
|
audio: Set<number>;
|
|
5900
5991
|
multiLingual: Set<number>;
|
|
5901
5992
|
caption: Set<number>;
|
|
5902
5993
|
}, {
|
|
5903
5994
|
image: Set<number>;
|
|
5995
|
+
movie: Set<number>;
|
|
5904
5996
|
audio: Set<number>;
|
|
5905
5997
|
multiLingual: Set<number>;
|
|
5906
5998
|
caption: Set<number>;
|
|
@@ -5916,6 +6008,7 @@ export declare const mulmoStudioSchema: z.ZodObject<{
|
|
|
5916
6008
|
};
|
|
5917
6009
|
inBeatSession: {
|
|
5918
6010
|
image: Set<number>;
|
|
6011
|
+
movie: Set<number>;
|
|
5919
6012
|
audio: Set<number>;
|
|
5920
6013
|
multiLingual: Set<number>;
|
|
5921
6014
|
caption: Set<number>;
|
|
@@ -5931,6 +6024,7 @@ export declare const mulmoStudioSchema: z.ZodObject<{
|
|
|
5931
6024
|
};
|
|
5932
6025
|
inBeatSession: {
|
|
5933
6026
|
image: Set<number>;
|
|
6027
|
+
movie: Set<number>;
|
|
5934
6028
|
audio: Set<number>;
|
|
5935
6029
|
multiLingual: Set<number>;
|
|
5936
6030
|
caption: Set<number>;
|
|
@@ -5942,6 +6036,7 @@ export declare const mulmoStudioSchema: z.ZodObject<{
|
|
|
5942
6036
|
hash?: string | undefined;
|
|
5943
6037
|
audioFile?: string | undefined;
|
|
5944
6038
|
imageFile?: string | undefined;
|
|
6039
|
+
movieFile?: string | undefined;
|
|
5945
6040
|
captionFile?: string | undefined;
|
|
5946
6041
|
}[];
|
|
5947
6042
|
multiLingual: {
|
|
@@ -6135,6 +6230,7 @@ export declare const mulmoStudioSchema: z.ZodObject<{
|
|
|
6135
6230
|
} | undefined;
|
|
6136
6231
|
imageNames?: string[] | undefined;
|
|
6137
6232
|
imagePrompt?: string | undefined;
|
|
6233
|
+
moviePrompt?: string | undefined;
|
|
6138
6234
|
}[];
|
|
6139
6235
|
lang?: string | undefined;
|
|
6140
6236
|
title?: string | undefined;
|
|
@@ -6164,6 +6260,10 @@ export declare const mulmoStudioSchema: z.ZodObject<{
|
|
|
6164
6260
|
textSlideParams?: {
|
|
6165
6261
|
cssStyles: string | string[];
|
|
6166
6262
|
} | undefined;
|
|
6263
|
+
movieParams?: {
|
|
6264
|
+
model?: string | undefined;
|
|
6265
|
+
provider?: "openai" | "google" | undefined;
|
|
6266
|
+
} | undefined;
|
|
6167
6267
|
omitCaptions?: boolean | undefined;
|
|
6168
6268
|
description?: string | undefined;
|
|
6169
6269
|
references?: {
|
|
@@ -6187,6 +6287,7 @@ export declare const mulmoStudioSchema: z.ZodObject<{
|
|
|
6187
6287
|
};
|
|
6188
6288
|
inBeatSession: {
|
|
6189
6289
|
image: Set<number>;
|
|
6290
|
+
movie: Set<number>;
|
|
6190
6291
|
audio: Set<number>;
|
|
6191
6292
|
multiLingual: Set<number>;
|
|
6192
6293
|
caption: Set<number>;
|
|
@@ -6198,6 +6299,7 @@ export declare const mulmoStudioSchema: z.ZodObject<{
|
|
|
6198
6299
|
hash?: string | undefined;
|
|
6199
6300
|
audioFile?: string | undefined;
|
|
6200
6301
|
imageFile?: string | undefined;
|
|
6302
|
+
movieFile?: string | undefined;
|
|
6201
6303
|
captionFile?: string | undefined;
|
|
6202
6304
|
}[];
|
|
6203
6305
|
multiLingual: {
|
|
@@ -6370,6 +6472,7 @@ export declare const mulmoStudioSchema: z.ZodObject<{
|
|
|
6370
6472
|
} | undefined;
|
|
6371
6473
|
imageNames?: string[] | undefined;
|
|
6372
6474
|
imagePrompt?: string | undefined;
|
|
6475
|
+
moviePrompt?: string | undefined;
|
|
6373
6476
|
}[];
|
|
6374
6477
|
lang?: string | undefined;
|
|
6375
6478
|
title?: string | undefined;
|
|
@@ -6420,6 +6523,10 @@ export declare const mulmoStudioSchema: z.ZodObject<{
|
|
|
6420
6523
|
}>;
|
|
6421
6524
|
provider?: "openai" | "nijivoice" | "google" | undefined;
|
|
6422
6525
|
} | undefined;
|
|
6526
|
+
movieParams?: {
|
|
6527
|
+
model?: string | undefined;
|
|
6528
|
+
provider?: "openai" | "google" | undefined;
|
|
6529
|
+
} | undefined;
|
|
6423
6530
|
omitCaptions?: boolean | undefined;
|
|
6424
6531
|
description?: string | undefined;
|
|
6425
6532
|
references?: {
|
|
@@ -6443,6 +6550,7 @@ export declare const mulmoStudioSchema: z.ZodObject<{
|
|
|
6443
6550
|
};
|
|
6444
6551
|
inBeatSession: {
|
|
6445
6552
|
image: Set<number>;
|
|
6553
|
+
movie: Set<number>;
|
|
6446
6554
|
audio: Set<number>;
|
|
6447
6555
|
multiLingual: Set<number>;
|
|
6448
6556
|
caption: Set<number>;
|
|
@@ -6648,6 +6756,16 @@ export declare const mulmoScriptTemplateSchema: z.ZodObject<{
|
|
|
6648
6756
|
}> | undefined;
|
|
6649
6757
|
provider?: "openai" | "google" | undefined;
|
|
6650
6758
|
}>>;
|
|
6759
|
+
movieParams: z.ZodOptional<z.ZodObject<{
|
|
6760
|
+
provider: z.ZodOptional<z.ZodDefault<z.ZodUnion<[z.ZodLiteral<"openai">, z.ZodLiteral<"google">]>>>;
|
|
6761
|
+
model: z.ZodOptional<z.ZodString>;
|
|
6762
|
+
}, "strict", z.ZodTypeAny, {
|
|
6763
|
+
model?: string | undefined;
|
|
6764
|
+
provider?: "openai" | "google" | undefined;
|
|
6765
|
+
}, {
|
|
6766
|
+
model?: string | undefined;
|
|
6767
|
+
provider?: "openai" | "google" | undefined;
|
|
6768
|
+
}>>;
|
|
6651
6769
|
textSlideParams: z.ZodOptional<z.ZodObject<{
|
|
6652
6770
|
cssStyles: z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>;
|
|
6653
6771
|
}, "strict", z.ZodTypeAny, {
|
|
@@ -6724,6 +6842,10 @@ export declare const mulmoScriptTemplateSchema: z.ZodObject<{
|
|
|
6724
6842
|
textSlideParams?: {
|
|
6725
6843
|
cssStyles: string | string[];
|
|
6726
6844
|
} | undefined;
|
|
6845
|
+
movieParams?: {
|
|
6846
|
+
model?: string | undefined;
|
|
6847
|
+
provider?: "openai" | "google" | undefined;
|
|
6848
|
+
} | undefined;
|
|
6727
6849
|
omitCaptions?: boolean | undefined;
|
|
6728
6850
|
}, {
|
|
6729
6851
|
$mulmocast: {
|
|
@@ -6777,6 +6899,10 @@ export declare const mulmoScriptTemplateSchema: z.ZodObject<{
|
|
|
6777
6899
|
}>;
|
|
6778
6900
|
provider?: "openai" | "nijivoice" | "google" | undefined;
|
|
6779
6901
|
} | undefined;
|
|
6902
|
+
movieParams?: {
|
|
6903
|
+
model?: string | undefined;
|
|
6904
|
+
provider?: "openai" | "google" | undefined;
|
|
6905
|
+
} | undefined;
|
|
6780
6906
|
omitCaptions?: boolean | undefined;
|
|
6781
6907
|
}>>;
|
|
6782
6908
|
}, "strict", z.ZodTypeAny, {
|
|
@@ -6836,6 +6962,10 @@ export declare const mulmoScriptTemplateSchema: z.ZodObject<{
|
|
|
6836
6962
|
textSlideParams?: {
|
|
6837
6963
|
cssStyles: string | string[];
|
|
6838
6964
|
} | undefined;
|
|
6965
|
+
movieParams?: {
|
|
6966
|
+
model?: string | undefined;
|
|
6967
|
+
provider?: "openai" | "google" | undefined;
|
|
6968
|
+
} | undefined;
|
|
6839
6969
|
omitCaptions?: boolean | undefined;
|
|
6840
6970
|
} | undefined;
|
|
6841
6971
|
}, {
|
|
@@ -6895,6 +7025,10 @@ export declare const mulmoScriptTemplateSchema: z.ZodObject<{
|
|
|
6895
7025
|
}>;
|
|
6896
7026
|
provider?: "openai" | "nijivoice" | "google" | undefined;
|
|
6897
7027
|
} | undefined;
|
|
7028
|
+
movieParams?: {
|
|
7029
|
+
model?: string | undefined;
|
|
7030
|
+
provider?: "openai" | "google" | undefined;
|
|
7031
|
+
} | undefined;
|
|
6898
7032
|
omitCaptions?: boolean | undefined;
|
|
6899
7033
|
} | undefined;
|
|
6900
7034
|
}>;
|
package/lib/types/schema.js
CHANGED
|
@@ -178,7 +178,8 @@ export const mulmoBeatSchema = z
|
|
|
178
178
|
speechOptions: speechOptionsSchema.optional(),
|
|
179
179
|
textSlideParams: textSlideParamsSchema.optional(),
|
|
180
180
|
imageNames: z.array(imageIdSchema).optional(), // list of image names to use for image generation. The default is all images in the imageParams.images.
|
|
181
|
-
imagePrompt: z.string().optional(),
|
|
181
|
+
imagePrompt: z.string().optional(),
|
|
182
|
+
moviePrompt: z.string().optional(),
|
|
182
183
|
})
|
|
183
184
|
.strict();
|
|
184
185
|
export const mulmoCanvasDimensionSchema = z
|
|
@@ -202,6 +203,13 @@ export const mulmoSpeechParamsSchema = z
|
|
|
202
203
|
})
|
|
203
204
|
.strict();
|
|
204
205
|
export const text2ImageProviderSchema = z.union([z.literal("openai"), z.literal("google")]).default("openai");
|
|
206
|
+
export const text2MovieProviderSchema = z.union([z.literal("openai"), z.literal("google")]).default("google");
|
|
207
|
+
export const mulmoMovieParamsSchema = z
|
|
208
|
+
.object({
|
|
209
|
+
provider: text2MovieProviderSchema.optional(),
|
|
210
|
+
model: z.string().optional(), // default: provider specific
|
|
211
|
+
})
|
|
212
|
+
.strict();
|
|
205
213
|
export const mulmoPresentationStyleSchema = z.object({
|
|
206
214
|
$mulmocast: mulmoCastCreditSchema,
|
|
207
215
|
canvasSize: mulmoCanvasDimensionSchema, // has default value
|
|
@@ -220,6 +228,7 @@ export const mulmoPresentationStyleSchema = z.object({
|
|
|
220
228
|
provider: text2ImageProviderSchema, // has default value
|
|
221
229
|
})
|
|
222
230
|
.optional(),
|
|
231
|
+
movieParams: mulmoMovieParamsSchema.optional(),
|
|
223
232
|
// for textSlides
|
|
224
233
|
textSlideParams: textSlideParamsSchema.optional(),
|
|
225
234
|
// videoParams: videoParamsSchema.optional(),
|
|
@@ -257,6 +266,7 @@ export const mulmoStudioBeatSchema = z
|
|
|
257
266
|
duration: z.number().optional(),
|
|
258
267
|
audioFile: z.string().optional(),
|
|
259
268
|
imageFile: z.string().optional(), // path to the image
|
|
269
|
+
movieFile: z.string().optional(), // path to the movie file
|
|
260
270
|
captionFile: z.string().optional(), // path to the caption image
|
|
261
271
|
})
|
|
262
272
|
.strict();
|
|
@@ -276,6 +286,7 @@ export const mulmoSessionStateSchema = z.object({
|
|
|
276
286
|
inBeatSession: z.object({
|
|
277
287
|
audio: z.set(z.number()),
|
|
278
288
|
image: z.set(z.number()),
|
|
289
|
+
movie: z.set(z.number()),
|
|
279
290
|
multiLingual: z.set(z.number()),
|
|
280
291
|
caption: z.set(z.number()),
|
|
281
292
|
}),
|
|
@@ -298,6 +309,7 @@ export const mulmoStudioSchema = z
|
|
|
298
309
|
inBeatSession: {
|
|
299
310
|
audio: new Set(),
|
|
300
311
|
image: new Set(),
|
|
312
|
+
movie: new Set(),
|
|
301
313
|
multiLingual: new Set(),
|
|
302
314
|
caption: new Set(),
|
|
303
315
|
},
|
package/lib/types/type.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { langSchema, localizedTextSchema, mulmoBeatSchema, mulmoScriptSchema, mulmoStudioSchema, mulmoStudioBeatSchema, mulmoStoryboardSchema, mulmoStoryboardSceneSchema, mulmoStudioMultiLingualSchema, mulmoStudioMultiLingualDataSchema, speakerDictionarySchema, mulmoImageParamsSchema, mulmoSpeechParamsSchema, textSlideParamsSchema, speechOptionsSchema, mulmoCanvasDimensionSchema, mulmoScriptTemplateSchema, text2ImageProviderSchema, text2SpeechProviderSchema, mulmoPresentationStyleSchema, multiLingualTextsSchema, mulmoMermaidMediaSchema, mulmoTextSlideMediaSchema, mulmoMarkdownMediaSchema, mulmoImageMediaSchema, mulmoChartMediaSchema, mediaSourceSchema } from "./schema.js";
|
|
1
|
+
import { langSchema, localizedTextSchema, mulmoBeatSchema, mulmoScriptSchema, mulmoStudioSchema, mulmoStudioBeatSchema, mulmoStoryboardSchema, mulmoStoryboardSceneSchema, mulmoStudioMultiLingualSchema, mulmoStudioMultiLingualDataSchema, speakerDictionarySchema, mulmoImageParamsSchema, mulmoMovieParamsSchema, mulmoSpeechParamsSchema, textSlideParamsSchema, speechOptionsSchema, mulmoCanvasDimensionSchema, mulmoScriptTemplateSchema, text2ImageProviderSchema, text2MovieProviderSchema, text2SpeechProviderSchema, mulmoPresentationStyleSchema, multiLingualTextsSchema, mulmoMermaidMediaSchema, mulmoTextSlideMediaSchema, mulmoMarkdownMediaSchema, mulmoImageMediaSchema, mulmoChartMediaSchema, mediaSourceSchema } from "./schema.js";
|
|
2
2
|
import { pdf_modes, pdf_sizes, storyToScriptGenerateMode } from "../utils/const.js";
|
|
3
3
|
import { LLM } from "../utils/utils.js";
|
|
4
4
|
import { z } from "zod";
|
|
@@ -10,6 +10,7 @@ export type SpeechOptions = z.infer<typeof speechOptionsSchema>;
|
|
|
10
10
|
export type MulmoImageParams = z.infer<typeof mulmoImageParamsSchema>;
|
|
11
11
|
export type TextSlideParams = z.infer<typeof textSlideParamsSchema>;
|
|
12
12
|
export type Text2ImageProvider = z.infer<typeof text2ImageProviderSchema>;
|
|
13
|
+
export type Text2MovieProvider = z.infer<typeof text2MovieProviderSchema>;
|
|
13
14
|
export type Text2SpeechProvider = z.infer<typeof text2SpeechProviderSchema>;
|
|
14
15
|
export type LocalizedText = z.infer<typeof localizedTextSchema>;
|
|
15
16
|
export type MulmoScript = z.infer<typeof mulmoScriptSchema>;
|
|
@@ -24,6 +25,7 @@ export type MulmoScriptTemplate = z.infer<typeof mulmoScriptTemplateSchema>;
|
|
|
24
25
|
export type MulmoStudioMultiLingual = z.infer<typeof mulmoStudioMultiLingualSchema>;
|
|
25
26
|
export type MulmoStudioMultiLingualData = z.infer<typeof mulmoStudioMultiLingualDataSchema>;
|
|
26
27
|
export type MultiLingualTexts = z.infer<typeof multiLingualTextsSchema>;
|
|
28
|
+
export type MulmoMovieParams = z.infer<typeof mulmoMovieParamsSchema>;
|
|
27
29
|
export type MulmoTextSlideMedia = z.infer<typeof mulmoTextSlideMediaSchema>;
|
|
28
30
|
export type MulmoMarkdownMedia = z.infer<typeof mulmoMarkdownMediaSchema>;
|
|
29
31
|
export type MulmoImageMedia = z.infer<typeof mulmoImageMediaSchema>;
|
|
@@ -5,6 +5,7 @@ export declare const createOrUpdateStudioData: (_mulmoScript: MulmoScript, curre
|
|
|
5
5
|
hash?: string | undefined;
|
|
6
6
|
audioFile?: string | undefined;
|
|
7
7
|
imageFile?: string | undefined;
|
|
8
|
+
movieFile?: string | undefined;
|
|
8
9
|
captionFile?: string | undefined;
|
|
9
10
|
}[];
|
|
10
11
|
multiLingual: {
|
|
@@ -198,6 +199,7 @@ export declare const createOrUpdateStudioData: (_mulmoScript: MulmoScript, curre
|
|
|
198
199
|
} | undefined;
|
|
199
200
|
imageNames?: string[] | undefined;
|
|
200
201
|
imagePrompt?: string | undefined;
|
|
202
|
+
moviePrompt?: string | undefined;
|
|
201
203
|
}[];
|
|
202
204
|
lang?: string | undefined;
|
|
203
205
|
title?: string | undefined;
|
|
@@ -227,6 +229,10 @@ export declare const createOrUpdateStudioData: (_mulmoScript: MulmoScript, curre
|
|
|
227
229
|
textSlideParams?: {
|
|
228
230
|
cssStyles: string | string[];
|
|
229
231
|
} | undefined;
|
|
232
|
+
movieParams?: {
|
|
233
|
+
model?: string | undefined;
|
|
234
|
+
provider?: "openai" | "google" | undefined;
|
|
235
|
+
} | undefined;
|
|
230
236
|
omitCaptions?: boolean | undefined;
|
|
231
237
|
description?: string | undefined;
|
|
232
238
|
references?: {
|
|
@@ -250,6 +256,7 @@ export declare const createOrUpdateStudioData: (_mulmoScript: MulmoScript, curre
|
|
|
250
256
|
};
|
|
251
257
|
inBeatSession: {
|
|
252
258
|
image: Set<number>;
|
|
259
|
+
movie: Set<number>;
|
|
253
260
|
audio: Set<number>;
|
|
254
261
|
multiLingual: Set<number>;
|
|
255
262
|
caption: Set<number>;
|
package/lib/utils/utils.d.ts
CHANGED
|
@@ -15,3 +15,4 @@ export declare const chunkArray: <T>(array: T[], size?: number) => T[][];
|
|
|
15
15
|
export declare const isHttp: (fileOrUrl: string) => boolean;
|
|
16
16
|
export declare const text2hash: (input: string) => string;
|
|
17
17
|
export declare const localizedText: (beat: MulmoBeat, multiLingualData?: MulmoStudioMultiLingualData, lang?: string) => string;
|
|
18
|
+
export declare const sleep: (milliseconds: number) => Promise<unknown>;
|
package/lib/utils/utils.js
CHANGED
package/package.json
CHANGED
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$mulmocast": {
|
|
3
|
+
"version": "1.0",
|
|
4
|
+
"credit": "closing"
|
|
5
|
+
},
|
|
6
|
+
"title": "[TITLE: Brief, engaging title for the topic]",
|
|
7
|
+
"lang": "en",
|
|
8
|
+
"references": [
|
|
9
|
+
{
|
|
10
|
+
"url": "[SOURCE_URL: URL of the source material]",
|
|
11
|
+
"title": "[SOURCE_TITLE: Title of the referenced article, or paper]",
|
|
12
|
+
"type": "[SOURCE_TYPE: article, paper]"
|
|
13
|
+
}
|
|
14
|
+
],
|
|
15
|
+
"movieParams": {
|
|
16
|
+
"provider": "google"
|
|
17
|
+
},
|
|
18
|
+
"beats": [
|
|
19
|
+
{
|
|
20
|
+
"text": "[OPENING_BEAT: Introduce the topic with a hook. Reference the source material and set up why this topic matters. Usually 2-3 sentences that grab attention and provide context.]",
|
|
21
|
+
"imagePrompt": "[IMAGE_PROMPT: A prompt for the image to be generated for this beat.]",
|
|
22
|
+
"moviePrompt": "[MOVIE_PROMPT: A movie prompt for that image.]"
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
"text": "[MAIN_CONCEPT: Define or explain the core concept/idea. This should be the central focus of your narrative. Keep it clear and accessible.]",
|
|
26
|
+
"imagePrompt": "[IMAGE_PROMPT: A prompt for the image to be generated for this beat.]",
|
|
27
|
+
"moviePrompt": "[MOVIE_PROMPT: A movie prompt for that image.]"
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
"text": "[SUPPORTING_DETAIL_1: Additional context, examples, or elaboration that helps illustrate the main concept. This could include how it works, why it's important, or real-world applications.]",
|
|
31
|
+
"imagePrompt": "[IMAGE_PROMPT: A prompt for the image to be generated for this beat.]",
|
|
32
|
+
"moviePrompt": "[MOVIE_PROMPT: A movie prompt for that image.]"
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
"text": "[SUPPORTING_DETAIL_2: Continue with more examples, deeper explanation, or different aspects of the topic if needed.]",
|
|
36
|
+
"imagePrompt": "[IMAGE_PROMPT: A prompt for the image to be generated for this beat.]",
|
|
37
|
+
"moviePrompt": "[MOVIE_PROMPT: A movie prompt for that image.]"
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
"text": "[ADDITIONAL_BEATS: Add more beats as necessary to fully explore the topic. Complex topics may require 6-10+ beats to cover adequately. Each beat should advance the narrative or provide valuable information.]",
|
|
41
|
+
"imagePrompt": "[IMAGE_PROMPT: A prompt for the image to be generated for this beat.]",
|
|
42
|
+
"moviePrompt": "[MOVIE_PROMPT: A movie prompt for that image.]"
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
"text": "[CONCLUSION/IMPACT: Wrap up with the significance, implications, or key takeaway. Help the audience understand why this matters to them.]",
|
|
46
|
+
"imagePrompt": "[IMAGE_PROMPT: A prompt for the image to be generated for this beat.]",
|
|
47
|
+
"moviePrompt": "[MOVIE_PROMPT: A movie prompt for that image.]"
|
|
48
|
+
}
|
|
49
|
+
]
|
|
50
|
+
}
|