定制 elgentos/magento2-ai-category-hero-images 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

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

  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

统计信息

  • 总下载量: 236
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 17
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 17
  • Watchers: 1
  • Forks: 5
  • 开发语言: PHP

其他信息

  • 授权协议: OSL-3.0
  • 更新时间: 2025-04-25