SW Shopware 6 Intermediate

AI Virtual Try-On for Shopware 6 — Guide

Install and configure the AI virtual try-on plugin for Shopware 6: Google Cloud, Vertex AI, GDPR and troubleshooting.

Updated Module version 1.0.0

This plugin adds a virtual try-on widget to Shopware 6 product pages. The shopper adds a photo of themselves and Google Vertex AI generates a preview of the garment worn. Compatible with Shopware 6.5, 6.6 and 6.7.

How it works

The widget appears on the product page, below the buy button. The shopper uploads a photo (or takes one with the camera on mobile). The photo is downscaled in the browser and sent to your server. The server fetches the product image, calls the Google Vertex AI API (virtual-try-on-001 model) and returns the generated preview.

This is a generative render, not a real-time augmented-reality try-on. Each preview is an API call that returns an image within a few seconds.

Google Cloud prerequisites

The plugin relies on Vertex AI. A one-time Google Cloud setup is required.

1. Create a project and enable billing

  • Create or select a project in the Google Cloud console.
  • Enable billing on the project (required for Vertex AI).

2. Enable the Vertex AI API

Enable the Vertex AI API (aiplatform.googleapis.com) for the project.

3. Create a service account

  • Create a service account.
  • Grant it the Vertex AI User role (roles/aiplatform.user).
  • Create a JSON key for it and download it.

Installation

Install the plugin like any Shopware extension (upload the ZIP under Extensions then My extensions, or place the folder in custom/plugins/DfVirtualTryOn), then from the command line:

bin/console plugin:refresh
bin/console plugin:install --activate DfVirtualTryOn
bin/console cache:clear

No storefront build is required: the widget is self-contained, with styles and JavaScript included.

Configuration

In the Shopware admin, open the plugin configuration and fill in:

  • Google Cloud project ID: your project identifier.
  • Region: a region where the model is available (us-central1 by default).
  • Model: virtual-try-on-001 (recommended).
  • Service-account JSON key: paste the entire downloaded JSON file.
  • Number of images: 1 to 4 previews per try-on.
  • Require consent: enabled by default, recommended.
  • Privacy policy URL: shown in the consent notice.
  • Button label: optional, overrides the translated default text.

The region matters: the model is not available everywhere. If you pick a region that does not host it, calls fail with a “model not found” error. When in doubt, use us-central1.

Privacy & GDPR

Shopper photos are personal data. This plugin sends the photo only to Google Vertex AI to generate the preview, does not store the photo or the result on your server, can require explicit consent before each generation, and lets you link your privacy policy in the consent notice.

You remain the data controller. Update your privacy policy to disclose that try-on images are processed by Google Cloud.

Cost

Vertex AI bills each generated image (Imagen pricing). These charges sit on Google Cloud, independent of the plugin price. Set the number of images to 1 to control cost.

Tips for good results

  • Use a clear, well-lit, full-body photo.
  • Prefer clean product images (flat-lay or on a model).
  • Tops, bottoms and one-piece garments such as dresses give the best results.

Troubleshooting

  • Not authorized: the service account is missing the Vertex AI User role, or the key is wrong.
  • Model not found in the region: the region does not offer the model. Use us-central1.
  • Not configured: the project ID or the JSON key is empty.
  • Rate-limited: Vertex AI quota exceeded. Retry later or request a quota increase.
Was this page helpful?

Still stuck? Contact support