How I Generate Unlimited Ad Creative with Nano Banana and n8n Using Gemini 2.5 Flash Image

How to use Google's Nano Banana to generate infinite ad creatives that feature your product in the hands of influencers.

Want to create high-quality influencer ad creative at scale without shipping a single product? In this guide I walk you through an end-to-end n8n automation that takes one product image and a folder of influencer photos and generates lifelike ad images of those influencers holding the product using Google Gemini 2.5 Flash Image, commonly called Nano Banana. If you want the ready-made n8n template, join our AI Automation Community and grab the automation template for free.

n8n Nano Banana workflow

What this automation does

This system automates the creation of influencer-style product shots at scale. You provide a single product image and a folder of influencer reference photos in Google Drive. The workflow loops through each influencer image, calls Gemini 2.5 Flash Image to composite the product into the influencer's hands with a realistic scene prompt, then saves the generated image back to Google Drive. The result is a bank of ad creative files ready for ad platforms.

source influencers

Why this approach matters for e-commerce teams

  • Produce large volumes of ad creative without physical logistics.
  • Test different visual directions quickly by changing prompts.
  • Use consistent branding while leveraging varied influencer styles.
  • Reduce cost and cycle time for creative production.

What you need before you start

  • An n8n instance with credentials set up for Google Drive and an HTTP node.
  • A Google Cloud project with access to Gemini and an API key.
  • A folder in Google Drive containing influencer reference images.
  • A single PNG or JPG of the product you want to composite into influencer photos.
n8n convert image to base64

System overview

The automation follows a clear flow:

  1. Trigger a form upload for your product image.
  2. Convert the uploaded product file into a Base64 string for inline API usage.
  3. List influencer images from a Google Drive folder.
  4. Loop over each influencer file, download it, and convert it to Base64.
  5. Send a single composite request to Gemini 2.5 Flash Image with a prompt plus the two inline images.
  6. Receive the generated image as Base64, convert it to a file, and upload it to an output Google Drive folder.

Step by step build in n8n

1. Trigger the workflow with a product image

Use a simple form trigger in n8n with one required file upload field named image. This lets anyone start the automation by uploading the product PNG or JPG. The workflow runs immediately after you submit the file.

n8n form trigger

2. Convert the uploaded product image to Base64

The Gemini image API requires inline image bytes. Use the n8n node called Extract from File Move File to B64 to transform the uploaded product file into a Base64 text string. Store that string as a data field so later nodes can reference it.

3. List influencer images from Google Drive

Use n8n's Google Drive node with file/folder resource and the search operation. Restrict the search to your influencer folder by pasting the folder ID from the Drive URL and selecting by ID. The node returns a JSON array of files with IDs and names.

n8n list images step

4. Loop through influencer files and download each image

Use the Loop Over Batches node to iterate through each file returned by Google Drive. For each iteration, call the Google Drive node again with download operation and pass the dynamic file ID from the current loop item. This downloads the raw bytes you will convert to Base64.

5. Convert influencer images to Base64

Use the same extract file to Base64 node to convert the downloaded influencer file into a Base64 string. Now you have two inline images ready to send to Gemini: the product and the influencer.

6. Build the Gemini API request

Use an HTTP request node with method POST to the Gemini API.

In the JSON body, include a content array. The first element is a text type with your image prompt. Add two subsequent inline image parts: one for the product Base64 and one for the influencer Base64. This mirrors Gemini's multiple-image combine example, enabling Nano Banana to place the product into the influencer's hands with a specified scene.

Google Gemini API request

7. Authenticate your Gemini API calls

Set the HTTP node to use a generic credential header. Go to Google AI Studio to create an API key and copy the header name and key value into the n8n credential entry. The header name appears before the colon in AI Studio instructions. Once saved, select that credential for the HTTP node.

8. Prompt design that produces realistic influencer shots

Prompting is the key lever to control output mood and composition. Example prompt structure to start with:

  • Create an image where the cup in image one is being held by the person in image two as if they are about to take a drink.
  • The person should be sitting at a table in a cafe and smiling while looking at the camera.
  • Do not make this a studio photo. It should feel like a friend took the picture.

Adjust details such as lighting, background blur, skin tones, or apparel based on your brand. Test variations to find what performs best in ads.

Google Nano banana request body

9. Handle Gemini response and extract the image

Gemini returns multiple content parts. Look under candidates.content.parts and extract the first part where type equals image data. Use a small JavaScript expression in n8n to filter the array and pull the inline Base64 string. This extra filter prevents errors when Gemini returns auxiliary text elements.

10. Convert the returned Base64 to a file and upload to Drive

Use the n8n node Convert To File to convert the Base64 string to a binary file. Name the output file dynamically using the run index so each generated image gets a unique name like influencer-image-1, influencer-image-2, and so on. Then upload the file to your target Google Drive folder with the parent folder ID.

n8n upload image to google drive

Tips for scaling and testing

  • Start with a small batch of influencer images to validate prompt behavior before scaling.
  • Keep prompts concise and specific. Mention posture, expression, setting, and camera feel.
  • Use royalty-free or consented influencer photos to avoid legal concerns.
  • Use unique file names and separate output folders per campaign to manage versions.
  • Log API outputs for a sample of runs to catch edge cases where Gemini returns text parts.

Use cases and limitations

Primary use cases include rapid ad creative testing, building influencer-style asset libraries, and localized creative variants where shipping products is not feasible. Be aware of model limitations such as occasional artifacts, inconsistency in hand placement, or mismatched lighting. Prompt tuning reduces these issues but expect a small portion that needs human review.

Where to get the n8n template

The full n8n JSON automation template is available in the AI Automation Mastery community. Join the community to download the template and the prompt examples that I use in this workflow. Once imported into your n8n instance, you can clone and adapt the automation to your brand and campaign needs.

AI Automation community n8n template

Conclusion

This Nano Banana plus n8n workflow gives e-commerce teams a practical method to generate influencer-style ad images without product logistics. By converting images to Base64, looping through influencer references, and using Gemini 2.5 Flash Image to composite scenes, you can produce consistent ad libraries for testing across platforms.

More AI Tutorials

How to Connect WhatsApp to n8n (AI Workflow Tutorial)
How to Connect WhatsApp to n8n (AI Workflow Tutorial) How to connect WhatsApp to n8n so you can power AI agents and automations that send and receive messages.
YouTube
Put Real Products and People into AI Video Ads (Veo 3 Full Tutorial)
Put Real Products and People into AI Video Ads (Veo 3 Full Tutorial) Learn how to use canvas prompting to bring real people and real products into AI generated videos.
YouTube
I Built a Fully-Automated Podcast (with AI + n8n + ElevenLabs)
I Built a Fully-Automated Podcast (with AI + n8n + ElevenLabs) How to build a podcast fully researched, written, and narrated by AI.
YouTube
I Built a WhatsApp Chatbot + AI Agent in n8n for Small Businesses (free template)
I Built a WhatsApp Chatbot + AI Agent in n8n for Small Businesses (free template) How to build a WhatsApp chatbot and AI agent that can handle customer questions about hours, pricing, menus, locations, and appointments in real time.
YouTube
I Used Lovable + n8n to Build an AI Web Developer Agent (free template)
I Used Lovable + n8n to Build an AI Web Developer Agent (free template) How to build a fully-automated web developer AI agent inside of n8n that can research and build websites using Lovable.
YouTube
GPT-5 vs Gemini vs Claude: Real-World AI Agent Performance Tested
GPT-5 vs Gemini vs Claude: Real-World AI Agent Performance Tested Which AI model truly stands out in a real production AI workflows and production agents?
YouTube