chatboxai/chatbox · error · ApiError

This Gemini model does not support image generation

Error message

This Gemini model does not support image generation

What it means

Error "This Gemini model does not support image generation" thrown in chatboxai/chatbox.

Source

Thrown at src/shared/providers/definitions/models/custom-gemini.ts:115

        } satisfies GoogleGenerativeAIProviderOptions,
      }
    }

    return settings
  }

  public async paint(
    params: {
      prompt: string
      images?: { imageUrl: string }[]
      num: number
      aspectRatio?: string
    },
    signal?: AbortSignal,
    callback?: (picBase64: string) => void | Promise<void>
  ): Promise<string[]> {
    if (!isGeminiImageModel(this.options.model.modelId)) {
      throw new ApiError('This Gemini model does not support image generation')
    }

    const provider = this.getProvider()
    const model = provider.chat(this.options.model.modelId)

    const results: string[] = []
    for (let i = 0; i < params.num; i++) {
      const providerOptions: GoogleGenerativeAIProviderOptions = {
        responseModalities: ['TEXT', 'IMAGE'],
      }
      const imageConfig = buildGeminiImageConfig(params.aspectRatio)
      if (imageConfig) {
        providerOptions.imageConfig = imageConfig
      }

      const result = await generateText({
        model,
        messages: [{ role: 'user', content: params.prompt }],

View on GitHub (pinned to 81571269ad)

Solutions

  1. Select a Gemini model that supports image generation (e.g. gemini-2.0-flash-preview-image-generation or another model where isGeminiImageModel returns true).
  2. Use a chat-capable Gemini model for text and switch to an image model only for image requests.
  3. Update the app if the model you want was recently added to the supported image model list.

Example fix

if (!isGeminiImageModel(this.options.model.modelId)) {
  // Pick an image-capable model in settings before calling paint()
}

When it happens

Trigger: Thrown at src/shared/providers/definitions/models/custom-gemini.ts:115 when the library encounters an invalid state.

Common situations: Occurs in src/shared/providers/definitions/models/custom-gemini.ts when image generation is requested on a custom Gemini model that does not support it.


AI-assisted analysis of chatboxai/chatbox@81571269ad (2026-08-12). Data as JSON: /api/errors/2db9d4fb6c2f2a71. Report an issue: GitHub.