{"record":{"id":"2db9d4fb6c2f2a71","repo":"chatboxai/chatbox","slug":"this-gemini-model-does-not-support-image-generatio","errorCode":null,"errorMessage":"This Gemini model does not support image generation","messagePattern":"This Gemini model does not support image generation","errorType":"exception","errorClass":"ApiError","httpStatus":null,"severity":"error","filePath":"src/shared/providers/definitions/models/custom-gemini.ts","lineNumber":115,"sourceCode":"        } satisfies GoogleGenerativeAIProviderOptions,\n      }\n    }\n\n    return settings\n  }\n\n  public async paint(\n    params: {\n      prompt: string\n      images?: { imageUrl: string }[]\n      num: number\n      aspectRatio?: string\n    },\n    signal?: AbortSignal,\n    callback?: (picBase64: string) => void | Promise<void>\n  ): Promise<string[]> {\n    if (!isGeminiImageModel(this.options.model.modelId)) {\n      throw new ApiError('This Gemini model does not support image generation')\n    }\n\n    const provider = this.getProvider()\n    const model = provider.chat(this.options.model.modelId)\n\n    const results: string[] = []\n    for (let i = 0; i < params.num; i++) {\n      const providerOptions: GoogleGenerativeAIProviderOptions = {\n        responseModalities: ['TEXT', 'IMAGE'],\n      }\n      const imageConfig = buildGeminiImageConfig(params.aspectRatio)\n      if (imageConfig) {\n        providerOptions.imageConfig = imageConfig\n      }\n\n      const result = await generateText({\n        model,\n        messages: [{ role: 'user', content: params.prompt }],","sourceCodeStart":97,"sourceCodeEnd":133,"githubUrl":"https://github.com/chatboxai/chatbox/blob/81571269addb6bafb589a920b2883f1e1e084fd1/src/shared/providers/definitions/models/custom-gemini.ts#L97-L133","documentation":"Error \"This Gemini model does not support image generation\" thrown in chatboxai/chatbox.","triggerScenarios":"Thrown at src/shared/providers/definitions/models/custom-gemini.ts:115 when the library encounters an invalid state.","commonSituations":"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.","solutions":["Select a Gemini model that supports image generation (e.g. gemini-2.0-flash-preview-image-generation or another model where isGeminiImageModel returns true).","Use a chat-capable Gemini model for text and switch to an image model only for image requests.","Update the app if the model you want was recently added to the supported image model list."],"exampleFix":"if (!isGeminiImageModel(this.options.model.modelId)) {\n  // Pick an image-capable model in settings before calling paint()\n}","handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"81571269addb6bafb589a920b2883f1e1e084fd1","analyzedAt":"2026-08-12T21:51:44.981Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}