elgentos / magento2-ai-category-hero-images
elgentos/magento2-ai-category-hero-images
Generate AI-powered hero images for categories using OpenAI
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
composer require elgentos/magento2-ai-category-hero-images- Run the following commands:
bin/magento module:enable Elgentos_AiCategoryHeroImages
bin/magento setup:upgrade
Configuration
- Go to Stores > Configuration > Elgentos > AI Category Hero Images
- Enable the module
- Enter your OpenAI API key
- (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-productsor-p: Number of products to include in the image (default: 3)
Example:
bin/magento elgentos:aicategoryhero:generate 4 --num-products=5
How It Works
- The extension selects random products from the specified category
- It generates a prompt based on the category name and product information
- The enhanced prompt is sent to OpenAI's GPT-Image-1 model using a direct cURL request
- The generated image is saved to the Magento media directory
- The image is set as the category image
License
No changelog yet
The vendor hasn't published a changelog. Tagged releases appear in the Versions tab.
| 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.
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.
| 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.
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
| 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
| 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.
More from elgentos
View vendorLink existing guest orders to newly created or existing customer based on e-mail address
Allows customers to enter a secondary email address to login with
Hide Mollie payment methods based on category
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.