Mindket

Passport photo checker using an AI vision model

Newversion 1 · updated

Overview

An n8n workflow that downloads five photos from Google Drive, shrinks the large ones and asks a Gemini vision model to check each against the UK passport photo rules. Every photo gets a yes or no and its reasons.

Passport photo checker using an AI vision model is an n8n workflow in the Business category, listed by Mindket. It is free. This is version 1, last updated on . Download it on this page or copy its JSON, then import it into an n8n canvas. Nothing runs until you activate it in n8n.

At a glance

Runs in
  • n8n Cloud: import the file into a new workflow there
  • Your own n8n server: the same file and steps, with GraphicsMagick for the Edit Image node, which n8n’s Docker image includes
  • Another source: swap Google Drive for a webhook, an email or other storage
  • Another rulebook: change the rules in the prompt of Passport Photo Validator

Platform

Connects 2 apps

How it works

Trigger

Manual start

It starts when you click Test workflow in n8n, and it works on a list of photos:

  • Five Google Drive links, set in the Photo URLs node

Actions

  1. Photo URLs lists five photos by name and Drive link, and each becomes its own item
  2. Google Drive downloads each file
  3. Edit Image shrinks any photo larger than 1,024 by 1,024 pixels
  4. Gemini reads each picture against the UK passport photo rules in the prompt
  5. A parser shapes the reply into is_valid, photo_description and reasons

Result

One verdict per photo: a yes or no, a description of the person and background, and the reasons

Integrations

What you need before you start.

Google Gemini

Vision model

Reads each photo with gemini-3.8-flash and answers against the passport photo rules.

NeedsA Gemini API key

Google Drive

File storage

Downloads each photo from its link.

NeedsA Google account that can open the photos

Workflow check

Checked by Mindket on 13 Nov 2026

Steps
6 steps, starting by hand
AI
1 step calls an AI model: Passport Photo Validator
Sign-ins
Signs in to: Google Drive and Google Gemini
API keys
No API key is left in the file
Step types
Mindket’s checker reads all 6 of its step types

Read from the workflow’s file, not from a run.

About

What it is

This n8n workflow checks portraits against the UK government’s rules for passport photos. You run it by hand. It builds a list of five Google Drive links, downloads each photo and shrinks any larger than 1,024 pixels. Each photo goes to a Google Gemini vision model with the rules written into the prompt. The model returns a yes or no, a description of the person and the background, and a list of reasons. Eight nodes do the work, beside three sticky notes.

Who it suits

Photo studios, travel desks and onboarding teams that collect passport-style photos and want a first look before a person checks them. Skip it if the verdict has to be final. A model can miss a shadow, and it cannot measure a photo’s pixels or file size.

Who uses it, and how
IndustryWho uses itHow they use itExample
Photo studiosCounter staffCheck a customer’s photo before it is printedA studio spots a shadow behind the head before the customer leaves.
TravelPassport and visa desksScreen client photos before an application goes inA desk sends a client the list of reasons for a rejected photo.
Human resourcesOnboarding teamsCheck the photo a new hire sends for a badgeAn HR team asks for a new photo when glasses cover the eyes.
SchoolsAdmin officesSort student photos for ID cardsAn office sets aside photos with a hat or a busy background.

You need a little n8n: import a file, add two credentials and paste five Drive file ids. The workflow’s own sticky notes give no setup time.

Where to use it

Any n8n that can reach Google Drive and the Gemini API will run it. It starts from the canvas, and the verdicts show in the run.

  • n8n Cloud: import the file into a new workflow there
  • Your own n8n server: the same file and steps, with GraphicsMagick for the Edit Image node, which n8n’s Docker image includes
  • Another source: swap Google Drive for a webhook, an email or other storage
  • Another rulebook: change the rules in the prompt of Passport Photo Validator

Setup

Download saves a zip with workflow.json and Mindket’s setup notes in your downloads folder. Two accounts and five photos cover every step.

