It would be interesting to be able to generate alt text from the generated image instead of the alt text coming from the image prompt, as it is done now.
At the very least, the alt text should be editable prior to saving the image for the first time.
Issue fork ai_media_image-3508469
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
keshav patel commentedPlease check out this module: AI Image Alt Text, maybe it can help.
Comment #3
ultimikeI'm aware of the AI Image Alt Text module, but this issue can also be considered a bug because if the prompt used to generate the image is longer than 255 characters, then an error occurs because the alt text field can't handle that.
-mike
Comment #4
mandclu commentedPersonally I would like to see this module have a separate field for alt text (instead of assuming it should use the prompt, which is IMHO not expected behavior). It would be a bonus if it could also allow for the use of AI Image Alt Text (if available) to generate alt text before saving the image to the media library.
Comment #5
coffeymachine commentedComment #7
coffeymachine commentedI opened a MR to add a required "Alternative text" field below the image preview. The default value is set to the value of the Prompt field truncated to 255 characters.
Integration with AI Image Alt Text is more complex as AI Image Alt Text only supports
ImageWidget, which is not in use here. That can be opened as a separate feature request if desired. As a workaround, AI Image Alt Text can be used on the edit screen after the Media item is created.Comment #9
coffeymachine commentedComment #10
dan_metille commented@coffeymachine I'm happy with your solution, thanks!
Also, I guess that using automatically AI Image Alt Text module would not be 'free' an probably spent few tokens. While with the AI Image Alt Text module enabled, we can ask it to generate alt text on demand.
Comment #12
coffeymachine commentedAdding credit.