Banana Imagine adds Google Gemini image generation directly to ProcessWire image fields, so editors can create, preview, select and save AI-generated images without leaving the page editor.

It is made for editorial sites, catalogs, landing pages, directories, portfolios and content teams that want AI-assisted image creation inside their existing ProcessWire workflow.
Author: Maxim Semenov
Website: smnv.org
Email: maxim@smnv.org
If this project helps your work, consider supporting future development: GitHub Sponsors or smnv.org/sponsor.
What Banana Imagine Does
- Adds a generation bar below selected ProcessWire image fields.
- Generates one to four image variations from a single prompt.
- Adds subtle prompt variations for more diverse batches.
- Supports reusable system prompts with
%fieldname% placeholders. - Resolves placeholders from the page being edited, such as
%title% or %summary%. - Lets editors preview and select generated images before saving.
- Stores selected results as native ProcessWire
Pageimage items. - Uses clean filenames based on page id, timestamp and result index.
- Recognizes enabled image fields inside RepeaterMatrix items.
Supported Models
- Gemini 3.1 Flash Image — Nano Banana 2 and the default option.
- Gemini 3.1 Flash Lite Image — Nano Banana 2 Lite.
- Gemini 3 Pro Image — Nano Banana Pro.
- Gemini 2.5 Flash Image — the original Nano Banana model.
Existing gemini-3-pro-image-preview settings are migrated automatically to the stable gemini-3-pro-image identifier.
Editorial Workflow
- An editor opens a ProcessWire page with an enabled image field.
- The configured system prompt is pre-filled and page placeholders are resolved.
- The editor adjusts the prompt and requests one to four variations.
- Results appear below the field as they are generated.
- The editor selects the images to keep.
- Saving the page adds those images to the field permanently.
Unselected previews are not added to the page.
Website Integration
Banana Imagine is an admin editing tool, not a frontend widget. Generated files become normal ProcessWire images and are rendered with the same template code as uploaded images:
<?php foreach($page->hero_images as $image): ?>
<figure>
<img src="<?= $image->url ?>" alt="<?= $sanitizer->entities($image->description) ?>">
</figure>
<?php endforeach; ?>
This keeps frontend architecture independent from the image provider. Templates do not need to call Gemini.
Installation
- Copy the
BananaImagine folder into /site/modules/. - In ProcessWire Admin, refresh modules.
- Install
Banana Imagine. - Open the module configuration.
Configuration
- Create an API key in Google AI Studio.
- Ensure the Google account has billing enabled for image generation.
- Enter the API key in the module settings.
- Choose the image-generation model.
- Optionally define a reusable system prompt.
- Select the image fields that should display the Banana Imagine interface.
Example system prompt:
Professional editorial photograph for %title%, natural light, clean composition
Agent Documentation
See AGENTS.md for AI-agent guidance, site-building patterns, ProcessWire hooks, request contracts, safety boundaries and validation steps.
See CHANGELOG.md for release notes.
Author
Maxim Semenov
smnv.org
maxim@smnv.org
License
MIT