mulmocast 1.2.0 → 1.2.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.
Files changed (44) hide show
  1. package/assets/templates/akira_comic.json +1 -1
  2. package/assets/templates/ani.json +1 -1
  3. package/assets/templates/business.json +1 -1
  4. package/assets/templates/characters.json +1 -1
  5. package/assets/templates/children_book.json +1 -1
  6. package/assets/templates/coding.json +1 -1
  7. package/assets/templates/comic_strips.json +1 -1
  8. package/assets/templates/drslump_comic.json +1 -1
  9. package/assets/templates/ghibli_comic.json +1 -1
  10. package/assets/templates/ghibli_image_only.json +1 -1
  11. package/assets/templates/ghibli_shorts.json +1 -1
  12. package/assets/templates/ghost_comic.json +1 -1
  13. package/assets/templates/html.json +1 -1
  14. package/assets/templates/onepiece_comic.json +1 -1
  15. package/assets/templates/portrait_movie.json +1 -1
  16. package/assets/templates/realistic_movie.json +1 -1
  17. package/assets/templates/sensei_and_taro.json +1 -1
  18. package/assets/templates/shorts.json +1 -1
  19. package/assets/templates/trailer.json +1 -1
  20. package/lib/actions/movie.js +2 -2
  21. package/lib/agents/add_bgm_agent.js +2 -1
  22. package/lib/agents/image_openai_agent.js +1 -0
  23. package/lib/cli/commands/tool/prompt/handler.js +1 -1
  24. package/lib/data/promptTemplates.d.ts +9 -81
  25. package/lib/data/promptTemplates.js +58 -112
  26. package/lib/data/scriptTemplates.d.ts +2 -2
  27. package/lib/data/scriptTemplates.js +2 -0
  28. package/lib/data/templateDataSet.d.ts +0 -4
  29. package/lib/data/templateDataSet.js +21 -40
  30. package/lib/methods/mulmo_presentation_style.js +1 -1
  31. package/lib/methods/mulmo_studio_context.d.ts +1 -0
  32. package/lib/methods/mulmo_studio_context.js +7 -0
  33. package/lib/tools/dump_prompt.d.ts +2 -1
  34. package/lib/tools/dump_prompt.js +3 -2
  35. package/lib/types/agent.d.ts +1 -0
  36. package/lib/utils/utils.d.ts +0 -1
  37. package/lib/utils/utils.js +0 -3
  38. package/package.json +2 -3
  39. package/assets/templates/ani_ja.json +0 -44
  40. package/assets/templates/podcast_standard.json +0 -5
  41. package/assets/templates/text_and_image.json +0 -6
  42. package/assets/templates/text_only.json +0 -6
  43. package/scripts/test/test_hello_bgm_0.json +0 -21
  44. package/scripts/test/test_media_mock.json +0 -245
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "title": "Akira style",
3
3
  "description": "Template for Akira style comic presentation.",
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.",
4
+ "systemPrompt": "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": {
7
7
  "version": "1.1",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "title": "Presentation with Ani",
3
3
  "description": "Template for presentation with Ani.",
4
- "systemPrompt": "Generate a script for a presentation of the given topic. 言葉づかいは少しツンデレにして。Another AI will generate comic for each beat based on the image prompt of that beat. You don't need to specify the style of the image, just describe the scene. Mention the reference in one of beats, if it exists. Use the JSON below as a template. Create appropriate amount of beats, and make sure the beats are coherent and flow well.",
4
+ "systemPrompt": "言葉づかいは思いっきりツンデレにして。Another AI will generate comic for each beat based on the image prompt of that beat. You don't need to specify the style of the image, just describe the scene. Mention the reference in one of beats, if it exists. Use the JSON below as a template. Create appropriate amount of beats, and make sure the beats are coherent and flow well.",
5
5
  "presentationStyle": {
6
6
  "$mulmocast": {
7
7
  "version": "1.1",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "title": "Business presentation",
3
3
  "description": "Template for business presentation.",
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",
4
+ "systemPrompt": "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
5
  "scriptName": "business.json"
6
6
  }
@@ -11,6 +11,6 @@
11
11
  "height": 1024
12
12
  }
13
13
  },
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.",
14
+ "systemPrompt": "Use multiple characters. Generate image prompts for each character, and make references to them in the beats. Use the JSON below as a template.",
15
15
  "scriptName": "image_refs.json"
16
16
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "title": "Children Book",
3
3
  "description": "Template for children book.",
4
- "systemPrompt": "Please generate a script for a children book on the topic provided by the user. Each page (=beat) must haven an image prompt appropriate for the text.",
4
+ "systemPrompt": "This script is for a children book. Each page (=beat) must haven an image prompt appropriate for the text.",
5
5
  "presentationStyle": {
6
6
  "$mulmocast": {
7
7
  "version": "1.1",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "title": "Coding presentation",
3
3
  "description": "Template for software and coding presentation.",
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.",
4
+ "systemPrompt": "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
5
  "scriptName": "coding.json"
6
6
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "title": "American Comic Strips",
3
3
  "description": "Template for Dilbert-style comic strips.",
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.",
4
+ "systemPrompt": "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": {
7
7
  "version": "1.1",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "title": "Dr. Slump Style",
3
3
  "description": "Template for Dr. Slump style comic presentation.",
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.",
4
+ "systemPrompt": "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": {
7
7
  "version": "1.1",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "title": "Ghibli comic style",
3
3
  "description": "Template for Ghibli-style comic presentation.",
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.",
4
+ "systemPrompt": "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": {
7
7
  "version": "1.1",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "title": "Ghibli comic image-only",
3
3
  "description": "Template for Ghibli-style image-only comic presentation.",
4
- "systemPrompt": "Generate a script for a presentation of the given topic. Another AI will generate an image for each beat based on the text description of that beat. Use the JSON below as a template.",
4
+ "systemPrompt": "Another AI will generate an image for each beat based on the text description of that beat. Use the JSON below as a template.",
5
5
  "presentationStyle": {
6
6
  "$mulmocast": {
7
7
  "version": "1.1",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "title": "Ghibli style for YouTube Shorts",
3
3
  "description": "Template for Ghibli-style comic presentation.",
4
- "systemPrompt": "Generate a Japanese script for a Youtube shorts 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.",
4
+ "systemPrompt": "This script is for YouTube shorts. 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": {
7
7
  "version": "1.1",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "title": "Ghost in the shell style",
3
3
  "description": "Template for Ghost in the shell style comic presentation.",
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.",
4
+ "systemPrompt": "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": {
7
7
  "version": "1.1",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "title": "Business presentation in HTML",
3
3
  "description": "Template for business presentation in HTML.",
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.",
4
+ "systemPrompt": "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
5
  "presentationStyle": {
6
6
  "$mulmocast": {
7
7
  "version": "1.1",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "title": "One Piece style",
3
3
  "description": "Template for One Piece style comic presentation.",
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.",
4
+ "systemPrompt": "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": {
7
7
  "version": "1.1",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "title": "Photo realistic movie (portrait)",
3
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.",
4
+ "systemPrompt": "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
5
  "presentationStyle": {
6
6
  "$mulmocast": {
7
7
  "version": "1.1",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "title": "Photo realistic movie template",
3
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.",
4
+ "systemPrompt": "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
5
  "presentationStyle": {
6
6
  "$mulmocast": {
7
7
  "version": "1.1",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "title": "Student and Teacher",
3
3
  "description": "Interactive discussion between a student and teacher",
4
- "systemPrompt": "この件について、内容全てを高校生にも分かるように、太郎くん(Student)と先生(Teacher)の会話、という形の台本をArtifactとして作って。ただし要点はしっかりと押さえて。以下に別のトピックに関するサンプルを貼り付けます。このJSONフォーマットに従って。",
4
+ "systemPrompt": "全てを高校生にも分かるように、太郎くん(Student)と先生(Teacher)の会話、という形の台本にして。ただし要点はしっかりと押さえて。以下に別のトピックに関するサンプルを貼り付けます。このJSONフォーマットに従って。",
5
5
  "presentationStyle": {
6
6
  "$mulmocast": {
7
7
  "version": "1.1",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "title": "Short movie template",
3
3
  "description": "Template for Youtube shorts.",
4
- "systemPrompt": "Generate a script for a Youtube shorts of the given topic. The first beat should be a hook, which describes the topic. Another AI will generate images for each beat based on the image prompt of that beat. Movie prompts must be written in English.",
4
+ "systemPrompt": "This script is for YouTube shorts. The first beat should be a hook, which describes the topic. Another AI will generate images for each beat based on the image prompt of that beat. Movie prompts must be written in English.",
5
5
  "presentationStyle": {
6
6
  "$mulmocast": {
7
7
  "version": "1.1"
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "title": "Movie Trailer template",
3
3
  "description": "Template for A Movie Trailer.",
4
- "systemPrompt": "Generate a script for a movie trailer of the given story. Another AI will generate images for each beat based on the image prompt of that beat. Movie prompts must be written in English.",
4
+ "systemPrompt": "This script is for a movie trailer. Another AI will generate images for each beat based on the image prompt of that beat. Movie prompts must be written in English.",
5
5
  "presentationStyle": {
6
6
  "$mulmocast": {
7
7
  "version": "1.1"
@@ -80,7 +80,7 @@ const getOutputOption = (audioId, videoId) => {
80
80
  const addCaptions = (ffmpegContext, concatVideoId, context, caption) => {
81
81
  const beatsWithCaptions = context.studio.beats.filter(({ captionFile }) => captionFile);
82
82
  if (caption && beatsWithCaptions.length > 0) {
83
- const introPadding = context.presentationStyle.audioParams.introPadding;
83
+ const introPadding = MulmoStudioContextMethods.getIntroPadding(context);
84
84
  return beatsWithCaptions.reduce((acc, beat, index) => {
85
85
  const { startAt, duration, captionFile } = beat;
86
86
  if (startAt !== undefined && duration !== undefined && captionFile !== undefined) {
@@ -168,7 +168,7 @@ const createVideo = async (audioArtifactFilePath, outputVideoPath, context) => {
168
168
  const extraPadding = (() => {
169
169
  // We need to consider only intro and outro padding because the other paddings were already added to the beat.duration
170
170
  if (index === 0) {
171
- return context.presentationStyle.audioParams.introPadding;
171
+ return MulmoStudioContextMethods.getIntroPadding(context);
172
172
  }
173
173
  else if (index === context.studio.beats.length - 1) {
174
174
  return context.presentationStyle.audioParams.outroPadding;
@@ -1,6 +1,7 @@
1
1
  import fs from "fs";
2
2
  import { GraphAILogger } from "graphai";
3
3
  import { FfmpegContextAddInput, FfmpegContextInit, FfmpegContextGenerateOutput, ffmpegGetMediaDuration } from "../utils/ffmpeg_utils.js";
4
+ import { MulmoStudioContextMethods } from "../methods/mulmo_studio_context.js";
4
5
  const addBGMAgent = async ({ namedInputs, params, }) => {
5
6
  const { voiceFile, outputFile, context } = namedInputs;
6
7
  const { musicFile } = params;
@@ -11,7 +12,7 @@ const addBGMAgent = async ({ namedInputs, params, }) => {
11
12
  throw new Error(`AddBGMAgent musicFile not exist: ${musicFile}`);
12
13
  }
13
14
  const { duration: speechDuration } = await ffmpegGetMediaDuration(voiceFile);
14
- const introPadding = context.presentationStyle.audioParams.introPadding;
15
+ const introPadding = MulmoStudioContextMethods.getIntroPadding(context);
15
16
  const outroPadding = context.presentationStyle.audioParams.outroPadding;
16
17
  const totalDuration = speechDuration + introPadding + outroPadding;
17
18
  GraphAILogger.log("totalDucation:", speechDuration, totalDuration);
@@ -39,6 +39,7 @@ export const imageOpenaiAgent = async ({ namedInputs, params, config, }) => {
39
39
  prompt,
40
40
  n: 1,
41
41
  size,
42
+ background: "opaque",
42
43
  };
43
44
  if (model === "gpt-image-1") {
44
45
  imageOptions.moderation = moderation || "auto";
@@ -10,5 +10,5 @@ export const handler = async (argv) => {
10
10
  setGraphAILogger(verbose, {
11
11
  template,
12
12
  });
13
- await dumpPromptFromTemplate({ templateName: template });
13
+ await dumpPromptFromTemplate({ templateName: template, suppressFirstStatement: false });
14
14
  };
@@ -33,8 +33,8 @@ export declare const promptTemplates: ({
33
33
  presenter?: undefined;
34
34
  optimus?: undefined;
35
35
  };
36
- provider: string;
37
36
  style: string;
37
+ provider?: undefined;
38
38
  };
39
39
  movieParams: {
40
40
  provider: string;
@@ -100,8 +100,8 @@ export declare const promptTemplates: ({
100
100
  presenter?: undefined;
101
101
  optimus?: undefined;
102
102
  };
103
- provider: string;
104
103
  style: string;
104
+ provider?: undefined;
105
105
  };
106
106
  movieParams: {
107
107
  model: string;
@@ -130,71 +130,6 @@ export declare const promptTemplates: ({
130
130
  scriptName: string;
131
131
  systemPrompt: string;
132
132
  title: string;
133
- } | {
134
- description: string;
135
- filename: string;
136
- presentationStyle: {
137
- $mulmocast: {
138
- credit: string;
139
- version: string;
140
- };
141
- audioParams: {
142
- audioVolume: number;
143
- bgm: {
144
- kind: string;
145
- url: string;
146
- };
147
- bgmVolume: number;
148
- closingPadding: number;
149
- introPadding: number;
150
- outroPadding: number;
151
- padding: number;
152
- suppressSpeech: boolean;
153
- };
154
- canvasSize: {
155
- height: number;
156
- width: number;
157
- };
158
- imageParams: {
159
- images: {
160
- ani: {
161
- source: {
162
- kind: string;
163
- url: string;
164
- };
165
- type: string;
166
- };
167
- girl?: undefined;
168
- presenter?: undefined;
169
- optimus?: undefined;
170
- };
171
- provider: string;
172
- style: string;
173
- };
174
- movieParams: {
175
- model: string;
176
- provider: string;
177
- };
178
- soundEffectParams: {
179
- provider: string;
180
- };
181
- speechParams: {
182
- speakers: {
183
- Presenter: {
184
- provider: string;
185
- voiceId: string;
186
- displayName?: undefined;
187
- speechOptions?: undefined;
188
- };
189
- Announcer?: undefined;
190
- Student?: undefined;
191
- Teacher?: undefined;
192
- };
193
- };
194
- };
195
- scriptName: string;
196
- systemPrompt: string;
197
- title: string;
198
133
  } | {
199
134
  description: string;
200
135
  filename: string;
@@ -283,9 +218,9 @@ export declare const promptTemplates: ({
283
218
  width: number;
284
219
  };
285
220
  imageParams: {
286
- provider: string;
287
221
  style: string;
288
222
  images?: undefined;
223
+ provider?: undefined;
289
224
  };
290
225
  movieParams: {
291
226
  provider: string;
@@ -348,8 +283,8 @@ export declare const promptTemplates: ({
348
283
  ani?: undefined;
349
284
  optimus?: undefined;
350
285
  };
351
- provider: string;
352
286
  style: string;
287
+ provider?: undefined;
353
288
  };
354
289
  movieParams: {
355
290
  provider: string;
@@ -412,8 +347,8 @@ export declare const promptTemplates: ({
412
347
  ani?: undefined;
413
348
  optimus?: undefined;
414
349
  };
415
- provider: string;
416
350
  style: string;
351
+ provider?: undefined;
417
352
  };
418
353
  movieParams: {
419
354
  provider: string;
@@ -483,8 +418,8 @@ export declare const promptTemplates: ({
483
418
  girl?: undefined;
484
419
  ani?: undefined;
485
420
  };
486
- provider: string;
487
421
  style: string;
422
+ provider?: undefined;
488
423
  };
489
424
  movieParams: {
490
425
  provider: string;
@@ -512,13 +447,6 @@ export declare const promptTemplates: ({
512
447
  scriptName: string;
513
448
  systemPrompt: string;
514
449
  title: string;
515
- } | {
516
- description: string;
517
- filename: string;
518
- systemPrompt: string;
519
- title: string;
520
- presentationStyle?: undefined;
521
- scriptName?: undefined;
522
450
  } | {
523
451
  description: string;
524
452
  filename: string;
@@ -542,9 +470,9 @@ export declare const promptTemplates: ({
542
470
  width: number;
543
471
  };
544
472
  imageParams: {
545
- provider: string;
546
473
  style: string;
547
474
  images?: undefined;
475
+ provider?: undefined;
548
476
  };
549
477
  movieParams: {
550
478
  provider: string;
@@ -606,9 +534,9 @@ export declare const promptTemplates: ({
606
534
  width: number;
607
535
  };
608
536
  imageParams: {
609
- provider: string;
610
537
  style: string;
611
538
  images?: undefined;
539
+ provider?: undefined;
612
540
  };
613
541
  movieParams: {
614
542
  provider: string;
@@ -662,9 +590,9 @@ export declare const promptTemplates: ({
662
590
  width: number;
663
591
  };
664
592
  imageParams: {
665
- provider: string;
666
593
  style: string;
667
594
  images?: undefined;
595
+ provider?: undefined;
668
596
  };
669
597
  movieParams: {
670
598
  provider: string;