What you need first
NeedDetail
n8nOn n8n Cloud or on a server of your own
Google DriveA Google account that can open the photos, connected to n8n
GeminiAn API key for the Gemini API
PhotosUp to five portraits, as Drive file ids
  1. In n8n, create a workflow, open its menu, choose Import from File and pick workflow.json.
  2. Add a Google Drive credential and select it in Download Photos.
  3. Add a Google Gemini (PaLM) API credential with your key and select it in Google Gemini Chat Model.
  4. In Photo URLs, replace each placeholder, from <YOUR_PHOTO_1_FILE_ID> to <YOUR_PHOTO_5_FILE_ID>, with a photo’s file id. It is the text between /d/ and /view in the photo’s Drive link.
  5. Click the Test workflow button, then open Passport Photo Validator to read the verdicts.

How to use it

Put the portraits in Drive, list them in Photo URLs and run the workflow. You get one item per photo, in the order of the list, with is_valid, photo_description and reasons. A verdict does not repeat the photo’s name, so match them by order.

What to change for a different result
To changeWhere
Which photosThe list in Photo URLs
The rulesThe system message in Passport Photo Validator
The answer fieldsThe schema in Structured Output Parser
The modelGoogle Gemini Chat Model, or any chat model that reads images
The image sizeThe width and height in Resize For AI

Example

A studio lists five photos. Four come back valid with an empty list of reasons. The fifth comes back invalid, and its reasons say the person wears tinted glasses and the background has a shadow.

The description field repeats what the model saw: the person’s clothes, the colour of the wall and whether anything else is in the frame. That helps a person see at a glance whether the model looked at the right picture.

For newcomers and experts

If you are new. n8n draws a workflow as boxes joined by lines, and each box, a node, does one job. This one runs once per photo. Start with a single clear photo and a single poor one, then compare the reasons the model gives with what you see.

For experts. One model call runs per photo, and the picture goes in as an image message.

Where to look closer
NodeWhat it doesWhat to know
Photo URLsA Set node with an expression that returns an array of five objectsOnly the link is used to fetch the file, and the name does not reach the verdict
Download PhotosGoogle Drive, download by URLThe binary field is data
Resize For AIEdit Image, resize to 1,024 by 1,024 only if largerAn image already smaller than the box is left as it is
Passport Photo ValidatorA Basic LLM Chain with an image message and an output parserIt reads the picture from data, the node’s default field name

Good to know

The model was swapped, and nothing keeps the results.

  • Model: Google no longer lists gemini-1.5-pro-latest, so Mindket’s copy calls models/gemini-3.8-flash, which Google’s model page, read on 12 November 2026, lists as stable with image input
  • Results: nothing saves the verdicts. Add a Google Sheets, database or email node after the chain to keep them
  • Limits of a model: it cannot measure pixels or file size, so the width, height and file size rules in the prompt are not checked, and a small photo can pass
  • Rules: the prompt holds the UK rules as they were copied. Compare them with the government’s page before you rely on them, and change them for another country
  • People: the photos go to Google’s Gemini API, so check that your privacy notice allows it
  • Billing: each photo is one model call with an image
  • Access: the connected Google account must be able to open every file
  • Credentials: the JSON holds none

README and files

README

Passport photo checker using an AI vision model

An n8n workflow you start by hand. It builds a list of five Google Drive links, downloads each photo and shrinks any that is
larger than 1,024 pixels. Each photo then goes to a Google Gemini vision model, with the UK government's rules for digital
passport photos written into the prompt. For every photo the model returns a yes or no, a description of the person and the
background, and a list of reasons.

What is inside

  • workflow.json: the workflow as n8n exports it, eight nodes and three sticky notes. It holds no credential.
  • README.md: these notes.

What we changed from the original copy

  • The model node called gemini-1.5-pro-latest, which Google no longer lists. It now calls models/gemini-3.8-flash, a
    stable model on Google's model page, read on 12 November 2026, that takes images as input.
  • The five Drive links in Photo URLs pointed at the author's own files. Each file id is now a placeholder, from
    <YOUR_PHOTO_1_FILE_ID> to <YOUR_PHOTO_5_FILE_ID>.
  • The Google Drive and Google Gemini nodes lost their links to a credential in the author's n8n. Select your own.
  • Nothing else. The file has no Code node.

