This project provides an automated solution for generating, translating, and managing alt text for images in Webflow projects. It combines a Cloudflare Worker for AI-powered image description generation with Google Apps Script for asset management and translation capabilities.
- Handles image processing and AI-powered description generation
- Uses Meta's Llama model for generating image descriptions
- Includes authentication for secure access
- Optimized for generating concise, SEO-friendly alt text descriptions
The Google Apps Script component consists of several modules:
UI.gs: Creates a custom menu in Google Sheets with all available functionslistAssets.gs: Fetches and manages Webflow assetsimageDescription.gs: Communicates with the Cloudflare Worker to get AI-generated descriptionstranslate.gs: Handles translation of alt text using DeepL APIsendNewAlt.gs: Updates alt text in Webflow via the API
-
Cloudflare Worker Setup
- Deploy the worker code to Cloudflare
- Create a custom API token (can be any random string you choose)
- Set up this token as environment variable
API_TOKENin Cloudflare - Make sure to save this token as you'll need to use the exact same value in the Apps Script code
- Configure the Meta Llama model access, YOU NEED TO ACCEPT META's LICENSE Cloudflare giude
-
Google Apps Script Setup
- Create a new Google Sheet
- Set up the script in Google Apps Script editor
- Configure the following API keys/tokens:
- Webflow API token
- DeepL API key
- Cloudflare Worker API token
-
Webflow Configuration
- Obtain Webflow API access token
- Configure your site ID in the scripts
- Open your Google Sheet
- Use the "Alt Text Updater" menu for the following operations:
- List assets: Fetches all assets from your Webflow site
- Describe selected: Generates AI descriptions for selected images
- Translate: Translates English descriptions to Polish
- Upload new ALT: Updates Webflow assets with new alt text
- Assets are fetched from Webflow and listed in the Google Sheet
- Select images for AI description generation
- The system generates English descriptions using the AI model
- Descriptions can be automatically translated to Polish
- Review and edit descriptions as needed
- Upload approved descriptions back to Webflow
- The system includes built-in delays to respect API rate limits
- Webflow API requests are managed to avoid exceeding quotas
- Translation requests are handled with appropriate timing
- API tokens are required for all components
- Cloudflare Worker includes authentication checks using a custom API token
- The same API token must be used in both the Cloudflare Worker environment variable and the
imageDescription.gsscript - The token can be any random string but must match exactly between both components
- Sensitive tokens should be stored securely and never committed to version control
- Keep API tokens and keys confidential
- Review AI-generated descriptions before uploading
- Regular backups of existing alt text are recommended
- Monitor API usage to stay within service limits
