SPB Git

Repository Public

imagen.md 753 B 18 lines markdown

1<br />23> [!WARNING]4> Imagen models are shut down. Use Nano Banana for image generation.56Imagen is Google's legacy image generation model. It is now shut down7and no longer available in the Gemini API.89## Migrate to Nano Banana1011Migrate to Nano Banana for image generation:1213- **Model name** : Use `gemini-2.5-flash-image` (or Nano Banana 2 models such as `gemini-3.1-flash-image`) instead of Imagen model names.14- **Method** : Use `client.models.generate_content` instead of `client.models.generate_images`.15- **Response handling**: Nano Banana returns content parts containing image data instead of a specific image response object.1617See the [Image generation guide](https://ai.google.dev/gemini-api/docs/image-generation) for18details and examples.
Files main
Menu

Theme