Developer API

POST /api/image-to-prompt.php — multipart/form-data with image (jpg/png/webp/gif, max 5 MB) and style (general | midjourney | stable-diffusion | flux | dalle).

Input (verified vs Workers AI schema)

{
  "image": [0..255],   // array of 8-bit integers, Array.from(new Uint8Array(buffer))
  "prompt": "string",
  "max_tokens": 512
}

Output

{ "description": "string" }  ->  mapped to { "prompt": "...", "style": "..." }

The only AI model used is @cf/llava-hf/llava-1.5-7b-hf, called via the Cloudflare Workers AI binding env.AI.run(...). Docs: https://developers.cloudflare.com/workers-ai/models/llava-1.5-7b-hf/