generate-images-with-firebase-ai

Featured

Use when generating or editing images from Flutter/Dart with Firebase AI Logic and a Gemini image model (Nano Banana), making the first call work, choosing Gemini Developer API vs Vertex AI, hitting quota, billing or App Check failures, getting empty or image-only responses, sending a user photo as input, controlling aspect ratio or size, writing the image prompt, or deciding what to test.

AI & Automation 619 stars 60 forks Updated today MIT

Install

View on GitHub

Quality Score: 95/100

Stars 20%
93
Recency 20%
100
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
50
License 10%
100
Description 5%
100

Skill Content

# 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: ```bash gcloud services quota list --service=generativelanguage.googleapis.com --consumer=projects/YOUR_PROJECT_ID ``` **App Check.** Firebase AI Logic enforces App Check when the project has it turned on. Otherwise the endpoint is open to anyone who extracts your config from the shipped client, and that config is public by design. Anything reachable from a device you do not control needs App Check. Debug builds attest with a debug provider, release builds with a real one. Web has a specific trap that costs an afternoon, described in `references/setup.md`. **`responseModa...

Details

Author
evanca
Repository
evanca/flutter-ai-rules
Created
1 years ago
Last Updated
today
Language
Shell
License
MIT

Integrates with

Similar Skills

Semantically similar based on skill content — not just same category