Watch the video with chapters & transcript →
AUTOMATION
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).
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.
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.
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.
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 node | Purpose |
|---|---|
| On form submission | Collects the product image (PNG/JPG) and the male/female model choice |
| Extract from File | Converts the uploaded image to base64 text encoding |
| HTTP Request | POSTs the prompt, gender, and base64 image to gemini-2.5-flash-image-preview |
| Convert to File | Turns the returned base64 data back into a PNG |
| Form ending | Returns the binary file so the generated image downloads to your computer |
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.
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.
The product image field accepts PNG and JPG, and the file is converted to base64 before being sent to the model.
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.
Read the full video transcript, with chapters, on the video page →
Want this working inside your finance team?