elgentos/magento2-ai-category-hero-images
最新稳定版本:0.1.4
Composer 安装命令:
composer require elgentos/magento2-ai-category-hero-images
包简介
Generate AI-powered hero images for categories using OpenAI
README 文档
README
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
统计信息
- 总下载量: 236
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 17
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: OSL-3.0
- 更新时间: 2025-04-25