This n8n template demonstrates how to get started with Gemini 2.0's new Bounding Box detection capabilities in your workflows. The key difference being this enables prompt-based object detection for images which is pretty powerful for things like contextual search over an image. eg. "Put a bounding box around all adults with children in this image" or "Put a bounding box around cars parked out of bounds of a parking space". How it works An image is downloaded via the HTTP node and an "Edit Image" node is used to extract the file's width and height. The image is then given to the Gemini 2.0 API to parse and return coordinates of the bounding box of the requested subjects. In this demo, we've asked for the AI to identify all bunnies. The coordinates are then rescaled with the original image's width and height to correctl align them. Finally to measure the accuracy of the object detection, we use the "Edit Image" node to draw the bounding boxes onto the original image. How to use Really up to the imagination! Perhaps a form of grounding for evidence based workflows or a higher form of image search can be built.
Tags
Related workflows
See all Edit Image→Overlay or Watermark Images by Merging with Another Image
Instructions This automation overlays a background image with another image, making it easy to add watermarks or logos. You can use this automation to watermark your images by overlaying them with a transparent version of your logo. If you'd like to place your logo in a specific corner, feel free to adjust the position of the overlay image in the code node. How it Works Both images are downloaded, so we can process binary files (you can modify the source, tho.) We extract metadata, focusing on the dimensions of each image. The position of the overlay image is calculated (default: dead center of the background image). The two images are composited together. Limitations and Optimisation Opportunities The overlay image must be the same size or smaller than the background image for proper alignment. The overlay image does not automatically scale to match the proportions of the background image. Enjoy the workflow! ❤️ let the work flow — Workflow Automation & Development
Upscale and watermark real estate photos with Google Drive, Gemini, and Sheets
Quick overview Youtube Explanation: https://youtu.be/tDiR50VJslY This workflow watches a Google Drive folder for new property photos, checks Google Sheets to avoid reprocessing, upscales the image using the Google Gemini API, applies a logo watermark, then uploads the final image to a processed folder and logs the result back to Google Sheets. How it works Triggers every minute when a new file is created in a specific Google Drive folder. Looks up the file name in Google Sheets to see whether the image is already marked as processed. If no processed row exists, downloads the image from Google Drive and extracts its binary data. Sends the image to the Google Gemini (Generative Language) API to enhance and upscale it, then converts the returned base64 image into a binary file. Downloads a watermark logo from a public URL, calculates a bottom-right placement based on the image and logo dimensions, and composites the logo onto the upscaled image. Uploads the watermarked image to a target Google Drive folder and appends or updates a matching row in Google Sheets to mark it as processed. Setup Connect Google Drive OAuth2 credentials and set the source folder to watch and the destination
Build Your Own Image Search Using AI Object Detection, CDN and ElasticSearch
This n8n workflow demonstrates how to automate indexing of images to build a object-based image search. By utilising a Detr-Resnet-50 Object Classification model, we can identify objects within an image and store these associations in Elasticsearch along with a reference to the image. How it works An image is imported into the workflow via HTTP request node. The image is then sent to Cloudflare's Worker AI API where the service runs the image through the Detr-Resnet-50 object classification model. The API returns the object associations with their positions in the image, labels and confidence score of the classification. Confidence scores of less the 0.9 are discarded for brevity. The image's URL and its associations are then index in an ElasticSearch server ready for searching. Requirements A Cloudflare account with Workers AI enabled to access the object classification model. An ElasticSearch instance to store the image url and related associations. Extending this workflow Further enrich your indexed data with additional attributes or metrics relevant to your users. Use a vectorstore to provide similarity search over the images.