More Products

Generate product-on-model images

Last updated: Nov-13-2025

When you need to create lifestyle imagery showing your products on models, manually coordinating photoshoots, editing, and managing variations for each product can be time-consuming and expensive.

This sample PowerFlow uses AI to automatically generate images of models wearing your product items. The flow takes product images from your Media Library and uses Google's Gemini image generation to create realistic lifestyle shots, complete with metadata preservation for tracking and organization.

Overview

Gemini Products on Models PowerFlow

The PowerFlow uses the following blocks:

  • Run From Assets: Allows you to trigger the flow from product images that you select in your Media Library.
  • Generate Public ID (JQ Processor block): Creates a new public ID by appending _withmodel to the original product image's public ID.
  • Extract Product ID (JQ Processor block): Retrieves the product_id value from the structured metadata of the source product image.
  • Gemini Generate Image And Cloudinary Upload: Generates a new image of a model wearing the product using Google's Gemini AI and uploads it to Cloudinary with the new public ID and metadata.

Run From Assets

The Run From Assets block allows you to trigger the flow from product images that you select in your Media Library.

Steps:

  1. Add the Run From Assets block to your canvas.
  2. Open the block configuration and set the Description to Gemini image generation products on models.
  3. Under More options, add an Input parameter called prompt.

Run From Assets configuration

Generate Public ID

The Generate Public ID block (a JQ Processor block) creates the public ID for the generated image by appending _withmodel to the original product image's public ID.

Steps:

  1. Add the JQ Processor block to your canvas.
  2. Connect the output of the Run From Assets block to its input.
  3. Open the block configuration and rename the block to Generate Public ID for clarity.
  4. For JSON data: Click the + icon to insert the Run From Assets variable (this is the entire response JSON from the Run From Assets block).
  5. For JQ expression: Enter the following expression to append _withmodel to the public ID:

Generate Public ID configuration

Extract Product ID

The Extract Product ID block (a JQ Processor block) retrieves the product_id value from the structured metadata of the source product image. This metadata value is then applied to the generated image to maintain product tracking and organization.

Steps:

  1. Add the JQ Processor block to your canvas.
  2. Connect the output of the Generate Public ID block to its input.
  3. Open the block configuration and rename the block to Extract Product ID for clarity.
  4. For JSON data: Click the + icon to insert the Run From Assets variable (this is the entire response JSON from the Run From Assets block).
  5. For JQ expression: Enter the following expression to extract the product ID from structured metadata (the external ID of the product ID field is product_id):

Note
Make sure you have a structured metadata field with the external ID product_id defined in your product environment, and that your product images have this field populated.

Extract Product ID configuration

Gemini Generate Image And Cloudinary Upload

The Gemini Generate Image And Cloudinary Upload block generates a new image of a model wearing the product using Google's Gemini AI and automatically uploads the result to your Cloudinary product environment.

Note
You must have a Gemini API key to use this block.

Steps:

  1. Add the Gemini Generate Image And Cloudinary Upload block to your canvas.
  2. Connect the output of the Extract Product ID block to its input.
  3. Open the block configuration and set the following:

    • Gemini API Key: Enter your Gemini API key
    • Prompt: Click the + icon to insert the variable Prompt from the Run From Assets block.
    • Gemini Model: Select or enter gemini-2.5-flash-image
    • Image URL (in Gemini parameters): Click the + icon to insert the variable Secure URL from the Run From Assets block. This provides the product image as reference for Gemini.
    • Upload Parameters (in Cloudinary parameters): Add the following JSON to set the public_id and apply the product_id structured metadata to the generated image:

Gemini Generate Image configuration

Execute the flow

Save the flow and test it to check that it works before enabling it. Once enabled, you can try it out by selecting a product image in your Media Library and running the Gemini image generation products on models automation.

Here's an example prompt that you can try:

"A stunning studio portrait of a female model wearing high-performance cycling gear. The central focus is the jacket, which has been uploaded as the reference image. She is wearing exactly this jacket on top of her clothes. The pose is strong and dynamic, with one hand adjusting the jacket's zipper and a confident, direct gaze at the camera. High-key lighting creates sharp focus and highlights the texture of the fabric. Hyper-detailed, photorealistic, 8k, fashion photography, Canon EOS R5."

After executing the flow, you can verify that:

  • A new image has been generated and uploaded to your Media Library
  • The new image has the correct public ID with _withmodel appended
  • The product_id structured metadata has been copied to the generated image
  • The generated image shows a model wearing or using the product

Generated model image in the Media Library

Tips
  • You can customize the prompt to generate different styles of model shots, different poses, backgrounds, or lighting conditions to match your brand aesthetic.
  • This flow creates the same public ID for any image generated from the same product image, so previously generated images are overwritten. Consider adding a random element to the public ID to enable generation of multiple images for the same product.

✔️ Feedback sent!

Rate this page: