mulmocast 1.1.1 → 1.1.2
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 +1 -1
- package/assets/templates/ani.json +1 -1
- package/assets/templates/ani_ja.json +1 -1
- package/assets/templates/business.json +1 -1
- package/assets/templates/characters.json +1 -1
- package/assets/templates/children_book.json +1 -1
- package/assets/templates/coding.json +1 -1
- package/assets/templates/comic_strips.json +1 -1
- package/assets/templates/drslump_comic.json +1 -1
- package/assets/templates/ghibli_comic.json +1 -1
- package/assets/templates/ghibli_image_only.json +1 -1
- package/assets/templates/ghibli_shorts.json +1 -1
- package/assets/templates/ghost_comic.json +1 -1
- package/assets/templates/html.json +1 -1
- package/assets/templates/onepiece_comic.json +1 -1
- package/assets/templates/portrait_movie.json +1 -1
- package/assets/templates/realistic_movie.json +1 -1
- package/assets/templates/sensei_and_taro.json +1 -1
- package/assets/templates/shorts.json +1 -1
- package/assets/templates/text_and_image.json +1 -1
- package/assets/templates/text_only.json +1 -1
- package/assets/templates/trailer.json +1 -1
- package/lib/actions/image_agents.d.ts +3 -0
- package/lib/actions/image_agents.js +3 -1
- package/lib/actions/images.js +5 -5
- package/lib/agents/lipsync_replicate_agent.js +19 -4
- package/lib/agents/movie_replicate_agent.js +10 -1
- package/lib/cli/commands/tool/prompt/builder.js +2 -2
- package/lib/cli/commands/tool/scripting/builder.js +2 -2
- package/lib/cli/commands/tool/story_to_script/builder.js +2 -2
- package/lib/data/promptTemplates.d.ts +48 -294
- package/lib/data/promptTemplates.js +25 -411
- package/lib/data/scriptTemplates.d.ts +575 -151
- package/lib/data/scriptTemplates.js +956 -437
- package/lib/index.common.d.ts +1 -0
- package/lib/index.common.js +1 -0
- package/lib/methods/index.d.ts +0 -1
- package/lib/methods/index.js +0 -1
- package/lib/methods/mulmo_presentation_style.d.ts +2 -0
- package/lib/methods/mulmo_script_template.d.ts +2 -2
- package/lib/tools/create_mulmo_script_from_url.js +14 -2
- package/lib/tools/create_mulmo_script_interactively.js +2 -1
- package/lib/tools/dump_prompt.js +1 -1
- package/lib/tools/story_to_script.js +5 -4
- package/lib/types/schema.d.ts +92 -92
- package/lib/types/schema.js +2 -2
- package/lib/types/type.d.ts +3 -3
- package/lib/utils/context.d.ts +6 -6
- package/lib/utils/file.d.ts +4 -9
- package/lib/utils/file.js +26 -49
- package/lib/utils/inquirer.js +2 -2
- package/lib/utils/preprocess.d.ts +6 -6
- package/lib/utils/prompt.d.ts +1 -2
- package/lib/utils/prompt.js +0 -14
- package/lib/utils/provider2agent.d.ts +2 -0
- package/lib/utils/provider2agent.js +20 -1
- package/lib/utils/system_prompt.d.ts +1 -0
- package/lib/utils/system_prompt.js +1 -0
- package/lib/utils/templates.d.ts +3 -0
- package/lib/utils/templates.js +46 -0
- package/package.json +2 -2
|
@@ -2,5 +2,5 @@
|
|
|
2
2
|
"title": "Business presentation",
|
|
3
3
|
"description": "Template for business presentation.",
|
|
4
4
|
"systemPrompt": "Generate a script for a business presentation of the given topic. Use textSlides, markdown, mermaid, or chart to show slides. Extract image links in the article (from <img> tag) to reuse them in the presentation. Mention the reference in one of beats, if it exists. Use the JSON below as a template. chartData is the data for Chart.js",
|
|
5
|
-
"scriptName": "business
|
|
5
|
+
"scriptName": "business"
|
|
6
6
|
}
|
|
@@ -12,5 +12,5 @@
|
|
|
12
12
|
}
|
|
13
13
|
},
|
|
14
14
|
"systemPrompt": "Generate a script for a the given story with multiple characters. Generate image prompts for each character, and make references to them in the beats. Use the JSON below as a template.",
|
|
15
|
-
"scriptName": "image_refs
|
|
15
|
+
"scriptName": "image_refs"
|
|
16
16
|
}
|
|
@@ -15,5 +15,5 @@
|
|
|
15
15
|
"style": "A hand-drawn style illustration with a warm, nostalgic atmosphere. The background is rich with natural scenery—lush forests, cloudy skies, and traditional Japanese architecture. Characters have expressive eyes, soft facial features, and are portrayed with gentle lighting and subtle shading. The color palette is muted yet vivid, using earthy tones and watercolor-like textures. The overall scene feels magical and peaceful, with a sense of quiet wonder and emotional depth, reminiscent of classic 1980s and 1990s Japanese animation."
|
|
16
16
|
}
|
|
17
17
|
},
|
|
18
|
-
"scriptName": "children_book
|
|
18
|
+
"scriptName": "children_book"
|
|
19
19
|
}
|
|
@@ -2,5 +2,5 @@
|
|
|
2
2
|
"title": "Coding presentation",
|
|
3
3
|
"description": "Template for software and coding presentation.",
|
|
4
4
|
"systemPrompt": "Generate a script for a technical presentation of the given topic. Use markdown with a code block to show some code on a slide. Avoid long coding examples, which may not fit in a single slide. Mention the reference in one of beats, if it exists. Use the JSON below as a template.",
|
|
5
|
-
"scriptName": "coding
|
|
5
|
+
"scriptName": "coding"
|
|
6
6
|
}
|
|
@@ -15,5 +15,5 @@
|
|
|
15
15
|
"style": "<style>A multi panel comic strips. 1990s American workplace humor. Clean, minimalist line art with muted colors. One character is a nerdy office worker with glasses</style>"
|
|
16
16
|
}
|
|
17
17
|
},
|
|
18
|
-
"scriptName": "text_only_template
|
|
18
|
+
"scriptName": "text_only_template"
|
|
19
19
|
}
|
|
@@ -2,5 +2,5 @@
|
|
|
2
2
|
"title": "Business presentation in HTML",
|
|
3
3
|
"description": "Template for business presentation in HTML.",
|
|
4
4
|
"systemPrompt": "Generate a script for a business presentation of the given topic. Another LLM will generate actual slides from the prompt and data for each beat. Adding optional data would help it to generate more compelling slide. Mention the reference in one of beats, if it exists. The valid type of reference is 'article', 'paper', 'image', 'video', 'audio'. Use the JSON below as a template.",
|
|
5
|
-
"scriptName": "html
|
|
5
|
+
"scriptName": "html"
|
|
6
6
|
}
|
|
@@ -2,5 +2,5 @@
|
|
|
2
2
|
"title": "Text and Image",
|
|
3
3
|
"description": "Template for Text and Image Script.",
|
|
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 imagePrompt of that beat. Mention the reference in one of beats, if it exists. Use the JSON below as a template.",
|
|
5
|
-
"scriptName": "image_prompts_template
|
|
5
|
+
"scriptName": "image_prompts_template"
|
|
6
6
|
}
|
|
@@ -2,5 +2,5 @@
|
|
|
2
2
|
"title": "Text Only",
|
|
3
3
|
"description": "Template for Text Only Script.",
|
|
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
|
-
"scriptName": "text_only_template
|
|
5
|
+
"scriptName": "text_only_template"
|
|
6
6
|
}
|
|
@@ -28,6 +28,7 @@ export declare const imagePreprocessAgent: (namedInputs: {
|
|
|
28
28
|
defaultModel: string;
|
|
29
29
|
};
|
|
30
30
|
audioFile?: string;
|
|
31
|
+
beatDuration?: number;
|
|
31
32
|
htmlPrompt?: undefined;
|
|
32
33
|
htmlPath?: undefined;
|
|
33
34
|
htmlImageSystemPrompt?: undefined;
|
|
@@ -65,6 +66,7 @@ export declare const imagePreprocessAgent: (namedInputs: {
|
|
|
65
66
|
defaultModel: string;
|
|
66
67
|
};
|
|
67
68
|
audioFile?: string;
|
|
69
|
+
beatDuration?: number;
|
|
68
70
|
htmlPrompt?: undefined;
|
|
69
71
|
htmlPath?: undefined;
|
|
70
72
|
htmlImageSystemPrompt?: undefined;
|
|
@@ -105,6 +107,7 @@ export declare const imagePreprocessAgent: (namedInputs: {
|
|
|
105
107
|
defaultModel: string;
|
|
106
108
|
};
|
|
107
109
|
audioFile?: string;
|
|
110
|
+
beatDuration?: number;
|
|
108
111
|
htmlPrompt?: undefined;
|
|
109
112
|
htmlPath?: undefined;
|
|
110
113
|
htmlImageSystemPrompt?: undefined;
|
|
@@ -11,6 +11,7 @@ const htmlStyle = (context, beat) => {
|
|
|
11
11
|
};
|
|
12
12
|
export const imagePreprocessAgent = async (namedInputs) => {
|
|
13
13
|
const { context, beat, index, imageRefs } = namedInputs;
|
|
14
|
+
const studioBeat = context.studio.beats[index];
|
|
14
15
|
const imagePath = getBeatPngImagePath(context, index);
|
|
15
16
|
if (beat.htmlPrompt) {
|
|
16
17
|
const htmlPrompt = MulmoBeatMethods.getHtmlPrompt(beat);
|
|
@@ -22,6 +23,7 @@ export const imagePreprocessAgent = async (namedInputs) => {
|
|
|
22
23
|
const returnValue = {
|
|
23
24
|
imageParams: imageAgentInfo.imageParams,
|
|
24
25
|
movieFile: beat.moviePrompt ? moviePaths.movieFile : undefined,
|
|
26
|
+
beatDuration: beat.duration ?? studioBeat?.duration,
|
|
25
27
|
};
|
|
26
28
|
if (beat.soundEffectPrompt) {
|
|
27
29
|
returnValue.soundEffectAgentInfo = MulmoPresentationStyleMethods.getSoundEffectAgentInfo(context.presentationStyle, beat);
|
|
@@ -35,7 +37,7 @@ export const imagePreprocessAgent = async (namedInputs) => {
|
|
|
35
37
|
returnValue.lipSyncModel = beat.lipSyncParams?.model ?? context.presentationStyle.lipSyncParams?.model ?? returnValue.lipSyncAgentInfo.defaultModel;
|
|
36
38
|
returnValue.lipSyncFile = moviePaths.lipSyncFile;
|
|
37
39
|
// Audio file will be set from the beat's audio file when available
|
|
38
|
-
returnValue.audioFile =
|
|
40
|
+
returnValue.audioFile = studioBeat?.audioFile;
|
|
39
41
|
}
|
|
40
42
|
if (beat.image) {
|
|
41
43
|
const plugin = MulmoBeatMethods.getPlugin(beat);
|
package/lib/actions/images.js
CHANGED
|
@@ -155,7 +155,7 @@ const beat_graph_data = {
|
|
|
155
155
|
},
|
|
156
156
|
params: {
|
|
157
157
|
model: ":preprocessor.movieAgentInfo.movieParams.model",
|
|
158
|
-
duration: ":
|
|
158
|
+
duration: ":preprocessor.beatDuration",
|
|
159
159
|
canvasSize: ":context.presentationStyle.canvasSize",
|
|
160
160
|
},
|
|
161
161
|
},
|
|
@@ -175,8 +175,8 @@ const beat_graph_data = {
|
|
|
175
175
|
},
|
|
176
176
|
audioChecker: {
|
|
177
177
|
agent: async (namedInputs) => {
|
|
178
|
+
// NOTE: We intentinonally don't check lipSyncFile here.
|
|
178
179
|
if (namedInputs.soundEffectFile) {
|
|
179
|
-
// NOTE: We intentinonally don't check lipSyncFile here.
|
|
180
180
|
return { hasMovieAudio: true };
|
|
181
181
|
}
|
|
182
182
|
const sourceFile = namedInputs.movieFile || namedInputs.imageFile;
|
|
@@ -187,7 +187,7 @@ const beat_graph_data = {
|
|
|
187
187
|
return { hasMovieAudio: hasAudio };
|
|
188
188
|
},
|
|
189
189
|
inputs: {
|
|
190
|
-
onComplete: [":movieGenerator", ":htmlImageGenerator", ":soundEffectGenerator"],
|
|
190
|
+
onComplete: [":movieGenerator", ":htmlImageGenerator", ":soundEffectGenerator"],
|
|
191
191
|
movieFile: ":preprocessor.movieFile",
|
|
192
192
|
imageFile: ":preprocessor.imagePath",
|
|
193
193
|
soundEffectFile: ":preprocessor.soundEffectFile",
|
|
@@ -203,7 +203,7 @@ const beat_graph_data = {
|
|
|
203
203
|
soundEffectFile: ":preprocessor.soundEffectFile",
|
|
204
204
|
params: {
|
|
205
205
|
model: ":preprocessor.soundEffectModel",
|
|
206
|
-
duration: ":
|
|
206
|
+
duration: ":preprocessor.beatDuration",
|
|
207
207
|
},
|
|
208
208
|
cache: {
|
|
209
209
|
force: [":context.force"],
|
|
@@ -225,7 +225,7 @@ const beat_graph_data = {
|
|
|
225
225
|
lipSyncFile: ":preprocessor.lipSyncFile",
|
|
226
226
|
params: {
|
|
227
227
|
model: ":preprocessor.lipSyncModel",
|
|
228
|
-
duration: ":
|
|
228
|
+
duration: ":preprocessor.beatDuration",
|
|
229
229
|
},
|
|
230
230
|
cache: {
|
|
231
231
|
force: [":context.force"],
|
|
@@ -17,12 +17,27 @@ export const lipSyncReplicateAgent = async ({ namedInputs, params, config, }) =>
|
|
|
17
17
|
const videoUri = `data:video/quicktime;base64,${videoBuffer.toString("base64")}`;
|
|
18
18
|
const audioUri = `data:audio/wav;base64,${audioBuffer.toString("base64")}`;
|
|
19
19
|
const input = {
|
|
20
|
-
video:
|
|
21
|
-
|
|
22
|
-
|
|
20
|
+
video: undefined,
|
|
21
|
+
video_input: undefined,
|
|
22
|
+
video_url: undefined,
|
|
23
|
+
audio: undefined,
|
|
24
|
+
audio_input: undefined,
|
|
25
|
+
audio_file: undefined,
|
|
23
26
|
};
|
|
27
|
+
const modelParams = provider2LipSyncAgent.replicate.modelParams[model];
|
|
28
|
+
if (!modelParams) {
|
|
29
|
+
throw new Error(`Model ${model} is not supported`);
|
|
30
|
+
}
|
|
31
|
+
const videoParam = modelParams.video;
|
|
32
|
+
const audioParam = modelParams.audio;
|
|
33
|
+
if (videoParam === "video" || videoParam === "video_input" || videoParam === "video_url") {
|
|
34
|
+
input[videoParam] = videoUri;
|
|
35
|
+
}
|
|
36
|
+
if (audioParam === "audio" || audioParam === "audio_input" || audioParam === "audio_file") {
|
|
37
|
+
input[audioParam] = audioUri;
|
|
38
|
+
}
|
|
39
|
+
const model_identifier = provider2LipSyncAgent.replicate.modelParams[model]?.identifier ?? model;
|
|
24
40
|
try {
|
|
25
|
-
const model_identifier = provider2LipSyncAgent.replicate.modelParams[model]?.identifier ?? model;
|
|
26
41
|
const output = await replicate.run(model_identifier, {
|
|
27
42
|
input,
|
|
28
43
|
});
|
|
@@ -71,7 +71,16 @@ export const movieReplicateAgent = async ({ namedInputs, params, config, }) => {
|
|
|
71
71
|
if (!provider2MovieAgent.replicate.modelParams[model]) {
|
|
72
72
|
throw new Error(`Model ${model} is not supported`);
|
|
73
73
|
}
|
|
74
|
-
const duration =
|
|
74
|
+
const duration = (() => {
|
|
75
|
+
const durations = provider2MovieAgent.replicate.modelParams[model].durations;
|
|
76
|
+
if (params.duration) {
|
|
77
|
+
const largerDurations = durations.filter((d) => d >= params.duration);
|
|
78
|
+
return largerDurations.length > 0 ? largerDurations[0] : durations[durations.length - 1];
|
|
79
|
+
}
|
|
80
|
+
else {
|
|
81
|
+
return durations[0];
|
|
82
|
+
}
|
|
83
|
+
})();
|
|
75
84
|
if (!provider2MovieAgent.replicate.modelParams[model].durations.includes(duration)) {
|
|
76
85
|
throw new Error(`Duration ${duration} is not supported for model ${model}. Supported durations: ${provider2MovieAgent.replicate.modelParams[model].durations.join(", ")}`);
|
|
77
86
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
const availableTemplateNames =
|
|
1
|
+
import { getAvailablePromptTemplates } from "../../../../utils/file.js";
|
|
2
|
+
const availableTemplateNames = getAvailablePromptTemplates().map((template) => template.filename);
|
|
3
3
|
export const builder = (yargs) => {
|
|
4
4
|
return yargs.option("t", {
|
|
5
5
|
alias: "template",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { llm } from "../../../../utils/provider2agent.js";
|
|
2
|
-
import {
|
|
3
|
-
const availableTemplateNames =
|
|
2
|
+
import { getAvailablePromptTemplates } from "../../../../utils/file.js";
|
|
3
|
+
const availableTemplateNames = getAvailablePromptTemplates().map((template) => template.filename);
|
|
4
4
|
export const builder = (yargs) => {
|
|
5
5
|
return yargs
|
|
6
6
|
.option("o", {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { getAvailablePromptTemplates } from "../../../../utils/file.js";
|
|
2
2
|
import { llm } from "../../../../utils/provider2agent.js";
|
|
3
3
|
import { storyToScriptGenerateMode } from "../../../../utils/const.js";
|
|
4
|
-
const availableTemplateNames =
|
|
4
|
+
const availableTemplateNames = getAvailablePromptTemplates().map((template) => template.filename);
|
|
5
5
|
export const builder = (yargs) => {
|
|
6
6
|
return yargs
|
|
7
7
|
.option("o", {
|