Back to Firebase Js Sdk

ImagenGenerationConfig interface

docs-devsite/ai.imagengenerationconfig.md

12.12.15.4 KB
Original Source

Project: /docs/reference/js/_project.yaml Book: /docs/reference/_book.yaml page_type: reference

{% comment %} DO NOT EDIT THIS FILE! This is generated by the JS SDK team, and any local changes will be overwritten. Changes should be made in the source code at https://github.com/firebase/firebase-js-sdk {% endcomment %}

ImagenGenerationConfig interface

Warning: This API is now obsolete.

All Imagen models are deprecated and will shut down as early as June 2026. As a replacement, you can migrate your apps to use Gemini Image models (the "Nano Banana" models)<!-- -->.

Configuration options for generating images with Imagen.

See the documentation for more details.

<b>Signature:</b>

typescript
export interface ImagenGenerationConfig 

Properties

PropertyTypeDescription
addWatermarkbooleanWhether to add an invisible watermark to generated images.<!-- -->If set to <code>true</code>, an invisible SynthID watermark is embedded in generated images to indicate that they are AI generated. If set to <code>false</code>, watermarking will be disabled.<!-- -->For Imagen 3 models, the default value is <code>true</code>; see the <a href="http://firebase.google.com/docs/vertex-ai/model-parameters#imagen">addWatermark</a> documentation for more details.<!-- -->When using the Gemini Developer API (GoogleAIBackend<!-- -->), this will default to true, and cannot be turned off.
aspectRatioImagenAspectRatioThe aspect ratio of the generated images. The default value is square 1:1. Supported aspect ratios depend on the Imagen model, see ImagenAspectRatio for more details.
imageFormatImagenImageFormatThe image format of the generated images. The default is PNG.<!-- -->See ImagenImageFormat for more details.
negativePromptstringA description of what should be omitted from the generated images.<!-- -->Support for negative prompts depends on the Imagen model.<!-- -->See the documentation for more details.<!-- -->This is no longer supported in the Gemini Developer API (GoogleAIBackend<!-- -->) in versions greater than <code>imagen-3.0-generate-002</code>.
numberOfImagesnumberThe number of images to generate. The default value is 1.<!-- -->The number of sample images that may be generated in each request depends on the model (typically up to 4); see the <a href="http://firebase.google.com/docs/vertex-ai/model-parameters#imagen">sampleCount</a> documentation for more details.

ImagenGenerationConfig.addWatermark

Whether to add an invisible watermark to generated images.

If set to true<!-- -->, an invisible SynthID watermark is embedded in generated images to indicate that they are AI generated. If set to false<!-- -->, watermarking will be disabled.

For Imagen 3 models, the default value is true<!-- -->; see the <a href="http://firebase.google.com/docs/vertex-ai/model-parameters#imagen">addWatermark</a> documentation for more details.

When using the Gemini Developer API (GoogleAIBackend<!-- -->), this will default to true, and cannot be turned off.

<b>Signature:</b>

typescript
addWatermark?: boolean;

ImagenGenerationConfig.aspectRatio

The aspect ratio of the generated images. The default value is square 1:1. Supported aspect ratios depend on the Imagen model, see ImagenAspectRatio for more details.

<b>Signature:</b>

typescript
aspectRatio?: ImagenAspectRatio;

ImagenGenerationConfig.imageFormat

The image format of the generated images. The default is PNG.

See ImagenImageFormat for more details.

<b>Signature:</b>

typescript
imageFormat?: ImagenImageFormat;

ImagenGenerationConfig.negativePrompt

A description of what should be omitted from the generated images.

Support for negative prompts depends on the Imagen model.

See the documentation for more details.

This is no longer supported in the Gemini Developer API (GoogleAIBackend<!-- -->) in versions greater than imagen-3.0-generate-002<!-- -->.

<b>Signature:</b>

typescript
negativePrompt?: string;

ImagenGenerationConfig.numberOfImages

The number of images to generate. The default value is 1.

The number of sample images that may be generated in each request depends on the model (typically up to 4); see the <a href="http://firebase.google.com/docs/vertex-ai/model-parameters#imagen">sampleCount</a> documentation for more details.

<b>Signature:</b>

typescript
numberOfImages?: number;