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
Automate image object detection with n8n and Google Gemini

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

Learn how to Build this Workflow with AI:

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.


Automate image object detection with n8n and Google Gemini

Visit through Desktop to Interact with the Workflow.

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 Twist Channel Creation and Messaging with n8n

This workflow automates creating and updating a channel in Twist and sending a personalized message to specific users. It eliminates manual setup errors and saves time managing Twist communications.

Automate Ideogram Image Generation with Google Sheets & Gmail

This workflow automates graphic design image generation via Ideogram AI, storing image data in Google Sheets and Google Drive, with email alerts via Gmail. It saves designers hours by automating image creation, remixing, review, and record-keeping.

Automate IT Support with Slack and OpenAI in n8n

Streamline IT support by automating Slack message handling using n8n and OpenAI. This workflow handles Slack DMs, filters bots, queries a Confluence knowledge base, and delivers AI-generated responses, improving support efficiency and response time.

Automate Crypto Analysis with CoinMarketCap & n8n AI Agent

Discover how this unique n8n workflow leverages CoinMarketCap’s multi-agent AI to deliver precise, real-time cryptocurrency insights directly via Telegram. Manage crypto data analysis efficiently with automated multi-source API integration.

Automate Gumroad to Beehiiv Subscriber Sync with n8n

Learn how to automatically add new Gumroad sales customers as Beehiiv newsletter subscribers using n8n automation. This workflow saves time by syncing sales data to Google Sheets CRM and notifying your Telegram channel instantly.

Generate On-Brand Blog Articles Using n8n and OpenAI

This workflow automates the creation of on-brand blog articles by analyzing existing company content using n8n and OpenAI. It extracts article structures and brand voice to produce consistent draft articles, saving significant content creation time.
1:1 Free Strategy Session
Your competitors are already automating. Are you still paying for it manually?

Do you want to adopt AI Automation?

Every hour your team does repetitive work, you're burning real money.
While you wait, faster businesses are cutting costs and moving quicker.
AI and automations aren't the future anymore — they're the present.

Book a live 1-on-1 session where we show you exactly which of your daily tasks can be automated — and what it’s costing you not to.