What could make this photo better?

Building photo feedback that connects visible details with photography references people can inspect.

Make the feedback actionable

A useful photo critique explains what works and suggests something the photographer can change: the framing, the light, or the edit.

I built AI Photo Critique as an upload-and-review flow, using the photo and a searchable library of photography references to produce practical feedback. The public site now shows a fixed example review. Live uploads and new reviews are paused.

Keep the original photo in the review

The review pipeline uses Cloudflare Workers AI and Vectorize:

  1. A vision model describes the subject, framing, lighting, colors, depth, focus, and distractions.
  2. An embedding model turns that description into a search query for the photography library.
  3. Vectorize retrieves the four closest passages, including document titles and page numbers.
  4. The vision model receives the original photo and those passages, then writes the critique.

The description helps find reference material. Sending the original image again lets the final review examine the visible details directly. An incomplete description can still lead to less relevant search results.

If retrieval returns no usable passages, the request stops with an error.

Make the sources inspectable

The critique has two sections: what works well and areas for improvement. It includes numbered references to the supplied passages.

An expandable reference section shows document titles, page numbers, and excerpts. This lets a photographer see the guidance the model received and decide whether the advice fits their image. The references do not establish that every recommendation is correct.

A separate ingestion script extracts text from photography PDFs, preserves page boundaries, and indexes overlapping passages. The library can change without retraining the model. Re-ingesting a shortened or removed document requires cleaning up stale records, and indexing needs a retrieval check before release.

Validate before using the review allowance

The original review flow accepts JPEG, PNG, and WebP files up to 3 MB. The server checks the file signature as well as the submitted type before a request can consume the allowance.

D1 enforces one accepted request per IP address per rolling hour, using an HMAC-based identifier instead of storing the raw IP. People sharing an IP also share the allowance, and an accepted request counts if inference later fails.

Photos go to Cloudflare for inference; the app does not save them in its database or reference library. The Next.js interface and API remain hosted on Vercel.

Keep recovery visible

The review interface keeps the selected photo visible during processing and after errors. Rate limits include a retry interval, and provider failures produce an explanation beside the upload controls. If the rate-limit service fails, the request stops.

The public demo currently makes no upload or inference requests. It presents a previously generated critique and its references so people can inspect the result.

What I took from it

  • Use the photo and the references for different jobs. The photo supplies visual evidence; retrieval adds relevant guidance.
  • Show what the model received. Inspectable passages help people assess the advice.
  • Validate before consuming quota. An invalid file should not use someone's review allowance.
  • Keep the next step clear. Errors belong beside the selected photo, with enough information to recover.