AI Image Generation: Gemini, FLUX.1, and the perfect prompt
Allow users to generate images for their tasks, directly from the app. "Create an image for my task" and voilà, a relevant illustration appears.
Choosing providers
- Gemini 2.5 Flash Image (via OpenRouter): excellent quality/speed ratio
- Runware FLUX.1: economical alternative, perfect for high volumes
The admin switches between the two from the dashboard.
LLM-powered prompt engineering
Asking a user to write a good prompt is unrealistic. The conversational LLM analyzes the context — title, description, tags — and generates an optimized prompt for the image model.
Style options
Four predefined styles: flat (vector illustrations), minimalist, realistic, watercolor. Each style modifies the prompt sent to the model.
The technical pipeline
User request → LLM prompt → image provider → base64 → upload Supabase Storage → signed URL → display. Each step can fail — retry with backoff and automatic Gemini → FLUX.1 fallback.
Controlled cost
Limits per plan: Free has no access, Pro has a daily quota, Team has a higher quota. Result: users love it. A task with an image is immediately more engaging.