Download the PHP package el-schneider/statamic-auto-alt-text without Composer
On this page you can find all versions of the php package el-schneider/statamic-auto-alt-text. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package statamic-auto-alt-text
Statamic Auto Alt Text
Automatically generate descriptive alt text for images in Statamic v5 using AI services (Moondream or OpenAI GPT-4 Vision)
Features
- Automatic Generation: Generate alt text for assets using AI by listening for Statamic asset events
- Multiple AI Providers: Support for Moondream (cloud or self-hosted) and OpenAI (GPT-4 Vision)
- Data Privacy: Option to use local Moondream endpoints, keeping image data within your infrastructure
- Asset Filtering: Exclude sensitive or private assets from processing with global patterns, container-specific rules, or individual asset settings
- Control Panel Integration: Field Action to generate alt text for individual images
- Bulk Processing: Artisan Command for processing images individually or in batch
Installation
Publish the configuration file:
Configuration
By default, the addon uses the moondream
service with the cloud API. Set your API key in your .env
file:
Refer to the published configuration file (config/statamic/auto-alt-text.php
) for additional options, including switching between services.
Non-English Captions
Moondream
Currently, Moondream only supports English language captions. If you need captions in other languages, consider using the OpenAI service instead.
OpenAI
OpenAI supports multiple languages. You can customize the prompt to generate captions in your preferred language by setting the OPENAI_PROMPT
environment variable:
Usage
Automatic Generation
The addon listens for configured Statamic events (default: AssetUploaded
and AssetSaving
). When an asset without alt text is detected, a background job is dispatched to generate it automatically using your configured AI service.
Important: This feature requires Laravel's queue system with an asynchronous queue driver (e.g.,
database
,redis
,sqs
) and a running queue worker (php artisan queue:work
). The defaultsync
driver won't work for background processing.
Optionally customize the queue configuration:
Optional: Defaults to your application's default queue connection
Optional: Defaults to the default queue name for the connection
Manual Generation
For existing assets or specific workflows:
- Field Action: Edit an asset, find the
alt
text field, and click the "Generate Alt Text" action - Statamic Action: In an Asset container, use the "Generate Alt Text" action from the contextual menu
- CLI Command: Process assets in bulk with:
See php please auto-alt:generate --help
for options to specify containers, assets, and overwriting behavior
Using Local Moondream
For privacy or compliance reasons, you can run Moondream locally:
- Set up Moondream: Follow the Quickstart guide to set up a local Moondream server
- Configure the addon: Update your
.env
file:Set your local server endpoint (default points to cloud API)