This Cloudflare Worker receives an uploaded image, processes it using Cloudflare AI (LLaVA model), and extracts all numbers detected in the image.
It returns the primary numeric value as distance.
Useful for reading numbers from running watches, timers, digital meters, dashboards, and similar visual displays.
- Accepts image uploads via multipart/form-data
- Uses Cloudflare AI model:
@cf/llava-hf/llava-1.5-7b-hf - Extracts only numbers from the image
- Returns a clean numeric JSON result:
{ "distance": 5.35 }
POST /
Content-Type: multipart/form-data
- file → JPG/PNG image
- Method: POST
- Body: form-data
- Key:
file - Type: File
- Value: Select your image
- Key:
curl -X POST \
-F "file=@/path/to/image.jpg" \
https://your-worker-url.workers.dev{
"distance": 5.35
}If no number is detected:
{
"distance": null
}- Sandi Andrian andrian.sandi@gmail.com