Google Drive + Gemini: consistent product photos
Your product photos are “almost there”… until you see them side-by-side. One looks warm, the next looks cold. Backgrounds shift. Shadows move. Suddenly your store looks messy, and you’re stuck doing edits you honestly shouldn’t be doing.
This Drive Gemini photos automation hits ecommerce managers first, but marketers building ad creatives and studio teams prepping catalogs feel the same grind. You send images to an editor, wait, re-export, rename files, then repeat. This workflow turns that into a predictable pipeline.
You’ll see how it pulls images from a Google Drive folder, enhances them through Gemini with your prompt, and drops finished versions into a destination folder that’s ready for ads and listings.
How This Automation Works
The full n8n workflow, from trigger to final output:
n8n Workflow Template: Google Drive + Gemini: consistent product photos
flowchart LR
subgraph sg0["init Flow"]
direction LR
n0@{ icon: "mdi:swap-vertical", form: "rounded", label: "Loop Over Items", pos: "b", h: 48 }
n1@{ icon: "mdi:cog", form: "rounded", label: "to base64", pos: "b", h: 48 }
n2["<div style='background:#f5f5f5;padding:10px;border-radius:8px;display:inline-block;border:1px solid #e0e0e0'><img src='https://flowpast.com/wp-content/uploads/n8n-workflow-icons/httprequest.dark.svg' width='40' height='40' /></div><br/>banana-request"]
n3@{ icon: "mdi:swap-vertical", form: "rounded", label: "config-data", pos: "b", h: 48 }
n4@{ icon: "mdi:cog", form: "rounded", label: "download-file", pos: "b", h: 48 }
n5@{ icon: "mdi:swap-vertical", form: "rounded", label: "map-banana-response", pos: "b", h: 48 }
n6@{ icon: "mdi:cog", form: "rounded", label: "to file", pos: "b", h: 48 }
n7@{ icon: "mdi:cog", form: "rounded", label: "upload-result", pos: "b", h: 48 }
n8["<div style='background:#f5f5f5;padding:10px;border-radius:8px;display:inline-block;border:1px solid #e0e0e0'><img src='https://flowpast.com/wp-content/uploads/n8n-workflow-icons/httprequest.dark.svg' width='40' height='40' /></div><br/>get files"]
n9@{ icon: "mdi:swap-horizontal", form: "rounded", label: "Filter", pos: "b", h: 48 }
n10["<div style='background:#f5f5f5;padding:10px;border-radius:8px;display:inline-block;border:1px solid #e0e0e0'><img src='https://flowpast.com/wp-content/uploads/n8n-workflow-icons/code.svg' width='40' height='40' /></div><br/>map table"]
n11@{ icon: "mdi:play-circle", form: "rounded", label: "init", pos: "b", h: 48 }
n12@{ icon: "mdi:swap-vertical", form: "rounded", label: "promt", pos: "b", h: 48 }
n13@{ icon: "mdi:cog", form: "rounded", label: "origin_folder", pos: "b", h: 48 }
n14@{ icon: "mdi:cog", form: "rounded", label: "destination_folder", pos: "b", h: 48 }
n11 --> n12
n12 --> n13
n9 --> n3
n6 --> n7
n8 --> n10
n10 --> n9
n1 --> n2
n3 --> n0
n4 --> n1
n13 --> n14
n7 --> n0
n2 --> n5
n0 --> n4
n14 --> n8
n5 --> n6
end
%% Styling
classDef trigger fill:#e8f5e9,stroke:#388e3c,stroke-width:2px
classDef ai fill:#e3f2fd,stroke:#1976d2,stroke-width:2px
classDef aiModel fill:#e8eaf6,stroke:#3f51b5,stroke-width:2px
classDef decision fill:#fff8e1,stroke:#f9a825,stroke-width:2px
classDef database fill:#fce4ec,stroke:#c2185b,stroke-width:2px
classDef api fill:#fff3e0,stroke:#e65100,stroke-width:2px
classDef code fill:#f3e5f5,stroke:#7b1fa2,stroke-width:2px
classDef disabled stroke-dasharray: 5 5,opacity: 0.5
class n11 trigger
class n9 decision
class n2,n8 api
class n10 code
classDef customIcon fill:none,stroke:none
class n2,n8,n10 customIcon
The Problem: Inconsistent Product Photos Slow Everything Down
Consistency is what makes a catalog feel “premium.” But getting there is tedious. You might have 60 photos from a supplier, 20 from your phone, and another batch from last season, all with different lighting and backgrounds. If you fix them manually, you end up bouncing between folders, tools, and versions, and it’s way too easy to overwrite an original by mistake. Worse, tiny mismatches slip through, which means your designer has to patch them later or your ads just look off. It’s a lot of mental load for work that doesn’t move the business forward.
The friction compounds. Here’s where it breaks down.
- Every new photo batch becomes a mini project, even if it’s only 15 images.
- Manual editing creates inconsistent results because the “rules” live in someone’s head, not in a repeatable prompt.
- File handling gets risky fast when people duplicate, rename, and export into the same folders.
- You can’t scale listings and ads if image cleanup blocks every launch.
The Solution: Google Drive to Gemini Enhancement, Automatically
This workflow turns one messy Drive folder into a clean “ready-to-use” folder, without you babysitting each file. You start it manually in n8n, and it looks up your source folder (the unprocessed images) and your destination folder (where finished images should land). Next, it fetches the files inside the source folder, filters down to real images only, then processes them in a loop so it can handle batches without choking. For each file, it downloads the image, converts it into a format Gemini can accept, sends it to Gemini with your custom instructions, then converts the enhanced result back into a proper image file. Finally, it uploads that processed file into the destination folder, keeping your originals safely untouched.
The workflow begins with a prompt you control, which is where your “house style” gets enforced. From there it pulls the list of Drive files, ignores anything that isn’t an image, and runs each image through Gemini. When it’s done, you end up with two clear folders: originals and polished outputs, ready for your storefront or ad builder.
What You Get: Automation vs. Results
| What This Workflow Automates | Results You’ll Get |
|---|---|
|
|
Example: What This Looks Like
Say you get 50 new product photos every week from a supplier. Manually, even a “quick” pass (exporting, cleaning backgrounds, saving versions, re-uploading) can be about 5 minutes per image, which is roughly 4 hours of repetitive work. With this workflow, you drop the 50 images into your source Drive folder, click run, and wait for processing. The hands-on time is basically the folder drop plus a quick spot check, maybe 10 minutes total, and you still end up with a ready-to-use destination folder.
What You’ll Need
- n8n instance (try n8n Cloud free)
- Self-hosting option if you prefer (Hostinger works well)
- Google Drive to store source and processed folders
- Google Gemini API to enhance images from your prompt
- Google Drive OAuth2 (create in Google Cloud Console)
Skill level: Beginner. You’ll connect credentials, choose two folders, and tweak a prompt.
Don’t want to set this up yourself? Talk to an automation expert (free 15-minute consultation).
How It Works
You trigger the run from n8n. It’s a manual start, which is perfect for weekly batches or “we just uploaded a new collection” moments.
Your brand rules are set in the prompt. The Prompt Builder node is where you tell Gemini what “consistent” means for your store (clean background, realistic shadows, same vibe, no weird artifacts). Change that once, and every future batch follows it.
Google Drive is scanned and filtered. The workflow finds your source and destination folders, retrieves the file list, flattens it, and only keeps items that are actually images (based on mimeType). No accidental PDFs or random files going through the AI step.
Gemini enhances each image and saves the output. Each image is downloaded, converted to Base64, sent via HTTP to Gemini, then converted back into a binary image file and uploaded into the destination folder.
You can easily modify the prompt and folder targeting to match your catalog process based on your needs. See the full implementation guide below for customization options.
Step-by-Step Implementation Guide
Step 1: Configure the Manual Trigger
Start the workflow with a manual trigger so you can run and validate the image processing pipeline on demand.
- Add the Manual Start Trigger node to your canvas.
- Keep default settings in Manual Start Trigger since it requires no parameters.
- Connect Manual Start Trigger to Prompt Builder.
Step 2: Connect Google Drive Folders and List Files
Locate the source and target folders in Drive, then retrieve the file list from the source folder.
- Open Source Folder Lookup and set Resource to
fileFolder, Limit to1, and Query String toimagenes_sin_procesar. Credential Required: Connect your googleDriveOAuth2Api credentials. - Open Target Folder Lookup and set Resource to
fileFolder, Limit to1, and Query String toimagenes_sin_procesar. Credential Required: Connect your googleDriveOAuth2Api credentials. - Configure Retrieve Drive Files with URL set to
https://www.googleapis.com/drive/v3/filesand Authentication set topredefinedCredentialType. - In Retrieve Drive Files query parameters, set q to
='{{ $('Source Folder Lookup').item.json.id }}' in parents and trashed=false, fields tonextPageToken,files(id,name,mimeType,size,modifiedTime,webViewLink,webContentLink), and pageSize to1000. Credential Required: Connect your googleDriveOAuth2Api credentials. - Connect Source Folder Lookup → Target Folder Lookup → Retrieve Drive Files following the execution flow.
Step 3: Build the Prompt and Filter Image Files
Prepare the prompt text used for the AI image generation and filter the file list to images only.
- In Prompt Builder, set the promt field to the full prompt string provided, including the background instructions for the product image.
- Use Flatten File List to convert the Drive file array into individual items. Keep the provided JavaScript code as-is.
- In Image Type Filter, set the condition to leftValue
={{ $json.mimeType }}containsimage. - Configure Assemble File Config to map name, mimeType, and id from the item, and set promt to
={{ $('Prompt Builder').item.json.promt }} **no devuelvas texto, solo la imagen.. - Connect Retrieve Drive Files → Flatten File List → Image Type Filter → Assemble File Config.
Step 4: Batch Processing and Download Source Images
Process images one by one, download the source file, and prepare it for AI processing.
- Connect Assemble File Config to Iterate File Batch to process items sequentially.
- In Download Drive File, set File ID to
={{ $json.id }}and Operation todownload. Credential Required: Connect your googleDriveOAuth2Api credentials. - In Convert Binary to Base64, set Operation to
binaryToProperyto convert the downloaded file into base64. - Connect Iterate File Batch (output 1) → Download Drive File → Convert Binary to Base64.
Step 5: Generate Images with Gemini and Upload Results
Send the image and prompt to Gemini, parse the response, create a binary file, and upload it to the target folder.
- In Gemini Image Request, set URL to
https://generativelanguage.googleapis.com/v1beta/models/gemini-2.5-flash-image-preview:generateContent, Method toPOST, and enable Send Body with Specify Body set tojson. - Set the JSON Body to the provided expression, including
{{ JSON.stringify($('Iterate File Batch').item.json.promt) }},{{ $json.mime || 'image/jpeg' }}, and{{ $json.data }}. Credential Required: Connect your googlePalmApi credentials. - In Parse Gemini Output, set base64File to
={{ ($json.candidates?.[0]?.content?.parts || []) .find(p => p?.inlineData?.data)?.inlineData?.data ?? '' }}and keep Include Other Fields enabled. - In Create Binary File, set Operation to
toBinary, Source Property tobase64File, and File Name to={{ $('Download Drive File').item.json.name }}. - In Upload Processed File, set Name to
={{ $binary.data.fileName }}and Folder ID to={{ $('Target Folder Lookup').item.json.id }}. Credential Required: Connect your googleDriveOAuth2Api credentials. - Connect Convert Binary to Base64 → Gemini Image Request → Parse Gemini Output → Create Binary File → Upload Processed File, then back to Iterate File Batch.
Step 6: Test and Activate Your Workflow
Run a manual execution to confirm files are processed and uploaded correctly before activating.
- Click Execute Workflow from Manual Start Trigger to run the pipeline.
- Verify that Retrieve Drive Files returns files and Upload Processed File uploads a new image to the target folder.
- Confirm that the generated images are in the folder returned by Target Folder Lookup and that filenames match
={{ $binary.data.fileName }}. - When satisfied, toggle the workflow to Active for production use.
Common Gotchas
- Google Drive OAuth credentials can expire or be missing scope permissions. If things break, check the credential status in n8n and re-auth the Google Drive nodes first.
- If you’re using Wait nodes or external rendering, processing times vary. Bump up the wait duration if downstream nodes fail on empty responses.
- Default prompts in AI nodes are generic. Add your brand voice early or you’ll be editing outputs forever.
Frequently Asked Questions
About 20 minutes if you already have your Google credentials ready.
No. You’ll mostly pick folders, connect accounts, and edit a prompt.
Yes. n8n has a free self-hosted option and a free trial on n8n Cloud. Cloud plans start at $20/month for higher volume. You’ll also need to factor in Google Gemini API usage costs, which depend on your model and how many images you process.
Two options: n8n Cloud (managed, easiest setup) or self-hosting on a VPS. For self-hosting, Hostinger VPS is affordable and handles n8n well. Self-hosting gives you unlimited executions but requires basic server management.
Yes, but you’ll do it in two places. Start by updating the Prompt Builder instructions to specify “pure white background” and whatever styling rules you want (shadow, reflection, realism). Then add a simple post-processing step after the Gemini response, like an image resize/crop action, before the Upload Processed File node. Common tweaks include different background styles per category, stricter “no text/no props” rules, and renaming outputs with SKU prefixes.
Usually it’s expired OAuth authorization or the Google project doesn’t have the right scopes enabled. Reconnect the Google Drive credential in n8n and confirm the Drive nodes are using the updated credential. If it still fails, check that the account you authorized actually has access to both the source and destination folders.
A lot, as long as your Gemini quota and n8n resources can keep up. On n8n Cloud, your monthly execution limit depends on the plan, while self-hosting removes that cap and shifts the limit to your server. Practically, most teams run this in batches (like 20–200 images at a time) so reviews are easy and API usage stays predictable.
Often, yes, for image pipelines. n8n makes it easier to loop through a folder of files, filter by mime type, and handle file conversions without paying extra for every branching step. You can also self-host, which matters when you’re processing lots of images and want predictable costs. Zapier or Make can be fine for a tiny workflow with a few images, but they can get awkward once you need batching, retries, and file handling. If you want help picking the simplest approach for your setup, Talk to an automation expert.
Once this is in place, your product photos stop being a recurring fire drill. The workflow handles the repetitive cleanup so you can focus on launches, ads, and sales.
Need Help Setting This Up?
Our automation experts can build and customize this workflow for your specific needs. Free 15-minute consultation—no commitment required.