Add Field Widget Actions (FWA) support for core Image field using llm_image_generation
>>> [!note] Migrated issue
<!-- Drupal.org comment -->
<!-- Migrated from issue #3566579. -->
Reported by: [marcus_johansson](https://www.drupal.org/user/385947)
Related to !1097
>>>
<p>[Tracker]<br>
<strong>Update Summary: </strong>[One-line status update for stakeholders]<br>
<strong>Short Description: </strong>Add Field Widget Actions (FWA) support for core Image field using llm_image_generation.<br>
<strong>Check-in Date: </strong>MM/DD/YYYY<br>
[/Tracker]</p>
<h3 id="summary-problem-motivation">Problem/Motivation</h3>
<p>Text-to-image generation is a common AI use case and fits naturally with the core Image field, where images can be generated directly from descriptive prompts. At the moment, there is no in-widget way to trigger AI Automators that perform image generation and store the result in an Image field.<br>
This issue proposes adding Field Widget Actions (FWA) support for the core Image field using the <code>llm_image_generation</code> automator, following <code>modules/ai_automators/src/Plugin/FieldWidgetAction/Email.php</code> as reference implementation. This allows editors to generate images from text prompts and immediately store the generated image in the Image field via the widget UI.<br>
A straightforward way to test this is to configure an AI Automator that takes a text prompt and generates an image, which is then saved directly into the Image field using the FWA.</p>
<h3 id="summary-proposed-resolution">Proposed resolution</h3>
<ul>
<li>Add a new FWA plugin for the core Image field that supports triggering the <code>llm_image_generation</code> automator, modeled after <code>modules/ai_automators/src/Plugin/FieldWidgetAction/Email.php</code>.</li>
<li>Ensure the FWA is only available for Image fields and correctly handles storing generated image files in the field widget.</li>
</ul>
<p>- <strong>This issue was created with the help of AI</strong></p>
issue