Automate your Print-on-Demand business with AI
Tags: googlecloud, vertexai, generative, ai
Published: 2023-07-19 02:40:38

TLDR; Run your product's pictures through an image captioning AI model to obtain a one-line basic description, and use that as input of an LLM that gives you title, description, and tags.

Scale is the key to success in Print-on-Demand (POD). 

Platforms like Etsy.com and Redbubble reward active owners that create daily listings with more visibility and traffic.

In the era of generative AI, tools such as Midjourney, Adobe Firefly, and Stable Difussion help POD creators come up with dozens of new designs every day, but creating tailored—and more critical, SEO-optimized— Titles, descriptions, and tags is still a laborious task.

In this article, I will explain how to use two AI models, one that detects the content of product pictures and another for generating product descriptions, titles, and hashtags.
Those AI models are Blip-image-captioning and Palm 2, both available in Google Cloud's Vertex AI.

## Getting Started.

To deploy the image captioning model, go to https://console.cloud.google.com and type vertex AI in the search bar on the mid-top section of your screen.
Once there, click the model garden option on the left-hand side.
Use the search function to find the Blip image captioning model.

I will use the provided Colab notebook to deploy the Blip captioning model to an endpoint. [Direct link](https://console.cloud.google.com/vertex-ai/publishers/google/model-garden/20?authuser=1&project=optical-bond-240720)
The notebook contains comprehensive steps explaining each code block's purpose and end result. The initial config steps consist of:

- Indicating a Google Cloud Project ID.

- Google Cloud Storage (GCS) bucket.

- Choosing a region for deploying the AI model.




The notebook shows the following example of two kittens lying on a pink blanket, for which the Blip captioning Model generates the following Caption 
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/sdt4ytm0usgrcsdozkag.png)
> two cats sleeping on a couch with a remote control.

The Colab makes it very simple to pass another image to the model; paste in a URL of a picture of one of your products.

An example from real life.

![Image description](https://i.etsystatic.com/5166030/r/il/ecc06d/655388660/il_1588xN.655388660_fvdu.jpg)

> Caption: a handmade gold ring with a texture pattern [source](https://www.etsy.com/listing/203998622/22k-gold-wedding-band-set-rustic-wedding?click_key=9b806cb5b8bf8e59b26de76f4dfebc204052b6b2%3A203998622&click_sum=b79da682&ref=hp_editors_picks_primary-4)


## **Generating titles, descriptions, tags, and social media posts.**

With the image caption part ready, we can provide Google's Palm 2 LLM  some context, from which it will generate the necessary text to complement your product listing.

### Enabling Palm2.


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/pbuehty9aaiiywn304t3.png)



Palm2 is available on demand without requiring a one-time deployment as the Blip captioning model does.
Select Palm2 from the models available in the Model Garden, or select **Language**, under Generative AI studio.
You will see a Chat-like interface where you can write prompts for Palm 2 to execute.

**My prompt:**

> Imagine you work in an online retail store.
> Write an SEO-optimized product title, a new description, and 5 tags based on the product caption provided below. The title must be up to 40 characters long, the description should be about 50 words long, and the tags should be up to 20 characters each.
> 
> **example**
> Caption: Kid wearing black and white pijamas.
> Title: 
> Pijama for kids,  Son daughter gift, Birthday gift for kids, black and white pijama set, matching pijamas for kids
> Description:
> Looking for the perfect gift for your son or daughter? Look no further than our black and white Pijama set! Made from soft and comfortable materials, these matching Pijama are perfect for kids of all ages. Whether it’s for a birthday or just a special treat, your child will love snuggling up in their new Pijama.
> Our Pijama set is not only stylish but also practical. The black and white design is timeless and will never go out of style. Plus, the matching set makes it easy for siblings to coordinate their bedtime looks.
> Don’t wait, order now and give your child the gift of comfort and style. With our black and white Pijama set, bedtime has never been so fun! 🛍️🎁
> Tags:
> Kids Pijama
> Son Daughter Gift
> Birthday Gift Kids
> Black White Pijama
> Matching Pijama Kids
> 
> Caption: a handmade gold ring with a texture pattern
> Title:
> Description:
> Tags


**Prompt Design.**

- I'm using a technique known as one-shot prompting. By providing an example of the expected output, Palm2 will better understand the type of response I'm expecting.
- The prompt denotes the expected structure for the Title, Description, and Tags; Palm2 specifically tends to generate bullets and lists. I'm indirectly instructing the LLM to follow this structure by structuring the output as single lines.
### Palm2's generated title, description and tags.

Title:
Textured gold ring, handcrafted, minimalist jewelry, unique ring

Description:
This textured gold ring is a unique and stylish addition to any jewelry collection. It is handcrafted with 14k gold and features a textured pattern that adds interest and dimension. The ring is available in a variety of sizes, so you can find the perfect fit for your finger.

This ring is perfect for everyday wear or for special occasions. It is also a great gift for loved ones.

Tags:
Gold ring
Textured ring
Handcrafted jewelry
Minimalist jewelry
Unique ring

## In Summary
By leveraging Google's foundation models and the AI models available in the model garden, POD entrepreneurs can expedite the product creation process by automating the generation of SEO-optimized titles, descriptions, and hashtags from images.
The quality and veracity of the generated text must be audited. In my experiment, the model generated content containing the word woman, even though I never specified that the gold ring was meant to be used by men or women. 

Thanks for reading.