AI Vintage Photo Generator using Gemini - n8n Workflow

Use this powerful n8n workflow to generate vintage Polaroid-style photos using Gemini AI. Leverage n8n templates for instant setup, converting digital images to retro art via an efficient n8n node polling loop.

Workflow Preview

Ready to automate?

Download this n8n workflow template and start using it instantly.

Who is this best for?


  • Photographers and Content Creators seeking efficient vintage effects.

  • Developers looking for advanced AI image generation n8n templates.

  • Users needing a robust n8n workflow that handles API polling for long-running tasks.

  • Anyone utilizing n8n for custom form submissions and automated image processing.

Overview

This specialized n8n workflow solves the challenge of generating unique, artistic vintage photographs instantly from user-provided input. By leveraging the Defapi API connected to Google's powerful Gemini AI, this automation takes two standard digital images, a creative prompt, and an API key submitted via a custom form. The core value of this n8n template lies in its robust handling of asynchronous API calls. Since image generation can take time, the n8n workflow implements a polling loop using the Wait n8n node and the IF n8n node to continuously check the status until the vintage photo is successfully created. This complete n8n solution ensures a seamless user experience, delivering the final, Polaroid-style image URL upon completion.

How it Works

This n8n workflow begins with the Form n8n trigger, collecting required user input and acting as the primary n8n trigger.


  1. Input Collection (Upload 2 Images): The user submits two image files, a creative text prompt, and their API key via the generated public form URL. This initializes the n8n trigger.

  2. Data Preparation (Convert to JSON): A Code n8n node immediately converts the uploaded binary image files into Base64 encoded strings, a necessary format for the external AI API. It also extracts the prompt and API key for subsequent steps.

  3. Request Submission (Send Image Generation Request): An HTTP Request n8n node sends a POST request containing the prompt, model details, and the two Base64 image URLs to the Defapi image generation endpoint. This initiates the AI generation process and returns a taskid.

  4. Initial Delay (Wait for Image Processing Completion): The n8n workflow pauses execution using a Wait n8n node for 10 seconds, allowing the remote service time to begin processing the complex AI task.

  5. Status Polling (Obtain Status & Check Completion): A subsequent HTTP Request n8n node polls the API using the stored taskid.

  6. Flow Control (Check if Image Generation is Complete): An IF n8n node checks if the status received from the API equals 'success'. If true, the workflow proceeds to output the result. If false, the n8n node loops back to the Wait n8n node, initiating another 10-second wait before checking the status again, ensuring completion tracking.

  7. Result Delivery (Format and Display Results): Once successful, a Set n8n node extracts the final generated image URL from the API response payload, concluding the n8n workflow execution.

Installation Guide

To deploy this comprehensive n8n template, follow these steps:


  1. Import the n8n Workflow: Copy the provided JSON data and import it into your n8n instance via the 'New' menu option and selecting 'Import from JSON'.

  2. Prerequisite Credentials: This n8n workflow requires an API key from Defapi.org (used for the Gemini AI integration). This key is provided by the user via the input form and is used dynamically in the HTTP Request n8n node headers.

  3. Configure the Form Trigger: The 'Upload 2 Images' Form n8n trigger is pre-configured. Ensure your n8n instance is accessible externally to use the generated webhook/form URL.

  4. Test Execution: Click 'Execute Workflow' in n8n. Access the form URL displayed in the 'Upload 2 Images' n8n node, upload your images, enter your prompt, and paste your Defapi API Key. Monitor the execution progress in n8n to see the polling loop in action.

Node Details

Upload 2 Images (Form Trigger n8n trigger): This is the entry point and the primary n8n trigger. It collects user data, including two file uploads (Image 01, Image 02), an API Key, and the creative Prompt.
Convert to JSON (Code n8n node): A crucial step in this n8n workflow. It uses custom JavaScript to read the binary file data from the trigger and convert both files into Base64 Data URLs, which are then passed to the API request body. It also extracts the prompt and API key.
Send Image Generation Request to Defapi.org API (HTTP Request n8n node): Sends the Base64 images and prompt via a POST request to initiate the Gemini AI generation task. It uses Bearer Token authentication dynamically sourced from the user input.
Wait for Image Processing Completion (Wait n8n node): Pauses the n8n workflow execution for 10 seconds before initiating the status check, preventing excessive polling.
Obtain the generated status (HTTP Request n8n node): A GET request that uses the task_id returned in the initial submission to query the current status of the AI image generation job.
Check if Image Generation is Complete (IF n8n node): Manages the core logic flow. It evaluates if the API response status is 'success'. If true, it proceeds to output. If false, it loops back to the Wait n8n node to continue polling the status, defining the control structure of this n8n workflow.


  • Format and Display Image Results (Set n8n node): The final n8n node in the successful path. It isolates and extracts the URL of the generated Polaroid-style image for display or further use.

Related n8n Workflows

Free

Nodes: 7 Nodes
Updated: December 26 2025
View all
Created by
panyanyany
panyanyany

Featured*