Writing metadata for one image is easy. Writing consistent, non-repetitive titles, keywords and alt text for 300 images from a single shoot is where most photographers, stock contributors and e-commerce teams give up. This article explains a reliable bulk image metadata workflow using Google's Gemini vision models — the same approach behind the 2nd Code AI Image SEO engine.
Why AI vision works well for metadata
Modern multimodal models can describe people, products, settings, lighting, mood and composition, and then turn that description into search-friendly language. Given a strong instruction ("think like a stock reviewer and a real buyer"), they produce titles and keywords that cover literal, conceptual and commercial intent — the three layers covered in our stock keyword guide.
The workflow, step by step
- Start a project. The server creates an isolated, randomly named folder and a CSV with 27 header columns.
- Select your images (JPG, PNG or WEBP). 100+ files in one go is fine.
- One image per request. Each file is uploaded and sent to Gemini on its own with the system prompt. This keeps attention on one picture and makes failures easy to retry.
- Strict JSON output. The model must return exactly the 27 expected keys. If any column is missing, the row is rejected instead of corrupting the CSV.
- Exact filenames.
image_nameis always overwritten with the real uploaded name, so the CSV matches your files even with spaces, brackets or Unicode characters. - No duplicate titles. The last 20 generated titles are passed back into the prompt so the model avoids repeating itself across a series.
- Download the CSV, then delete the project data from the server with one click.
The 27 columns you get
image_name, seo_title, main_category, subcategory, primary_keyword, secondary_keywords, search_keywords, tags, trend_keywords, micro_keywords, content_cluster, content_cluster_level_1, content_cluster_level_2, commercial_use_case, seo_priority, evergreen_score, seasonal_relevance, visual_style, monetization_score, scene_description, meta_description, alt_text, slug, orientation, mood, location_type, audience
Not every platform needs every column. Stock agencies typically use title and keywords; your own website needs alt text, slug and meta description; a content team can use the cluster and priority fields to plan galleries and blog posts.
API key rotation and failover
Free and low-tier API keys have rate limits. The engine supports several keys at once:
- You can use the built-in free keys, or paste your own Gemini key under Advanced settings.
- Images are spread across active keys in rotation.
- If a request fails with quota, rate-limit, "high demand", 429 or 503 errors, the same image is retried immediately with the next key.
- Built-in keys stay on the server and are never shown in the browser.
Model selection
Gemini model names change over time. Instead of hard-coding one model, the engine asks the API which models the key can use, prefers stable "flash" vision models, and skips text-to-speech, "lite" and preview variants. This keeps the tool working as Google releases and retires models.
Always review before publishing
AI is a fast first draft, not a final answer. Spot-check a sample from every batch, especially for:
- Guesses about people's identity, religion or ethnicity (the prompt forbids these, but check).
- Brand names or trademarks that should not appear in stock metadata.
- Location claims the image cannot prove.
Privacy and cleanup
Uploaded images live in a private, random folder that blocks script execution, and the "Delete project data" button removes every image and the CSV once you have downloaded it. Note that images are sent to Google's Gemini API for analysis, so follow your own client agreements on where images may be processed.
Quick answers
Why process images one by one instead of all at once?
Single-image requests give the model full attention on each picture, make failures easy to retry, and keep one bad file from breaking the whole batch.
What happens when an API key hits its limit?
The engine detects quota, rate-limit and high-demand errors and instantly retries the same image with the next active key.