ProtectedCancelledThe 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.
The request's cancellation signal, read for why it was aborted.
Optionalerror: unknownThe error the abort raised, if any.
ProtectedcreateFactory method to create the GoogleGenAI client instance. Subclasses can override this to provide custom configuration.
ProtectedcreateHelper method to create an error result with proper timing
ProtectedcreateHelper method to create a successful result with proper timing
Create variations of an existing image. Uses the original image as context with a variation prompt.
Edit an existing image using Gemini's multimodal capabilities. Uses image-to-image generation with the original image as context.
Generate image(s) from a text prompt using Gemini 3 Pro Image (Nano Banana Pro).
Get available Gemini image generation models.
Get supported methods for this provider.
ProtectednormalizeHelper method to convert image input (Buffer, base64, or URL) to the format required by the specific provider. Subclasses can override as needed.
Image as Buffer, base64 string, or URL
Normalized image data
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.
A request's
CancellationTokenis handed to the SDK asconfig.abortSignal, so cancelling it tears the HTTP request down, and no further image of ann-image request is asked for. The call then resolves as cancelled, never as a failure to fail over.