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
- Console command to generate AI hero images 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
Manual Installation
- Create the following directory structure in your Magento installation:
app/code/Elgentos/AiCategoryHeroImages - Copy all files from this repository to the directory you created
- Run the following commands:
bin/magento module:enable Elgentos_AiCategoryHeroImages
bin/magento setup:upgrade
bin/magento setup:di:compile
bin/magento cache:clean
Composer Installation
composer require elgentos/module-ai-category-hero-images
bin/magento module:enable Elgentos_AiCategoryHeroImages
bin/magento setup:upgrade
bin/magento setup:di:compile
bin/magento cache:clean
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
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 command selects random products from the specified category
- It generates a prompt based on the category name and product information
- It enhances the prompt with information about the products
- 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
Technical Notes
This module uses a direct cURL implementation to communicate with the OpenAI API instead of the OpenAI PHP client library. This approach was chosen to avoid RFC 7230 header compatibility issues that were encountered with the client library.
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 | * |
No QA results yet
QA pipelines haven't run for this version. Compatibility and quality results appear here once the vendor publishes a tagged release that gets ingested.
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.