Problem/Motivation
There are now a number of reference implementations for using AI to generate images in Drupal
- OpenAI Image for Drupal
- openAI images
- The OpenAI module's DALL•E submodule
It would be great if this module could have a similar capability to allow for image generation. Ideally the flexible infrastructure here could allow for providers to be used, including various Stable Diffusion and Midjourney middleware API sites.
Proposed resolution
I would propose two different widgets: One, an imagefield companion that could use the text of one field as the prompt to generate an image to be used in a target image field. The other would be similar but use the media library, probably in a modal. It would be ideal if they could include a way to add additional terms related to style, artist(s) to emulate, photographic suggestions like focal length or film style, etc.
Perhaps as an initial step this module could provide a widget that would call the interface for an existing module like openAI images within a modal. Bonus points if it could prepopulate the Prompt field from a source field configured for the widget.
Comments
Comment #2
eleonelGreat idea, @mandclu. We already have a widget for file types that can handle similar tasks. For instance, check out Augmentor for Google Cloud Text-to-Speech. This widget captures a URL from the response (an audio file), downloads the file, and assigns it to the designated file field.
Augmentor is versatile and can be integrated with any fieldable entity. For example, you could add a new "Augmentor" field into a Media Bundle, select and set up the "Augmentor File Widget", and choose the appropriate image augmentor provider. I suggest (in a separate issue) we develop a configurable augmentor where you can specify the endpoint, and manage basic configurations and responses through the UI. This would allow greater flexibility and ease of use across different projects.