Use Google Gemini 2.0 for Precise Image Object Detection with n8n

Solve the hassle of manual image tagging by automatically detecting objects like rabbits with Google Gemini 2.0 and n8n. This workflow downloads images, detects objects via prompts, and draws bounding boxes, saving hours and improving accuracy.
httpRequest
editImage
code
+2
Workflow Identifier: 2293
NODES in Use: Manual Trigger, HTTP Request, Edit Image, Code, Set

Press CTRL+F5 if the workflow didn't load.

Learn how to Build this Workflow with AI:

Visit through Desktop for Best experience

What this workflow does

This workflow finds and marks objects like rabbits in images automatically.
It solves the problem of manual tagging which is slow and can be wrong.
After running, you get the same image with boxes around all rabbits shown clearly.


Who should use this workflow

This is useful for people who handle lots of photos and want to mark animals or objects fast.
Users with little time or technical skill can quickly label images for marketing or websites.
Beginners can use it with no coding by following simple steps.


Tools and services used

  • n8n platform: For building and running the automation.
  • Google Gemini 2.0 API: Detects objects in images by prompt request.
  • HTTP Request nodes: Download images and call APIs.
  • Edit Image nodes: To get image data and draw bounding boxes.
  • Code node: Runs JavaScript to scale coordinates.
  • self-host n8n option: For users running their own servers.

Inputs, processing, and outputs

Inputs

  • Image downloaded by URL in HTTP Request node (Get Test Image).
  • API key and model prompt for Google Gemini to detect rabbits.

Processing Steps

  • Get image dimensions with Edit Image node (Get Image Info).
  • Send image and prompt to Google Gemini using HTTP Request node (Gemini 2.0 Object Detection).
  • Extract bounding box coordinates normalized 0-1000 scale from API response.
  • Set variables in Set node (Get Variables) for width, height, and coordinates.
  • Use Code node (Scale Normalised Coords) to convert normalized boxes to actual pixel positions.
  • Draw colored bounding boxes onto the original image with Edit Image node (Draw Bounding Boxes).

Outputs

  • Image with visible bounding boxes around all detected rabbits.
  • Output can be saved, shared, or used for marketing easily.

Beginner step-by-step: How to use this workflow in n8n

Step 1: Download the workflow

  1. Click the Download button on this page to get the workflow file.

Step 2: Import into n8n editor

  1. Open the n8n editor you have access to (cloud or self-host n8n server).
  2. Go to menu and select “Import from File” and upload the workflow JSON you downloaded.

Step 3: Configure required settings

  1. Enter Google Gemini 2.0 API Key in the HTTP Request node (Gemini 2.0 Object Detection).
  2. If needed, update the image URL in HTTP Request node (Get Test Image).
  3. If changing detected objects, update prompt JSON in the Gemini node:
{
  "prompt": "I want to see all bounding boxes of rabbits in this image."
}
  1. Check other settings like email, folder, or channels if added.

Step 4: Test the workflow

  1. Click the Manual Trigger node and then “Execute Workflow” to make sure it runs without errors.

Step 5: Activate for production

  1. Change trigger node if you want automatic runs (like on new image upload).
  2. Save and activate the workflow for daily or real use.

Following these steps lets even new users automate object detection fast in n8n.


Customization ideas

  • Change prompt inside Gemini API node to detect different things like cars or dogs.
  • Update image URL to use any photo for detection.
  • Modify draw colors or box thickness in the Edit Image node (Draw Bounding Boxes) to fit your look.
  • Add nodes after drawing to save images to cloud or send via email automatically.
  • Run multiple API calls with different prompts for complex images with many objects.

Edge cases and troubleshooting

No bounding boxes returned

Check if the image really has objects matching your prompt.
Try using a simpler or clearer prompt message.

Boxes don’t match image

Double-check image width and height from the Get Image Info node.
Make sure scale code in the Code node matches these sizes exactly.

API call fails

Confirm API Key is correct and active in Gemini node credentials.
Watch for network issues or expired key problems.


Summary of results

→ Automatically detects and marks animals or objects by prompt.
→ Saves manual tagging time and improves accuracy.
→ Provides easy-to-see bounding boxes on original images.
→ Simple to configure and run inside n8n editor.
→ Can be customized for many detection tasks by changing prompts or images.


Frequently Asked Questions

The workflow needs images accessible by URL or uploaded inside n8n as binary data to send to the Google Gemini API.
Yes, each call to the Google Gemini 2.0 API counts against usage quota according to Google pricing.
Verify the image width and height from the Get Image Info node and ensure the scaling code uses those values exactly.
It can, but may require multiple API calls with varied prompts or more precise prompting for complex scenes.

Promoted by BULDRR AI

Related Workflows

Automate Viral UGC Video Creation Using n8n + Degaus (Beginner-Friendly Guide)

Learn how to automate viral UGC video creation using n8n, AI prompts, and Degaus. This beginner-friendly guide shows how to import, configure, and run the workflow without technical complexity.
Form Trigger
Google Sheets
Gmail
+37
Free

AI SEO Blog Writer Automation Workflows in n8n

A complete beginner guide to building an AI SEO blog writer automation using n8n.
AI Agent
Google Sheets
httpRequest
+5
Free

Automate CrowdStrike Alerts with VirusTotal, Jira & Slack

This workflow automates processing of CrowdStrike detections by enriching threat data via VirusTotal, creating Jira tickets for incident tracking, and notifying teams on Slack for quick response. Save hours daily by transforming complex threat data into actionable alerts effortlessly.
scheduleTrigger
httpRequest
jira
+5
Free

Automate Telegram Invoices to Notion with AI Summaries & Reports

Save hours on financial tracking by automating invoice extraction from Telegram photos to Notion using Google Gemini AI. This workflow extracts data, records transactions, and generates detailed spending reports with charts sent on schedule via Telegram.
lmChatGoogleGemini
telegramTrigger
notion
+9
Free

Automate Email Replies with n8n and AI-Powered Summarization

Save hours managing your inbox with this n8n workflow that uses IMAP email triggers, AI summarization, and vector search to draft concise replies requiring minimal review. Automate business email processing efficiently with AI guidance and Gmail integration.
emailReadImap
vectorStoreQdrant
emailSend
+12
Free

Automate Email Campaigns Using n8n with Gmail & Google Sheets

This n8n workflow automates personalized email outreach campaigns by integrating Gmail and Google Sheets, saving hours of manual follow-up work and reducing errors in email sequences. It ensures timely follow-ups based on previous email interactions, optimizing communication efficiency.
googleSheets
gmail
code
+5
Free