mulmocast 2.0.4 → 2.0.5

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.
@@ -22,11 +22,13 @@ export const ratio2BlankPath = (aspectRatio) => {
22
22
  }
23
23
  return blankImagePath();
24
24
  };
25
- const getGeminiContents = (prompt, aspectRatio, referenceImages) => {
25
+ const getGeminiContents = (prompt, referenceImages, aspectRatio) => {
26
26
  const contents = [{ text: prompt }];
27
27
  const images = [...(referenceImages ?? [])];
28
28
  // NOTE: There is no way to explicitly specify the aspect ratio for Gemini. This is just a hint.
29
- images.push(ratio2BlankPath(aspectRatio));
29
+ if (aspectRatio) {
30
+ images.push(ratio2BlankPath(aspectRatio));
31
+ }
30
32
  images.forEach((imagePath) => {
31
33
  const imageData = fs.readFileSync(imagePath);
32
34
  const base64Image = imageData.toString("base64");
@@ -71,11 +73,25 @@ export const imageGenAIAgent = async ({ namedInputs, params, config, }) => {
71
73
  }
72
74
  try {
73
75
  const ai = new GoogleGenAI({ apiKey });
74
- if (model === "gemini-2.5-flash-image" || model === "gemini-3-pro-image-preview") {
75
- const contents = getGeminiContents(prompt, aspectRatio, referenceImages);
76
+ if (model === "gemini-2.5-flash-image") {
77
+ const contents = getGeminiContents(prompt, referenceImages, aspectRatio);
76
78
  const response = await ai.models.generateContent({ model, contents });
77
79
  return geminiFlashResult(response);
78
80
  }
81
+ else if (model === "gemini-3-pro-image-preview") {
82
+ const contents = getGeminiContents(prompt, referenceImages);
83
+ const response = await ai.models.generateContent({
84
+ model,
85
+ contents,
86
+ config: {
87
+ imageConfig: {
88
+ // '1:1', '2:3', '3:2', '3:4', '4:3', '4:5', '5:4', '9:16', '16:9', or '21:9'.
89
+ aspectRatio,
90
+ },
91
+ },
92
+ });
93
+ return geminiFlashResult(response);
94
+ }
79
95
  else {
80
96
  const response = await ai.models.generateImages({
81
97
  model,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mulmocast",
3
- "version": "2.0.4",
3
+ "version": "2.0.5",
4
4
  "description": "",
5
5
  "type": "module",
6
6
  "main": "lib/index.node.js",
@@ -0,0 +1,25 @@
1
+ {
2
+ "$mulmocast": { "version": "1.1" },
3
+ "imageParams": {
4
+ "provider": "google",
5
+ "style": "<style>Photo realistic.</style>"
6
+ },
7
+ "canvasSize": {
8
+ "width": 720,
9
+ "height": 1280
10
+ },
11
+ "movieParams": {
12
+ "provider": "google"
13
+ },
14
+ "lang": "en",
15
+ "beats": [
16
+ {
17
+ "id": "gemini_3_pro_image_preview",
18
+ "text": "image generated by gemini-3-pro-image-preview",
19
+ "imagePrompt": "a woman is walking through a busy Tokyo street at night, she is wearing dark sunglasses",
20
+ "imageParams": {
21
+ "model": "gemini-3-pro-image-preview"
22
+ }
23
+ }
24
+ ]
25
+ }
@@ -0,0 +1,84 @@
1
+ {
2
+ "$mulmocast": { "version": "1.1" },
3
+ "imageParams": {
4
+ "provider": "google",
5
+ "style": "<style>Photo realistic.</style>"
6
+ },
7
+ "movieParams": {
8
+ "provider": "google"
9
+ },
10
+ "lang": "en",
11
+ "beats": [
12
+ {
13
+ "id": "gemini_3_pro_image_preview",
14
+ "text": "image generated by gemini-3-pro-image-preview",
15
+ "imagePrompt": "a woman is walking through a busy Tokyo street at night, she is wearing dark sunglasses",
16
+ "imageParams": {
17
+ "model": "gemini-3-pro-image-preview"
18
+ }
19
+ },
20
+ {
21
+ "id": "gemini_2_5_flash_image",
22
+ "text": "image generated by gemini-2.5-flash-image",
23
+ "imagePrompt": "a woman is walking through a busy Tokyo street at night, she is wearing dark sunglasses",
24
+ "imageParams": {
25
+ "model": "gemini-2.5-flash-image"
26
+ }
27
+ },
28
+ {
29
+ "id": "imagen_4",
30
+ "text": "image generated by imagen-4",
31
+ "imagePrompt": "a woman is walking through a busy Tokyo street at night, she is wearing dark sunglasses"
32
+ },
33
+ {
34
+ "id": "imagen_4_ultra",
35
+ "text": "image generated by imagen-4",
36
+ "imagePrompt": "a woman is walking through a busy Tokyo street at night, she is wearing dark sunglasses",
37
+ "imageParams": {
38
+ "model": "imagen-4.0-ultra-generate-preview-06-06"
39
+ }
40
+ },
41
+ {
42
+ "id": "genai_veo2",
43
+ "text": "movie generated by veo2",
44
+ "duration": 5,
45
+ "moviePrompt": "a woman is walking through a busy Tokyo street at night, she is wearing dark sunglasses"
46
+ },
47
+ {
48
+ "id": "genai_veo2_image",
49
+ "text": "movie generated by veo2 with image",
50
+ "duration": 5,
51
+ "imagePrompt": "a woman is walking through a busy Tokyo street at night, she is wearing dark sunglasses",
52
+ "moviePrompt": "a woman takes a selfie with her phone"
53
+ },
54
+ {
55
+ "id": "genai_veo3",
56
+ "text": "movie generated by veo3",
57
+ "moviePrompt": "a woman is walking through a busy Tokyo street at night, she is wearing dark sunglasses",
58
+ "movieParams": {
59
+ "model": "veo-3.0-generate-001"
60
+ }
61
+ },
62
+ {
63
+ "id": "genai_veo3_1",
64
+ "text": "movie generated by veo3_1",
65
+ "moviePrompt": "a woman is walking through a busy Tokyo street at night, she is wearing dark sunglasses",
66
+ "movieParams": {
67
+ "model": "veo-3.1-generate-preview"
68
+ }
69
+ },
70
+ {
71
+ "id": "genai_veo3_image",
72
+ "text": "movie generated by veo3",
73
+ "duration": 5,
74
+ "imagePrompt": "a woman is walking through a busy Tokyo street at night, she is wearing dark sunglasses",
75
+ "imageParams": {
76
+ "model": "gemini-2.5-flash-image"
77
+ },
78
+ "moviePrompt": "a woman is walking through a busy Tokyo street at night, she is wearing dark sunglasses",
79
+ "movieParams": {
80
+ "model": "veo-3.0-generate-001"
81
+ }
82
+ }
83
+ ]
84
+ }