Filename for Added Context

Created on 11 July 2025, 28 days ago

Problem/Motivation

Humans usually have images named something meaningful, and I was trying to adjust the default prompt by adding
"11. If the filename of the image is available you can use it for hints for context as to what is shown in that image."
but it doesn't seem to have any affect.

Steps to reproduce

Get an image of a house, name the file "Foreclosed-Home.jpg" or something, then if filename were working I hopefully would get something like "Single-story beige foreclosed house with a garage, blue driveway, and lush greenery."

Proposed resolution

Modify the prompt template to include a filename token and update the controller to pass the filename in the Twig context?

Remaining tasks

User interface changes

API changes

Data model changes

✨ Feature request
Status

Active

Version

1.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States NicholasS

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

  • Issue created by @NicholasS
  • πŸ‡ΊπŸ‡ΈUnited States NicholasS

    I wonder if the file name could also help situations like #3493133

  • πŸ‡ΊπŸ‡ΈUnited States NicholasS
  • πŸ‡ΊπŸ‡ΈUnited States NicholasS
  • πŸ‡ΊπŸ‡ΈUnited States NicholasS

    I added an image to help test this feature request. All I get back is variations like "Single-story beige house with garage, front lawn, and trees in the background."

    Also tried some prompt engineering but I just don't think it has access to the filename?
    11. If the filename of the image is available you can use it for hints for context as to what is shown in that image and work those words into the description.

  • πŸ‡ΊπŸ‡ΈUnited States NicholasS

    I experimented a lot trying to get AI to use the filename, but only luck I had was by adding a token so that I can specifically include it in our prompt template. And for the images I tested this seemed to have a very beneficial effect, so this change just adds a filename token.

    Along with IMPORTANT: This image has the filename "{{ filename }}" - use keywords from this filename as strong hints about the image content and incorporate relevant context into your description. it has greatly improved our images alt text. So I feel like this shouldn't be too much of a request to add this token.

  • πŸ‡ΊπŸ‡ΈUnited States NicholasS
  • πŸ‡ΊπŸ‡ΈUnited States NicholasS
  • πŸ‡©πŸ‡ͺGermany marcus_johansson

    Hi @nicholass - in 1.2.0 we will actually have a new module called Field Widget Actions that will make it possible to trigger any processor using a button.

    The AI Automators module has an AI Image Alt Text processor, that can take any token available to generate the alt text, including the filename.

    This module is meant to just be simple - install and get an 80% okish alt text - for perfect generated alt text I'm wondering if the Field Widget Action + AI Automators doesn't make more sense?

    Its not 100% documented yet and I'll create some videos on it and update as soon as its done.

  • πŸ‡ΊπŸ‡ΈUnited States NicholasS

    I could try it if you have a guide for "Field Widget Action + AI Automators" but honestly after testing the filename token seems to be all the context I need, its good enough to get us and our content editors can adjust from there. Plus teaches them to name their images better which helps content maintenance.

Production build 0.71.5 2024