Create images with Nano Banana in Make

I am trying to create a scenario where Nano Banana (with Gemini modules) creates an image and this image is sent via Gmail. The problem is that Nano Banana is not found in the “create an image” module. It is found in the “create a completion” module. The problem is that the result does not include automatic mapping for Gmail’s “send an email” module. And when I try to do manual mapping (I’m not sure if I’m using the correct data), when the scenario is executed, the image in the email does not arrive, arrives damaged, or simply causes an error in the email module.

This is the output of the Gemini module with Nano Banana. The closest thing to “data” I saw was that, and it’s what I use in the Gmail module.

This is how I have configured the Gmail module:

When the scenario runs completely, I get this when I try to access the image via email. It is in Spanish, but it says, “The file could not be previewed. There was a problem displaying this image.”

And recently, I can’t even get that far, because now I get this error:

Hi @Manuel_Chirino,

Nano Banana isn’t shown in the image module because it’s primarily a Text model which can also output images. Opposed to the “imagen” models which are pure image models.

To fix your Gemini → Gmail issue I think you can simply wrap the data you receive into toBinary({data},base64). You receive the data in base64 but you need binary data for the Gmail module. Similar to here: Image generation is not available in your country - #5 by R-SimplifiedWebhooks

Best,
Richard

Hello Richard @R-SimplifiedWebhooks, thanks for the help.

I saw the example you mentioned and tried to replicate it, but the error still occurs: Missing value of required parameter ‘data’.

I ran a test using the “Set multiple variable” module, saving the value that should go in “data” both in the way I was already doing it and with the “/tobinary()” tool, and in both cases the value returned was empty.

However, when reviewing the output of the Gemini module with Nano Banana, that value returns a long string:

For some reason, the variable “Candidates:Content.Parts:inlineData.data”, despite having a value in the Gemini module output view, is sent as an empty value to the following modules.

It seems like the model responds with a text first and then the image. That’s why there are two parts.

You’d probably need to do map(parts;inlineData.data;inlineData.mimeType;image/png).

Alternatively, instruct the model to only respond with an image. No text. :slight_smile:

2 Likes

By placing it in the module that only responds with an image and adding the iterator to the variable where the image data is located, I was able to get it to work. Thank you very much for your help Richard @R-SimplifiedWebhooks.

1 Like