Find a file
2025-11-15 17:50:19 +00:00
gen_photo_alt_text Add thread building support. 2025-11-15 17:50:19 +00:00
static Add thread building support. 2025-11-15 17:50:19 +00:00
templates Add thread building support. 2025-11-15 17:50:19 +00:00
.gitignore Simplify 2025-11-15 12:53:45 +00:00
app.py Initial commit 2025-11-15 10:54:32 +00:00
README.md Add thread building support. 2025-11-15 17:50:19 +00:00
requirements.txt Initial commit 2025-11-15 10:54:32 +00:00
SPEC.md Initial commit 2025-11-15 10:54:32 +00:00

Immich Alt Text Helper

A small Flask app that fetches recent Immich photos and helps generate high-quality Mastodon alt text via the OpenAI API.

Getting started

  1. Create and populate a .env file (or reuse the existing api_keys file) with:

    IMMICH_API_URL=https://photos.4angle.com/
    IMMICH_API_KEY=your-immich-api-key
    OPENAI_API_KEY=your-openai-api-key
    MASTODON_BASE_URL=http://localhost:3000
    MASTODON_ACCESS_TOKEN=your-mastodon-token
    
  2. Install dependencies and run the development server:

    pip install -r requirements.txt
    flask --app app run --debug
    
  3. Visit http://127.0.0.1:5000 to browse recent Immich photos, view cached alt text, request new alt text guided by optional notes, or compose Mastodon posts.

Mastodon workflow

  • Use Compose Mastodon post to select up to four photos from the last few days (200 entries are shown for convenience).
  • The draft view auto-fills cached alt text (or generates it if missing), lets you edit each description, enter post text, and provide optional ChatGPT instructions. It also shows your most recent Mastodon post so you can tick a box to continue a thread.
  • Hit Improve text with ChatGPT as many times as you like; the model polishes grammar, tone, and UK English spellings while respecting your extra notes.
  • When ready, choose Post to Mastodon to upload the selected media (with their alt text) and publish the refined caption (optionally as a reply) via the configured access token.

The app stores alt text in instance/alt_text_cache.db. Remove this file to clear the cache.