Product Ad Generation using Gemini via OpenRouter - n8n Workflow

Generate professional fashion product ads instantly using this powerful n8n workflow. Submit product images and let the Gemini AI model create photorealistic marketing visuals.

Workflow Preview

Ready to automate?

Download this n8n workflow template and start using it instantly.

Who is this best for?

E-commerce marketers needing instant, diverse lifestyle product shots.
Digital agencies looking for high-throughput visual asset generation.
Small business owners seeking affordable alternatives to professional photography.
Automation enthusiasts building advanced AI n8n templates.

Overview

Creating high-quality marketing materials often requires expensive photoshoots and models. This advanced n8n workflow eliminates that bottleneck by providing a fully automated image generation pipeline. By leveraging the multimodal capabilities of the Gemini 2.5 Flash model, accessible through the OpenRouter API, users can submit a simple product image and instantly receive a photorealistic advertisement featuring a model interacting with the product in a natural setting. This specific n8n workflow demonstrates exceptional power in bridging form submissions directly with advanced AI generation, making it a crucial addition to any marketing stack utilizing n8n templates. The design ensures seamless file handling, from upload via the n8n trigger to automatic download of the final image.

How it Works

This powerful automation initiates with the On form submission n8n trigger, which prompts the user to upload a product image and select the desired character model (Male or Female). The uploaded file is immediately processed by the Extract from File n8n node, converting the binary data into a base64 string. This string is then properly formatted by the Code n8n node into an image URL data URI, ready for the AI request.

The core AI processing happens in the Nano 🍌 HTTP Request n8n node. This n8n node connects to the OpenRouter API, passing the base64 product image and a carefully crafted prompt—dynamically incorporating the selected character model—to the google/gemini-2.5-flash-image-preview model. Upon receiving the AI-generated image (returned as a data URI), the Edit Fields n8n node meticulously parses the URI to extract the raw base64 content and the MIME type. Finally, the Convert to File n8n node transforms this extracted base64 content back into a binary file. The entire n8n workflow concludes when the final Form n8n node delivers the generated binary file back to the user, triggering an automatic download of the new advertisement image.

Installation Guide

To deploy this custom n8n workflow, follow these steps:


  1. Import the JSON: Copy the provided n8n workflow JSON code and import it directly into your n8n instance.

  2. OpenRouter Credentials: Navigate to the Nano 🍌 HTTP Request n8n node. Under the 'Credentials' section, you must set up an OpenRouter API key credential. This key facilitates access to the Gemini model.

  3. Form Configuration: Customize the On form submission n8n trigger. While the fields are pre-set (Product Image, Character Model), you may wish to adjust the form title and description.

  4. Activation: Once credentials are set and the n8n node connections are verified, activate the n8n workflow. The public URL provided by the initial n8n trigger can then be used to submit product images and test the generation process.

Node Details

On form submission (n8n trigger): This initial n8n node acts as the entry point, collecting the required input data: a 'Product Image' file and the 'Character Model' selection (Male or Female) via a standard web form.
Extract from File / Code (n8n node combination): These nodes work together to convert the uploaded product image binary into a compliant base64 Data URI string, which is necessary for multi-modal AI prompt delivery.
Nano 🍌 (HTTP Request n8n node): This is the heart of the n8n workflow. It securely sends the base64 image and the detailed text prompt to the OpenRouter API using the specified Gemini model. It utilizes dynamic data from the n8n trigger to personalize the prompt.
Edit Fields (Set n8n node): This node is critical for parsing the AI's response. It extracts the raw base64 image content from the full data URI returned by the OpenRouter service.
Convert to File (n8n node): This final processing step takes the purified base64 data and converts it back into a true binary file, ready for download.
Form (n8n node): This concluding n8n node sends the generated binary image back to the user who submitted the initial form, providing a seamless and instant download experience, completing the custom n8n workflow.

Related n8n Workflows

Paid

Nodes: 8 Nodes
Updated: December 26 2025
View all
Created by
Zakwan
Zakwan

Featured*