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…
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.
Manual start
It starts when you click Test workflow in n8n, and it works on a list of photos:
One verdict per photo: a yes or no, a description of the person and background, and the reasons
What you need before you start.
Vision model
Reads each photo with gemini-3.8-flash and answers against the passport photo rules.
NeedsA Gemini API key
File storage
Downloads each photo from its link.
NeedsA Google account that can open the photos
Checked by Mindket on 13 Nov 2026
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.
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.
| 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.
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.
Passport Photo ValidatorDownload saves a zip with workflow.json and Mindket’s setup notes in your downloads folder. Two accounts and five photos cover every step.
| 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 |
workflow.json.Download Photos.Google Gemini Chat Model.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.Passport Photo Validator to read the verdicts.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.
| 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 |
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.
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.
| 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 |
The model was swapped, and nothing keeps the results.
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 inputAn 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.
workflow.json: the workflow as n8n exports it, eight nodes and three sticky notes. It holds no credential.README.md: these notes.gemini-1.5-pro-latest, which Google no longer lists. It now calls models/gemini-3.8-flash, aPhoto 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>.workflow.json.Download Photos.Google Gemini Chat Model.Photo URLs, replace each placeholder with a photo's file id. It is the text between /d/ and /view in the photo'sportrait_1 to portrait_5 if you like.Passport Photo Validator to read the verdicts.When clicking ‘Test workflow’ starts it.Photo URLs builds a list of five entries, each with a name and a Drive link. Photos To List splits it into five items.Download Photos fetches each file from Drive by its link, into the binary field data.Resize For AI shrinks a photo to fit 1,024 by 1,024 pixels only if it is larger. A smaller photo passes unchanged.Passport Photo Validator sends the rules, the task and the picture to the model as an image message. The picture isdata, the node's default field name.Structured Output Parser shapes the reply into three fields: is_valid, photo_description and reasons. The modelPhoto URLs, or a different source in place of Drive and Photos To List.Passport Photo Validator, which holds the rules as plain text.Structured Output Parser.Google Gemini Chat Model, or any other chat model that reads images.Resize For AI.Passport Photo Validator.Photo URLs.NOTICE.md 624 B README.md 4 KB workflow.json 10 KB
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…
Qwen · Kit
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…
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…
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…
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…
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…