Member Junction
    Preparing search index...

    Google Gemini image models (the Nano Banana family) implementation of the BaseImageGenerator class. Supports Google's most advanced image generation model with 2K/4K resolution support.

    Default model: gemini-3-pro-image (Nano Banana Pro, Stable); the catalog pins others — gemini-nano-banana-2.1, gemini-3.1-flash-image (Nano Banana 2), gemini-3.1-flash-lite-image (Nano Banana 2 Lite). The -preview ID is legacy.

    • Native multimodal image generation
    • High resolution output (up to 4K)
    • Advanced style control and prompt understanding

    A request's CancellationToken is handed to the SDK as config.abortSignal, so cancelling it tears the HTTP request down, and no further image of an n-image request is asked for. The call then resolves as cancelled, never as a failure to fail over.

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    _gemini: GoogleGenAI = null

    Accessors

    • get apiKey(): string

      Only sub-classes can access the API key

      Returns string

    Methods

    • The result for a request its CancellationToken ended, before or during the provider call. A caller cancellation is classified Cancelled, Fatal and never failed over; an abort caused by a timeout reads as a retriable network error.

      Parameters

      • signal: AbortSignal

        The request's cancellation signal, read for why it was aborted.

      • Optionalerror: unknown

        The error the abort raised, if any.

      Returns ImageGenerationResult

    • Factory method to create the GoogleGenAI client instance. Subclasses can override this to provide custom configuration.

      Returns Promise<GoogleGenAI>

    • Helper method to convert image input (Buffer, base64, or URL) to the format required by the specific provider. Subclasses can override as needed.

      Parameters

      • input: string | Buffer<ArrayBufferLike>

        Image as Buffer, base64 string, or URL

      Returns Promise<{ base64: string; buffer: Buffer }>

      Normalized image data