generate-images-with-firebase-ai
Generating images with Firebase AI Logic
Gemini image models return interleaved text and image parts from one call. The response is a sequence to walk, not a string to read.
A request that comes back empty is usually a configuration problem rather than a bug in your code, so section 1 covers the three settings that cause it.
1. Three things that block the very first call
A first call that returns an error, an empty response, or a 403 is almost always one of these rather than your Dart. Rule them out before you debug code.
Billing. Image generation has no free tier. On a Spark-plan project the
image models return limit: 0 for generate_content_free_tier_requests, so
the first request fails on quota having made zero requests. Text models do work
on Spark, which means "my other Gemini call works" proves nothing. Upgrade to
Blaze, then verify the current limits rather than trusting this note: