This project is not covered by Drupal’s security advisory policy.
Krea Provider connects the Drupal AI module to the Krea API for text to image and image to image generation. It exposes 25 text to image models and 31 image to image models (Krea 2, Flux, Nano Banana, Ideogram, ChatGPT Image, Grok, Seedream, Qwen, Z Image and others, plus Krea Enhance and Topaz upscalers), handles Krea's asynchronous jobs and asset uploads for you, and adds a styles manager and a fine-tuning plugin for training your own LoRAs.
Features
- Provider plugin
kreafor thetext_to_imageandimage_to_imageoperation types of the AI module. Any module that generates images through the AI module can use it. - Image to image capabilities: upscale, edit, inpaint, erase, search and replace, search and recolor, remove background, style guide, style transfer and sketch. The AI module's capability filtering picks a model that supports what you ask for.
- Per model settings (aspect ratio, resolution, seed, guidance, number of images, scale factor and more) that appear in the AI module's model configuration and can be set from code with
setConfiguration(). - Asynchronous jobs are submitted, polled and downloaded transparently. Input images are uploaded as Krea assets first. Poll interval and maximum wait are configurable.
- A settings page that validates the API key on save, lists the available models and shows a usage summary.
- A usage page with local request counters, recent jobs from Krea and workspace usage for the last 30 days.
- A styles page to list, edit, share and publish Krea styles (LoRAs), and to apply one to a generation through the Style (LoRA) ID setting.
- The
krea_loraplugin for the AI Fine-tuning module (ai_finetuner): train a style, character or object LoRA from 5 to 30 images on Flux, Krea 2, Qwen, Z Image or Wan, straight from Drupal content. - Optional zero data retention header for requests to Krea.
- Written against the REST API directly. No vendor SDK.
Mock API for developmentThe |
Agent skill includedThe module ships |
Installation
- Install and enable:
composer require drupal/ai_provider_krea, thendrush en ai_provider_krea. - Create an API key on krea.ai. The token has the form
id:secret. Store it using the Key module. - Go to Configuration > AI > Providers > Krea Authentication (
/admin/config/ai/providers/krea) and select the key. Saving sends one request to Krea to validate it. - Optionally set Krea as the default provider for text to image and image to image under Configuration > AI > Settings.
Try it from code
$provider = \Drupal::service('ai.provider')->createInstance('krea');
$provider->setConfiguration(['aspect_ratio' => '16:9']);
$images = $provider->textToImage('a red boat, watercolor', 'krea-2-medium')->getNormalized();
Every generation and every training run spends Krea credits. Use the mock submodule for automated tests and local development.
Requirements/Dependencies
- AI (Artificial Intelligence) module.
- Key module, for storing the API key.
- A Krea account with API access.
- The AI Fine-tuning module (
ai_finetuner) only if you want to train LoRAs; the provider works without it.
AI disclosure
All code in this module was written with AI coding assistants under human supervision. The maintainer reviewed and tested every change before committing it and is responsible for the result.
Project information
- Project categories: Artificial Intelligence (AI), Integrations, Media
- Ecosystem: AI (Artificial Intelligence)
- Created by marcus_johansson on , updated
This project is not covered by the security advisory policy.
Use at your own risk! It may have publicly disclosed vulnerabilities.
Releases
Development version: 1.0.x-dev updated 16 Sep 2026 at 07:13 UTC