Before you start

  • An n8n instance, on n8n Cloud or your own server. The Edit Image node uses GraphicsMagick, which n8n's Docker image includes.
  • A Google account whose Drive can open the photos, connected to n8n as a Google Drive credential.
  • An API key for the Gemini API, for a Google Gemini credential.
  • Up to five test portraits in that Drive.

Set it up

  1. In n8n, create a workflow, open its menu and choose Import from File. Pick workflow.json.
  2. Add a Google Drive credential and select it in Download Photos.
  3. Add a Google Gemini (PaLM) API credential with your key and select it in Google Gemini Chat Model.
  4. In Photo URLs, replace each placeholder with a photo's file id. It is the text between /d/ and /view in the photo's
    Drive link. Rename portrait_1 to portrait_5 if you like.
  5. Click the Test workflow button. Open Passport Photo Validator to read the verdicts.

How a run goes

  1. When clicking ‘Test workflow’ starts it.
  2. Photo URLs builds a list of five entries, each with a name and a Drive link. Photos To List splits it into five items.
  3. Download Photos fetches each file from Drive by its link, into the binary field data.
  4. Resize For AI shrinks a photo to fit 1,024 by 1,024 pixels only if it is larger. A smaller photo passes unchanged.
  5. Passport Photo Validator sends the rules, the task and the picture to the model as an image message. The picture is
    read from data, the node's default field name.
  6. Structured Output Parser shapes the reply into three fields: is_valid, photo_description and reasons. The model
    answers once per photo, so five photos give five items.

Change the look

  • Which photos: the list in Photo URLs, or a different source in place of Drive and Photos To List.
  • The rules: the system message in Passport Photo Validator, which holds the rules as plain text.
  • The answer: the schema in Structured Output Parser.
  • The model: Google Gemini Chat Model, or any other chat model that reads images.
  • The image size: the width and height in Resize For AI.

Good to know

  • Nothing saves the verdicts. They exist in the run only, until you add a Google Sheets, database or email node after
    Passport Photo Validator.
  • A verdict does not repeat the photo's name. Match the five items to the list by their order in Photo URLs.
  • The model sees only the picture. It cannot measure pixels or file size, so the rules about width, height and 50KB to 10MB
    are not checked, and a photo that is too small can still pass. Check those separately.
  • The rules in the prompt were copied from the UK government's page for passport photos. Compare them with that page before you
    rely on them, and change them for any other country.
  • A model can be wrong about glare, shadows or an expression. Use the verdict to sort photos, and let a person make the call
    on the ones that matter.
  • The photos go to Google's Gemini API, and they are pictures of people. Check that your privacy notice and the people in the
    photos allow it.
  • Each photo is one model call with an image, so five photos cost five calls.
  • Drive access follows the credential. The account you connect must be able to open every file.
Files
NOTICE.md  624 B
README.md  4 KB
workflow.json  10 KB

3 files, 15 KB, downloaded as a zip.

What’s new

  • Version 1 · 2026-11-12

Reviews

No ratings yet

Write a review

No reviews yet.

More from Mindket

See all from Mindket

anaksor-ocr

Sokheng · Kit

Reads Khmer and English text from documents, receipts and photos of signs, using a detector for text lines and a recogniser for each line. Suits developers who…

New

Qwen2.5-7B-Instruct as GGUF files in eight quantization sizes, to chat with locally through llama.cpp. For people who want a capable 7.6B model on their own co…

New

ACE-Step 1.5 XL SFT

ACE-Step · Kit

Generates music from text with a 4B diffusion decoder, 50 steps and guidance control, aiming for higher audio quality than the base. For creators with a GPU of…

New

Similar in Business

See all in Business

pplx-decider-v1.1-27b

perplexity-ai · Kit

Picks the best option for a decision from text and images, such as which team should handle a request, with a probability for each choice, for developers who b…

New

NuExtract3

numind · Kit

Reads documents as text or images and fills a JSON template with the fields you ask for, or converts the pages to Markdown. A 4B model for teams that process s…

New

Drex DLM

nace-ai · Kit

Scores yes or no, multiple choice and rating questions about a document in one pass, with a probability for every option. An 8B decision model from Nace.AI tha…

New