elgentos / magento2-ai-category-hero-images

elgentos/magento2-ai-category-hero-images

Generate AI-powered hero images for categories using OpenAI

magento2-module Compatibility: 2.4.7-2.4.8 Code Quality: Fail Tests: N/A Security: Pass OSL-3.0

Elgentos AI Category Hero Images

This Magento 2 extension generates AI-powered hero images for categories using OpenAI's GPT-Image-1 model.

Features

  • Button "Generate with AI" in the admin when on the Category edit page
  • Console command to generate AI hero images in bulk for categories
  • Selects random products from a category and uses their information to generate a prompt
  • Enhances the prompt based on product information
  • Uses OpenAI's GPT-Image-1 model to create a visually appealing hero image
  • Automatically sets the generated image as the category image
  • Configurable through the Magento admin panel

Requirements

  • Magento 2.4.x
  • PHP 8.1 or higher
  • OpenAI API key
  • A verified organization (after verification it takes about 30 minutes for existing keys to reflect the change)

Installation

Composer Installation

  1. composer require elgentos/magento2-ai-category-hero-images
  2. Run the following commands:
bin/magento module:enable Elgentos_AiCategoryHeroImages
bin/magento setup:upgrade

Configuration

  1. Go to Stores > Configuration > Elgentos > AI Category Hero Images
  2. Enable the module
  3. Enter your OpenAI API key
  4. (Optional) Enter your OpenAI Organization ID if you have one

Usage

Open a category and click the "Generate with AI" button, followed by optionally adapting the prompt to your liking.

Or run the following command to generate a hero image for a category:

bin/magento elgentos:aicategoryhero:generate [category_id]

Options:

  • --num-products or -p: Number of products to include in the image (default: 3)

Example:

bin/magento elgentos:aicategoryhero:generate 4 --num-products=5

How It Works

  1. The extension selects random products from the specified category
  2. It generates a prompt based on the category name and product information
  3. The enhanced prompt is sent to OpenAI's GPT-Image-1 model using a direct cURL request
  4. The generated image is saved to the Magento media directory
  5. The image is set as the category image

License

OSL-3.0

No changelog yet

The vendor hasn't published a changelog. Tagged releases appear in the Versions tab.

Versions
Version Stability QA Status Compatibility Released
0.1.4 stable Fail Magento 2.4.7-2.4.8 Details 2025-08-11 10:06:39
0.1.3 stable Not tested Not yet tested Details 2025-04-25 15:55:19
0.1.2 stable Not tested Not yet tested Details 2025-04-25 14:06:34
0.1.1 stable Not tested Not yet tested Details 2025-04-25 12:54:41
0.1.0 stable Not tested Not yet tested Details 2025-04-25 12:45:03

Requires 3

Package Constraint
php ~8.1.0||~8.2.0||~8.3.0||~8.4.0
magento/framework *
openai-php/client *

Compatibility

Each Magento release line is installed on its supported PHP versions, then the module is built (DI compilation + static-content deploy) and its unit and integration suites are run. The matrix shows the lines and PHP versions the module is confirmed to install and run on. Code-quality results further down (phpstan, phpcs, …) are reported separately and never affect compatibility.

Compatibility matrix (Magento × PHP)
Magento PHP 8.2 PHP 8.3 PHP 8.4 PHP 8.5
2.4.7 Pass Pass
2.4.8 Pass Pass
2.4.9 Pass not tested

Code Quality

Advisory checks against the module's source. Static analysis runs once across the whole module; PHPStan re-runs per Magento + PHP version because resolvable symbols differ between releases. These NEVER affect the Compatibility badge — a phpcs finding can't make a module incompatible.

Static analysis

Coding standards (phpcs), mess detection (phpmd), copy-pasted code (cpd), PHP cross-version compatibility, composer.json validity. Each runs once for the whole module.

Static analysis results
Tool Status Findings Summary
PHPCS Warning 15 15 warnings (ruleset: Magento2) — 3 auto-fixable with phpcbf
PHPMD Warning 2 2 rule violations (UnusedFormalParameter:1, UnusedLocalVariable:1)
Cpd Pass 0
Composer validate Info 2 valid; 2 advisory notes (composer validate --strict)

PHPStan

Type-checks the module's PHP against a real Magento install at the configured gate level. Re-runs per Magento and PHP version because resolvable symbols differ between releases. Cell → details modal.

PHPStan results by Magento and PHP version
Magento PHP 8.2 PHP 8.3 PHP 8.4 PHP 8.5
2.4.7 1 1
2.4.8 1 1
2.4.9 1 N/A

Tests

Unit and integration suites, run for each applicable Magento and PHP version. A test failure speaks to the module's behaviour, not its compatibility with a Magento line, so it is reported here separately and never reddens the compatibility matrix.

Unit tests

Unit tests results by Magento and PHP version
Magento PHP 8.2 PHP 8.3 PHP 8.4 PHP 8.5
2.4.7 N/A N/A
2.4.8 N/A N/A
2.4.9 N/A N/A

Integration tests

Integration tests results by Magento and PHP version
Magento PHP 8.2 PHP 8.3 PHP 8.4 PHP 8.5
2.4.7 N/A N/A
2.4.8 N/A N/A
2.4.9 N/A N/A

Security

Security checks run directly against the module: an audit of its declared dependencies for known vulnerabilities (composer audit) and a scan of its source for malware and web-shell signatures. Each runs once. A malware detection fails the version outright.

Security results
Tool Status Findings Summary
Composer audit Pass 0
Malware scan Pass 0
License
OSL-3.0

More from elgentos

View vendor
Make it pay

Turn an existing module into recurring revenue.

If you already maintain a Magento 2 module on GitHub or GitLab, listing it on Packagento takes about five minutes. We mirror your tags, handle distribution signing, and route paid licenses through Stripe Connect, so you can keep shipping the way you already do.