Home/Insights/Automation

Google's Nano Banana with n8n | FREE TEMPLATE

By Ani BjörkströmPublished 25 September 2025Reviewed 17 November 20268 min video + articleAutomation

Google's Nano Banana with n8n | FREE TEMPLATE
▶ Watch the full 8-minute video · with chapters & transcript

AUTOMATION

How Can You Generate Product Photos with Google's Nano Banana in n8n?

In short: A five-step n8n workflow turns an uploaded product photo into a generated image of a chosen male or female model holding the product, using Google's Nano Banana (Gemini 2.5 Flash Image Preview).

Key takeaways

  • A five-step n8n workflow turns an uploaded product photo into a generated image of a chosen male or female model holding the product, using Google's Nano Banana (Gemini 2.5 Flash Image Preview).
  • The image must be converted to base64 before the API call, then converted back from base64 to a PNG file after generation.
  • Nano Banana's API is no longer free on OpenRouter, so the workflow calls Google's Gemini endpoint directly with a key tied to a paid Google Cloud project; new accounts get roughly $250 in free credit.

Product photography is an obvious early win for image models, and this n8n build shows the pipeline end to end. In the demo by Stockholm-based tech consultant Ani Björkström, a Coke Zero picture goes in through a form, a female model is selected, and a finished image of a woman drinking the Coke Zero downloads to the computer in one workflow execution.

How does the workflow collect the product image?

It starts with an n8n form submission trigger with authentication set to none, a title, a description, and two fields. The first, "product image," has element type file restricted to PNG and JPG, the formats product pictures normally use. The second, "character model," lets the user specify male or female, defining who will hold the product in the generated image.

Why do you need to convert the file to base64?

Because Nano Banana consumes images as base64-encoded text, not as raw PNG files. The second node, Extract from File, converts the submitted image/PNG binary into base64 text so it can be embedded in the JSON body of the API request. After generation, a Convert to File node reverses the process, taking the base64 data returned by the API and turning it back into a plain PNG.

How do you call the Nano Banana API directly?

The HTTP Request node sends a POST to Google's generativelanguage.googleapis.com endpoint using the generateContent function and the model gemini-2.5-flash-image-preview, with a JSON body carrying the instruction text, the chosen gender from the form, and the base64 image referenced from the Extract from File node. Nano Banana's API was free on OpenRouter a few weeks earlier but is now paid there, which is why calling Gemini's URL directly is the better option.

n8n nodePurpose
On form submissionCollects the product image (PNG/JPG) and the male/female model choice
Extract from FileConverts the uploaded image to base64 text encoding
HTTP RequestPOSTs the prompt, gender, and base64 image to gemini-2.5-flash-image-preview
Convert to FileTurns the returned base64 data back into a PNG
Form endingReturns the binary file so the generated image downloads to your computer

What does the API key setup and cost look like?

Create the key in Google AI Studio under API keys, but note that Nano Banana's API is not free: the key must be connected to a paid project in Google Cloud or it will not work. The cost risk is manageable, since a new Google Cloud account comes with free credit, around $250, and you can create a budget limit that notifies you as soon as a threshold such as $5 is hit.

FAQ

Can I still use OpenRouter to run Nano Banana for free?

Not anymore. The API was free on OpenRouter a couple of weeks before the tutorial, but it is now paid there, so calling Google's Gemini endpoint directly is the recommended route.

What image formats does the form accept?

The product image field accepts PNG and JPG, and the file is converted to base64 before being sent to the model.

How do I get the template?

The full n8n template is shared for free: comment "N8N" under the video and you will receive the link, and the JSON body used in the HTTP request is also copied into the video description.

Want this working inside your finance team?

Ani Björkström

Ani Björkström — founder of QvantX Sweden AB, a Stockholm consultancy building AI solutions for banks, asset managers and finance teams. Anthropic partner. Every article starts from a real client build, minus the confidential parts. LinkedIn →