DEV Community

Cover image for Building an AI Image Detector with Next.js: Lessons from Shipping Fast
Jasper Smith
Jasper Smith

Posted on

Building an AI Image Detector with Next.js: Lessons from Shipping Fast

I recently shipped AI Picture Checker — a free online AI Image Detector that identifies whether a photo was generated by AI and, more importantly, which model created it (Midjourney, DALL·E, Gemini, Flux, etc.).

Here is what I learned from building and launching it in under two weeks.


The Problem

Most AI image detectors give you a vague "AI vs Real" percentage. That is fine for curiosity, but useless when you are moderating user uploads or verifying a news photo. You need to know:

  • Is this actually synthetic?
  • Which generator was used?
  • Is it a deepfake or a fully generated image?

Existing tools either hide results behind paywalls or require accounts before you can even test them.


The Stack

  • Next.js 14 (App Router) + TypeScript
  • Supabase — Auth, Postgres, and file storage
  • Vercel — Edge functions and global CDN
  • Detection models — Ensemble of Hive AI API + custom CLIP-based classifier
  • Sharp — Client-side image preprocessing before upload

One Technical Lesson

Do not trust a single model.

During testing, one commercial API scored 96% accuracy on Midjourney v6 images but dropped to 62% on Gemini-generated photos. Inpainted images (real photo + AI-edited regions) fooled it completely.

The fix was an ensemble approach:

  • Run multiple detectors in parallel
  • Weight scores by model confidence
  • Fall back to metadata checks (C2PA signatures) when available

This pushed the blended accuracy above 90% across the board, though it increased the per-request cost to roughly $0.005–$0.008.


The SEO Play

I launched the landing page before the detection API was fully integrated. Why? To start indexing immediately.

I published a dozen blog posts targeting long-tail keywords — AI Image Detector, AI Picture Checker, check if image is AI generated, deepfake detection online — and pointed internal links to the main tool.

Three months later, organic traffic is the primary growth channel. For solo developers, content-first, feature-second is a viable launch strategy.


Try It

You can check if an image is AI-generated at aipicturechecker.com. No signup is required for the first few checks. Upload a JPG, PNG, or WebP (up to 10MB) and get results in seconds.

If you find an image that fools the detector, drop a link in the comments — I use edge cases like that to retrain the model.


Resources


Building AI tools at LuTa Tech. Follow for more write-ups on shipping fast, Next.js architecture, and generative media.

Top comments (0)