TryAura is an AI‑powered virtual try‑on and content creation plugin for WordPress and WooCommerce. It helps stores create better product visuals without costly photoshoots by enabling:
- AI product image generation from existing media
- Optional short product showcase video generation
- A shopper‑facing “Try on” experience on product pages (upload or camera)
- Adds an “Enhance with AI” button inside the Featured Image media modal toolbar.
- Generates an AI image from one or multiple selected images using Google Gemini via
@google/genai. - Options before generation: Background preference (plain white, studio, natural), Output style (photo‑realistic, studio mockup, model shoot), and an optional free‑text prompt.
- Shows generation status and the result side‑by‑side with the original(s).
- “Set image” uploads the generated image to the Media Library and, when in the Featured Image modal, sets it as the featured image. In other contexts (Add Media), it only selects the upload so the user can insert it normally.
- Supports Regenerate and Download.
- Video generation: after an image is generated, you can Generate/Regenerate a short video (Veo 3 via Gemini REST LRO). The video can be downloaded or added to the Media Library.
- Injects a “Try on” button next to the Add to cart button.
- Opens a modal over the page (document.body portal, high z‑index) where shoppers can:
- Upload a photo or use their camera (capture).
- Click Try to generate a composite try‑on image combining the shopper image with the product images from the page.
- Shows result with a Download option. (Frontend does not upload to the Media Library.)
- WordPress 6.8+
- PHP 8.0+
- Node.js 18+
- WooCommerce for the frontend try‑on button (single product templates)
- Place the plugin directory in
wp-content/plugins/try-aura - Ensure Composer autoload is available (
vendor/autoload.phpis required bytry-aura.php) - Activate the plugin in the WordPress admin
- In WP Admin, go to: TryAura (top‑level menu)
- Enter your Google AI API key and Save
- The key is stored as the option:
try_aura_api_keyand is also available to the frontend/admin scripts via localization
npm install
npm run buildBuild artifacts are written to build/ and include dependency extraction .asset.php files for each entry.
try-aura.php— plugin bootstrapinc/Plugin.php— central bootstrap (registers settings REST, Enhancer, TryOn, Admin)inc/Admin.php— TryAura settings page and admin asset enqueue + localization (restUrl, nonce, apiKey)inc/Enhancer.php— enqueues the editor Featured Image Enhancer (build/enhancer.js)inc/TryOn.php— enqueues the frontend Try On assets on single product pages (build/tryon.js)src/enhancer.tsx— Featured Image Enhancer UI and AI logic (image + video); React 18createRoot; renders via a body‑level portalsrc/tryon.tsx— Frontend Try On UI for WooCommerce product page; camera/upload and AI generation client‑sidesrc/index.tsx— Admin settings app (save and fetch API key via REST)webpack.config.js— extends@wordpress/scripts, entries: index, enhancer, tryontsconfig.json— usesreact-jsxwith@wordpress/elementpackage.json— scripts (build/start/lint/format), dependencies (@google/genai,@wordpress/*)
- Uses
@google/genaiwith the modelgemini-2.5-flash-image-preview. - For multiple selected images (editor), each is sent as an
inlineDatapart; the UI shows originals in a grid and the generated result alongside. - UI states include fetching, generating, parsing, error, and done; interactive buttons are disabled while busy.
- Implemented via the Gemini REST API long‑running operation (LRO):
- Start:
POST https://generativelanguage.googleapis.com/v1beta/models/veo-3.0-fast-generate-001:predictLongRunningwithx-goog-api-key. - Poll:
GET /v1beta/{operation_name}untildone. - Download: Follow the returned video
uri(withx-goog-api-keyheader) and present as a Blob URL.
- Start:
- The result can be downloaded or uploaded to the WP Media Library and selected in the media frame.
- Generated images/videos are uploaded via the WP REST API (
wp/v2/media) using the localized root and nonce. - When the active media frame is the Featured Image modal (state
"featured-image"), the uploaded image is set as the Featured Image; otherwise it is just selected so users can insert it manually.
- The API key is stored in WordPress options and exposed to scripts only for authenticated contexts (localized into enqueued scripts). Do not commit your key.
- Image/video generation is performed client‑side, calling Google APIs directly from the browser; media uploaded to WordPress happens via the logged‑in user’s REST nonce.
- Open the post editor and click “Set featured image”.
- Select one or more images in the modal.
- Click “Enhance with AI”.
- Choose Background preference, Output style, and optionally enter a prompt.
- Click Generate.
- After generation, you may Regenerate, Download, Set image, and optionally Generate video.
- Open a single product page.
- Click “Try on” next to the Add to cart button.
- Upload a photo or use the camera, then click Try.
- Download the result if you like it.
- “Missing Google AI API key”: Go to the TryAura settings page and save a valid key.
- Buttons disabled or spinner stuck: Check browser console for network errors to Google APIs or WP REST.
- Featured image changes when using Add Media: This has been handled; featured image is only set inside the Featured Image frame.
- Frontend Try On does not upload results to the Media Library.
- Video generation depends on external long‑running operations; large queues may increase wait times.
GPL‑2.0‑or‑later (matches the WordPress plugin header in try-aura.php)
- Uses
@google/genaiand WordPress@wordpress/*packages. - © TryAura Contributors.