Installs and configures image alt text generation tools.
- Generation of alt text using an AI provider.
- Adds to all image fields.
- Incorporates a human-in-the-loop review before saving.
- Uses the entity’s language to generate alt text in the appropriate language.
- Includes a bulk tool for generating al text for images that have none.
composer require kanopi/saplings-ai-image-alt-text
cd web && php core/scripts/drupal recipe ../recipes/saplings-ai-image-alt-text
While the AI module supports many AI services, this recipe is configure to use OpenAI.
- Create an API key at https://platform.openai.com
- Create a key file at
private://keys/openai_provider.key
. That is usually at[webroot]/sites/default/files/private/keys/openai_provider.key
. - Once you are ready to deploy, be sure to place that key in your cloud environments on the site's host. If you place it in the canonical environment, it will get cloned on subsequent multidev clones.
To use the configured AI tools, start by clicking the Generate with AI button on any image form.
There is also a bulk edit tool that compiles a list of fields missing alt text and fixes them in bulk. This tool is located at Admin > Configuration > Media.