Varbase AI Media Base
The Varbase AI Media Base recipe lets editors generate images and SVGs with AI on Varbase 11. It installs the AI Media module, which saves what it generates into the site's own Image and SVG Image media types, adds Generate with AI to the Media Library, and grants the permissions to the editorial roles. It is configuration only, with no custom PHP.
Recipe Type
Varbase AI
Drupal.org Project
https://www.drupal.org/project/varbase_ai_media_base
Overview
AI Media has no media types of its own. Each generator saves into an existing media type. For how the module works, see the AI Media module page.
Image
Image
PNG, JPG or WebP.
Text to image.
SVG
SVG Image
A sanitized SVG, static or animated.
Chat.
Video (experimental, off)
Video
MP4.
Text to image, then image to video.
Editors find the generators in these places:
The Media Library, inside the tab of each media type: the Image, SVG Image and Video tabs open with an Upload | Generate with AI switch. Generate with AI is marked New until it is opened.
Insert Media in CKEditor for the Full HTML text format.
The Add media page (
/media/add/image,/media/add/svg_image), which starts with the same Upload | Generate with AI switch.Content \ Media, through the Generate media with AI button, which opens the Add media page in Generate with AI mode.

Included Modules
Brings in the following contributed modules to your site:
Configuration
The recipe applies the following configurations:
Imports the AI Media configuration, including its AI Prompts.
Saves generated images as Image media and generated SVGs as SVG Image media.
Allows SVG Image in Insert Media for the Full HTML text format.
Grants Generate media with AI, plus Create new media for Image and SVG Image, to the Content Editor, Content Admin and Site Admin roles.
Requirements
Drupal
^11.4, AI Core^1.5, AI Media^1.0.0-alpha3, SVG Image^3.2.5.Default AI providers for Text to image (images) and Chat (SVGs). The Varbase AI Base recipe sets up the AI stack.
AI Providers
AI Media always uses the default provider and model that Drupal AI sets for each operation. It has no provider setting of its own. To use another provider or model, for example Gemini for images, change it at Administration \ Configuration \ AI \ AI Settings (/admin/config/ai/settings).
Installation
Require the recipe with Composer, then apply it using Drush:
Applying the recipe twice is safe.
Generating an Image
Open the Image tab in the Media Library, or the Add media page for Image, and choose Generate with AI.
Describe the image: the subject, the setting and the style. The field starts empty. Examples opens a list of up to eight sample descriptions; pick one to put it in the field. The info button next to it says which provider your description is sent to.
Press Generate image. Each press is one paid request to the provider.
Review the result. AI writes the name and the alternative text from the image, marked Written by AI from the image. Check it. Change them if they do not match what the image shows.
Set the Focal Point if needed. The crosshair starts in the centre of the image.
Press Save. Nothing is added to the library until you save.



Generating an SVG
Choose Generate with AI in the SVG Image tab. It works the same way and saves into SVG Image. Every SVG is checked and cleaned before it is kept, so it holds no scripts or outside links.
An SVG can be static or animated. Editors see the Style option under Options only when Editor options \ SVG \ Show the style is on in the AI Media settings. The styles are:
Static: a still drawing. This is the default.
Animated: draw the strokes: the lines draw themselves, part by part.
Animated: CSS keyframes: the drawing plays its own animation.
Animated: SMIL: the drawing plays its own animation, written in SVG.


Generating a Video
The Video generator is experimental and off by default. When it is turned on, the Video tab gets the same Upload | Generate with AI switch. It needs a provider that offers image to video, and none of the common providers (OpenAI, Gemini, Anthropic, amazee.ai) does yet. Video generation has not been tested on Varbase.

AI Media Settings
Configure the generators at Administration \ Configuration \ AI \ AI Media (/admin/config/ai/ai-media):
Generators: shows or hides Generate with AI in the Media Library, sets where it appears, and picks the media type, formats and order of each generator.
Editor options: what editors may choose under Options, such as size, format, model and the SVG style. All are hidden by default.
Name, title and alternative text: fills each from the description, asks AI, or leaves it empty.
Safety: attaches one of the site's guardrail sets to every AI Media request.
Site context: uses the site's AI Context items.
Description and Advanced: the description length, example descriptions, dictation and file handling.
Where should the AI tabs appear? on the Generators tab has three choices:
Inside the tab of their media type: the Upload | Generate with AI switch. This is the default.
As a tab of their own, right after the tab of their media type: a Generate image with AI tab after Image, a Generate SVG with AI tab after SVG Image, and so on.
As a tab of their own, after all the other tabs.

When AI Logging or AI Observability is enabled, AI Media requests are tagged with ai_media, so you can filter them there.
Troubleshooting
No Generate with AI: check that the generator is enabled and has a media type, that the media type is allowed in that field or text format, that the user may generate and create that media, and that Drupal AI has a default provider for the operation.
"… generation is not set up": set a default provider for the operation in the Drupal AI settings.
An animated SVG does not move: show it with the Inline SVG (animated) display or the Animated SVG component.
See the AI Media module page for every setting, the providers it uses, SVG and animated SVG, and writing a generator plugin.
Last updated