Problems generating alt text from uploaded images

Created on 13 December 2024, 5 months ago

Problem/Motivation

I'm trying to use this with the AI Image Alt Text module to generate alt text when uploading media images but I can't seem to get it to work correctly. Sometimes when I click the button to generate alt text I get "Error: The file is not an image." and other times I get a snippet of text that doesn't correspond at all with the image (e.g. the image is of trees in a forest and the text says "A brown tabby cat sleeps curled up on a colorful, crocheted blanket.")

Steps to reproduce

1. Clean install of Drupal 10.3.10
2. Install and enable the following modules: AI, AI Image Alt Text, Gemini Provider, Media, Media Library
3. Configure an API key in the Gemini Authentication Provider settings
4. In the AI Image Alt Text settings, use the default prompt and image style. Select "Gemini - Gemini 1.5 Pro" for the AI provider model.
5. Go to /media/add/image, upload an image, and click the "Generate with AI" button under the Alternative text field.
6. Note error message or incorrect alt text populated in the alt text field.

By comparison, I've used the Google AI Studio to enter the same prompt with the same image with the Gemini 1.5 Pro model and it gave me very accurate alt text description of the image.

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

πŸ› Bug report
Status

Active

Version

1.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States RichardDavies Portland, Oregon

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024