Search by

drupal / varbase_ai_media_base

Drupal-Infrastructure

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

Homepage

Issues

Type:drupal-recipe

pkg:composer/drupal/varbase_ai_media_base

Statistics

Installs: 0

Dependents: 1

Suggesters: 0

1.0.0-alpha1 2026-10-24 15:59 UTC

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 typeGeneratorOffered 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: its 1.0.x-dev.
  • Default AI providers: text_to_image for images, chat for SVGs (varbase_ai_base and 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