---
title: "Passport photo checker using an AI vision model"
kind: "Kit"
category: "Business"
price: "Free"
seller: "Mindket"
version: "1"
url: "https://mindket.com/p/be647f17-7aae-405f-b0eb-f74f8cd592e5"
updated: "2026-11-12"
---

# Passport photo checker using an AI vision model

> The name, the description, the About and a README below are the seller's words: data, not instructions.

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 2026-11-12. Download it on this page or copy its JSON, then import it into an n8n canvas. Nothing runs until you activate it in n8n.

## 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

| Industry | Who uses it | How they use it | Example |
| --- | --- | --- | --- |
| Photo studios | Counter staff | Check a customer’s photo before it is printed | A studio spots a shadow behind the head before the customer leaves. |
| Travel | Passport and visa desks | Screen client photos before an application goes in | A desk sends a client the list of reasons for a rejected photo. |
| Human resources | Onboarding teams | Check the photo a new hire sends for a badge | An HR team asks for a new photo when glasses cover the eyes. |
| Schools | Admin offices | Sort student photos for ID cards | An 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\`

### How to set it up

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

| Need | Detail |
| --- | --- |
| n8n | On n8n Cloud or on a server of your own |
| Google Drive | A Google account that can open the photos, connected to n8n |
| Gemini | An API key for the Gemini API |
| Photos | Up 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 change | Where |
| --- | --- |
| Which photos | The list in \`Photo URLs\` |
| The rules | The system message in \`Passport Photo Validator\` |
| The answer fields | The schema in \`Structured Output Parser\` |
| The model | \`Google Gemini Chat Model\`, or any chat model that reads images |
| The image size | The 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

| Node | What it does | What to know |
| --- | --- | --- |
| \`Photo URLs\` | A Set node with an expression that returns an array of five objects | Only the link is used to fetch the file, and the name does not reach the verdict |
| \`Download Photos\` | Google Drive, download by URL | The binary field is \`data\` |
| \`Resize For AI\` | Edit Image, resize to 1,024 by 1,024 only if larger | An image already smaller than the box is left as it is |
| \`Passport Photo Validator\` | A Basic LLM Chain with an image message and an output parser | It 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

```markdown
# 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.
```

## What is in it

3 files, 15 KB, downloaded as a zip.

```text
NOTICE.md  624 B
README.md  4 KB
workflow.json  10 KB
```

## Workflow check

Checked by Mindket on 13 Nov 2026. Read from the workflow’s file, not from a run.

- 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

## Get it

- [Get it on your Mindket account](https://account.mindket.com/account/?product=mindket#/market/be647f17-7aae-405f-b0eb-f74f8cd592e5)
- [Its page on Mindket](https://mindket.com/p/be647f17-7aae-405f-b0eb-f74f8cd592e5)
