Search by

vectorbross / vb_ai_image_alt_text

vectorbross

Adds AI generated image alt text on top of VB AI Core. Requires a vision capable provider recipe.

Package info

bitbucket.org/vectorbross/vb_ai_image_alt_text

Type:drupal-recipe

pkg:composer/vectorbross/vb_ai_image_alt_text

Statistics

Installs: 0

Dependents: 0

Suggesters: 0

dev-master 2026-11-27 11:18 UTC

This package is not auto-updated.

Last update: 2026-12-03 21:54:34 UTC


README

Adds AI generated alt text for image fields on top of vb_ai_core. Content managers get a button next to the alt text field that generates a description of the image with a vision model.

What it installs

ModulePurpose
ai_image_alt_textGenerates image alt text with a vision model

It also applies vb_ai_core (ai, key, token) first.

What it configures

SettingValueEffect
autogeneratefalseAlt text is only generated via the button
hide_buttonfalseThe generate button stays visible
ai_modelnot setThe default vision provider is used

The recipe also imports the ai_image_alt_text image style. The module uses it to resize images before they are sent to the provider. Recipes do not import config entities from a module's config/install automatically, so this is done explicitly in recipe.yml.

Requirements

  • Drupal 11.4+
  • Drush 13+
  • The project setup from vb_ai_core (composer/installers 2.3+, the recipes/{$name} installer path and the VB repositories entry)
  • A vision capable provider recipe, already required and applied, for example vb_ai_provider_anthropic. The provider recipe sets the default for the chat_with_image_vision operation, which this module uses.

Install

Require the recipe. Composer pulls in drupal/ai_image_alt_text and vb_ai_core as dependencies.

ddev composer require vectorbross/vb_ai_image_alt_text

Apply the recipe

Make sure a provider recipe has been applied first (see Requirements). Run from the project root; Drush runs from the web docroot, so the path starts with ../recipes.

ddev drush recipe ../recipes/vb_ai_image_alt_text
ddev drush cr

Permissions

The recipe grants the Generate AI Alt Tags permission to the webmaster role and creates that role if it does not exist yet. The administrator role already has every permission. No other roles get access; grant it manually if another role needs it.

Verify

ddev drush pm:list --status=enabled --filter=ai_image_alt_text

Then edit content with an image field (the Article type has one by default), upload an image and click the generate button next to the alt text field. The alt text is filled in by the vision model.

Options

  • Settings live at /admin/config/ai/ai_image_alt_text.
  • To generate alt text automatically on upload, set autogenerate: true in recipe.yml. Every uploaded image is then sent to the AI provider, which costs API credits and may need to be covered in the client's privacy policy.
  • For existing images, enable the ai_image_bulk_alt_text submodule to generate alt text in bulk.

License

GPL-2.0-or-later. See LICENSE.txt.