AI Product Image Generator

AI Product Image Generator Documentation

Installation

↑ Back to top

Requirements

↑ Back to top
  • WordPress 5.8 or higher
  • WooCommerce 7.0 or higher
  • PHP 7.4 or higher
  • Active Google Cloud account with Gemini API access
  • SSL certificate (HTTPS) recommended for API communications

Installation Steps

↑ Back to top
  1. Upload Plugin
  • Download the plugin ZIP file from WooCommerce Marketplace
  • Go to WordPress Admin > Plugins > Add New
  • Click “Upload Plugin” and select the ZIP file
  • Click “Install Now”
  1. Activate Plugin
  • After installation, click “Activate”
  • Or go to Plugins list and activate “AI Product Image Generator for WooCommerce”
  1. Initial Configuration
  • Upon activation, you’ll see a notice to configure the plugin
  • Click the configuration link or navigate to WooCommerce > AI Image Generator

Initial Setup

↑ Back to top

Getting Your Google Gemini API Key

↑ Back to top
  1. Create Google Cloud Account
  • Visit Google AI Studio
  • Sign in with your Google account
  • Accept terms of service if prompted
  1. Generate API Key
  • Click “Create API Key”
  • Select existing project or create new one
  • Copy the generated API key
  • Store it securely – you won’t be able to see it again
  1. Enable Gemini API
  • The Gemini Flash model should be automatically available
  • Verify your API is working in Google AI Studio’s test interface

Configuring the Plugin

↑ Back to top
  1. Navigate to WooCommerce > AI Image Generator
  2. Enter your Google Gemini API key
  3. Enable the plugin by checking “Enable AI Product Image Generator”
  4. Set your optional daily generation limit for cost control (if desired)
  5. Configure optional settings as needed
  6. Click “Save Changes”

Configuration

↑ Back to top

General Settings

↑ Back to top

Enable AI Product Image Generator

  • Master switch to enable/disable the plugin functionality
  • When disabled, generation buttons are hidden but existing images remain

Google AI API Key

  • Your Gemini API key from Google AI Studio
  • Stored encrypted in WordPress database
  • Required for image generation to work

Debug Mode

  • Enables detailed logging for troubleshooting
  • Logs stored in WooCommerce > Status > Logs
  • Only enable when investigating issues
  • Remember to disable in production

Using the Plugin

↑ Back to top

Generating Images for Individual Products

↑ Back to top
  1. Navigate to Product Editor
  • Go to Products > All Products
  • Click “Edit” on any product
  • Or create a new product
  1. Generate Image
  • Scroll to the Product Gallery section
  • Select an image or upload one
  • Click “Generate AI Image” button
  • Enter your custom prompt in the text field
  • Wait for the AI to process your request
  1. Review Generated Image
  • Image generation takes 15-30 seconds
  • Generated image appears in product gallery
  • Image can be saved to Media Library
  • You can regenerate if not satisfied and adjust the prompt

Writing Effective Prompts

↑ Back to top

You manually enter prompts for each product. Effective prompts should include:

  • Clear product description
  • Style preferences
  • Background settings
  • Lighting conditions
  • Composition details

Prompt Format Example:

"Product photography of wireless headphones, modern design, 
professional lighting, white background, high quality, commercial style"

Customization Tips:

  • Add style preferences: “minimalist”, “lifestyle”, “studio”
  • Specify angles: “front view”, “45-degree angle”, “top-down”
  • Include context: “on wooden table”, “held by model”, “outdoor setting”
  • Define mood: “elegant”, “playful”, “professional”

Managing Multiple Products

↑ Back to top

To generate images for multiple products:

  1. Work Through Products Individually
  • Navigate through your product list
  • Generate images one at a time for better control
  • Customize prompts for each product’s specific needs
  1. Plan Your Generation Strategy
  • Prioritize high-value or featured products first
  • Monitor API usage and costs in Google Cloud Console
  • Set optional daily limits if you want cost control

Managing Generated Images

↑ Back to top

In Media Library:

  • Generated images are tagged with “ai-generated” for easy filtering
  • Filename format: product-name-ai-[timestamp].jpg
  • Alt text automatically set to product title
  • Full WordPress media editing capabilities available

Image Quality:

  • Resolution: Minimum 512×512 pixels, up to 1248px (varies based on generation)
  • Format: JPEG
  • File size: Maximum 4MB
  • Optimized for web display

API Configuration

↑ Back to top

Understanding API Costs

↑ Back to top

Google Gemini API pricing (as of 2025):

  • Very limited free tier
  • Pay-as-you-go pricing after free tier
  • Check current pricing at Google Cloud Console

Monitoring API Usage

↑ Back to top
  1. In Google Cloud Console:
  • Detailed API usage metrics
  • Billing reports
  • Set up billing alerts

API Error Handling

↑ Back to top

Common API responses:

  • 429 Too Many Requests: Quota exceeded
  • 401 Unauthorized: Invalid API key
  • 400 Bad Request: Invalid prompt format
  • 503 Service Unavailable: Temporary API outage

Troubleshooting

↑ Back to top

Images Not Showing in the Media Library After Saving

↑ Back to top

When saving an AI-generated image to the gallery, the image will not show in the “Add Media” view, but it will in the “Create Gallery” view. This limitation is due to a bug in WordPress core that the plugin can’t bypass.

Images Not Generating

↑ Back to top

Check API Key:

  1. Verify key is correctly entered in settings
  2. Test key in Google AI Studio
  3. Ensure API is enabled in Google Cloud Console

Check Quotas:

  1. Check if optional daily limit is set and exceeded
  2. Check Google Cloud API quota limits
  3. Review billing status and payment method

Enable Debug Mode:

  1. Turn on Debug Mode in settings
  2. Attempt generation
  3. Check logs at WooCommerce > Status > Logs
  4. Look for file starting with ai-product-image-generator-

Poor Image Quality

↑ Back to top

Improve Prompts:

  • Add more product details
  • Include specific style keywords
  • Avoid conflicting descriptions
  • Use clear, descriptive language

Common Issues:

  • Vague descriptions produce generic images
  • Too many style keywords can confuse AI
  • Contradictory terms (e.g., “vintage modern”) cause issues

Performance Issues

↑ Back to top

Slow Generation:

  • Normal generation time: 15-30 seconds
  • Network latency affects speed
  • API server load during peak times
  • Bulk operations are not currently available – generate images individually

Plugin Conflicts:

  • Disable other media management plugins temporarily
  • Check for JavaScript errors in browser console
  • Ensure WooCommerce is updated to latest version

Related Products

Offer add-ons like gift wrapping, special messages or other special options for your products.

Add shipment tracking information to your orders.