Nano Banana (Gemini 2.5 Flash Image) is equally powerful as a utility tool for Background Removal.
This workflow demonstrates how to process thousands of product images automatically, stripping away backgrounds with high precision using Gemini's multimodal capabilities, at a fraction of the cost of dedicated background removal APIs.
Why use Gemini for Background Removal?
- Cost: Gemini 2.5 Flash is significantly cheaper than services like remove.bg or PhotoRoom API for high volumes. API cost is around $0.015 per image.
- Context Awareness: Unlike standard segmentation models, Gemini understands the object you are trying to keep using natural language prompts (e.g., "Keep the watch, remove the stand").
- Speed: It is optimized for low latency, making batch processing viable. 10 seconds per image.
The Workflow Architecture
We have built a dedicated "Batch Background Remover" workflow using n8n.
Step 1: Input Source (Google Drive)
- The workflow monitors a specific Google Drive Input Folder.
- It automatically lists all image files in that folder.
- Scalability: Drop 100 raw studio shots in the folder, and the automation queues them all.
Step 2: The Loop
The workflow iterates through each image:
- Download: Fetches the raw image.
- Base64 Conversion: Prepares the binary data for the Gemini API.
- API Request: Sends the image with a precise removal prompt.
The Removal Prompt
The key difference from the Ad Creative workflow is the prompt instructions:
{
"contents": [{
"parts": [
{ "text": "Remove the background from this image. The output should be the main subject of the image on a purely transparent background. Ensure edges are clean and precise." },
{
"inline_data": {
"mime_type": "image/png",
"data": "{{ $node['Convert to Base64'].json.data }}"
}
}
]
}]
}
Step 3: Output Processing
- The model returns the isolated subject on a transparent layer (PNG).
- The workflow saves the result to a designated Output Folder.
- It appends
_nobgto the original filename (e.g.,shoe_1.jpg->shoe_1_nobg.png).
How to Use This Workflow
Prerequisites
- n8n: A self-hosted instance or n8n cloud account.
- Google Cloud Project: Enabled "Generative Language API" (Gemini).
- Google Drive API: Enabled credentials.
Setup Instructions
- Import the Workflow: Download the JSON file below and import it into n8n.
- Configure Credentials:
- Set up your Google Drive credentials.
- Set up your Wisdom Gate API key.
- Set Folder IDs:
- Input Folder: Copy the ID of the Drive folder containing your source images into the
List Input Imagesnode. - Output Folder: Copy the ID of the destination folder into the
Upload Resultnode.
- Input Folder: Copy the ID of the Drive folder containing your source images into the
- Run: Click "Execute Workflow".
Download Workflow
Contact support@juheapi.com to get the complete JSON workflow file.
Resources: