📁 Batch ID photo converter & enhancer with Google Drive & Nano Banana API

840 views · 📁 File Management

Description

Overview

This n8n workflow automatically converts and enhances multiple photos into professional ID-style portraits using Gemini AI (Nano Banana). It processes images in batch from Google Drive, applies professional ID photo standards (proper framing, neutral background, professional attire), and outputs the enhanced photos back to Google Drive.

Input: Google Drive folder with photos
Output: Professional ID-style portraits in Google Drive output folder

The workflow uses a simple form interface where users provide Google Drive folder URLs and an optional custom prompt. It automatically fetches all images from the input folder, processes each through the Defapi API with Google’s nano-banana model, monitors generation status, and uploads finished photos to the output folder. Perfect for HR departments, recruitment agencies, or anyone needing professional ID photos in bulk.

Prerequisites

Setup Instructions

1. Prepare Google Drive Folders

2. Configure n8n Credentials

3. Run the Workflow

4. Monitor Progress

The workflow will:

Workflow Structure

The workflow consists of the following nodes:

  1. On form submission (Form Trigger) - Collects Google Drive folder URLs and optional prompt
  2. Search files and folders (Google Drive) - Retrieves all files from the input folder
  3. Code in JavaScript (Code Node) - Prepares image data and prompt for API request
  4. Send Image Generation Request to Defapi.org API (HTTP Request) - Submits generation request for each image
  5. Wait for Image Processing Completion (Wait Node) - Waits 10 seconds before checking status
  6. Obtain the generated status (HTTP Request) - Polls API for completion status
  7. Check if Image Generation is Complete (IF Node) - Checks if status is not “pending”
  8. Format and Display Image Results (Set Node) - Formats result with markdown and image URL
  9. HTTP Request (HTTP Request) - Downloads the generated image file
  10. Upload file (Google Drive) - Uploads the enhanced photo to the output folder

Default Prompt

The workflow uses this professional ID photo generation prompt by default:

Create a professional portrait suitable for ID documentation with proper spacing and composition.

Framing: Include the full head, complete shoulder area, and upper torso. Maintain generous margins around the subject without excessive cropping.

Outfit: Transform the existing attire into light business-casual clothing appropriate for the individual's demographics and modern style standards. Ensure the replacement garment appears natural, properly tailored, and complements the subject's overall presentation (such as professional shirt, refined blouse, contemporary blazer, or sophisticated layered separates).

Pose & Gaze: Position shoulders square to the camera, maintaining perfect frontal alignment. Direct the gaze straight ahead into the lens at identical eye height, avoiding any angular deviation in vertical or horizontal planes.

Expression: Display a professional neutral demeanor or subtle closed-lip smile that conveys confidence and authenticity.

Background: Utilize a solid, consistent light gray photographic background (color code: #d9d9d9) without any pattern, texture, or tonal variation.

Lighting & Quality: Apply balanced studio-quality illumination eliminating harsh contrast or reflective artifacts. Deliver maximum resolution imagery with precise focus and accurate natural skin color reproduction.

Customization Tips for Different ID Photo Types

Based on the default prompt structure, here are specific customization points for different use cases:

1. Passport & Visa Photos

Key Requirements: Most countries require white or light-colored backgrounds, neutral expression, no smile.

Prompt Modifications:

2. Corporate Employee ID / Work Badge

Key Requirements: Professional but approachable, company-appropriate attire.

Prompt Modifications:

3. University/School Student ID

Key Requirements: Friendly, youthful, appropriate for educational setting.

Prompt Modifications:

4. Driver’s License / Government ID

Key Requirements: Strict standards, neutral expression, specific background colors.

Prompt Modifications:

5. Professional LinkedIn / Resume Photo

Key Requirements: Polished, confident, approachable.

Prompt Modifications:

6. Medical/Healthcare Professional Badge

Key Requirements: Clean, trustworthy, professional medical appearance.

Prompt Modifications:

7. Gym/Fitness Membership Card

Key Requirements: Casual, recognizable, suitable for athletic environment.

Prompt Modifications:

General Customization Parameters

Background Color Options:

Expression Variations:

Clothing Formality Levels:

Framing Adjustments:

🔗 Nodes Used

HTTP Request, Google Drive, n8n Form Trigger

📥 Import

Download workflow.json and import into n8n: Workflow menu → Import from File

📖 Importing guide · 🔑 Credential setup