drupal / varbase_ai_media_base
Generate images and SVGs with AI from the Media Library on Varbase 11, with the AI Media module: "Generated image with AI" and "Generated SVG with AI" media types, offered right after Image in the Featured image fields and in Insert Media, with the permission granted to the editorial roles. No custo
Package info
git.drupalcode.org/project/varbase_ai_media_base.git
Type:drupal-recipe
pkg:composer/drupal/varbase_ai_media_base
Requires
- drupal/ai: ^1.5
- drupal/ai_media: ^1.0@alpha
- drupal/core: ^11.4
- drupal/svg_image: ^3.2.5
Requires (Dev)
None
Suggests
None
Provides
None
Conflicts
None
Replaces
None
This package is auto-updated.
Last update: 2026-10-24 16:13:32 UTC
README
Generate images and SVGs with AI from the Media Library on a Varbase 11 site, with the AI Media module.
What it adds
| Media type | Generator | Offered in |
|---|---|---|
Generated image with AI (image_ai_gen) | Image (text_to_image) | Blog and page Featured image, Full HTML Insert Media |
Generated SVG with AI (svg_ai_gen) | SVG (chat, sanitised) | Full HTML Insert Media |
- Each tab reads Generate … with AI, is marked New, and sits right after Image.
- Each type carries every Varbase view mode of its non-AI counterpart (Image,
SVG image), stores files in
ai-generated/YYYY-MM, and is translatable. - Grants Generate media with AI and create/edit/delete for the two types to content editors, content admins and site admins.
- No custom PHP or shell code in the recipe; the code is in AI Media.
Requirements
- Varbase 11 (Drupal ^11.4),
svg_image. - AI Media (
drupal/ai_media), which has no release yet: its1.0.x-dev. - Default AI providers: text_to_image for images, chat for SVGs
(
varbase_ai_baseand an OpenAI or Anthropic key give them).
Install
ddev composer require drupal/varbase_ai_media_base:1.0.x-dev
ddev drush recipe ../recipes/varbase_ai_media_base
ddev drush cr
Safe to apply twice.
Known limits
- Video needs a provider with image_to_video; none of OpenAI, Anthropic or amazee.io offers it yet, so no video type is added here.
- Documents are not part of AI Media, so no document type is added here.
Tests
A varbase-e2e suite in
tests/features checks a Varbase 11 site with the recipe applied: the media
types, the AI tab on the Featured image field, Insert Media in Full HTML and
the editorial permissions. CI builds that site, applies the recipe twice and
runs it (varbase-e2e-test). Locally:
npm install
LAUNCH_URL=https://your-site.ddev.site npm test