Imagen by Vertex AI Tutorial
Introduction
Imagen by Vertex AI is the powerful text-to-image generation tool that allows us not only to generate images, however edit and analyze them.
Generating Images - We can generate images by providing a prompt. For example, we can generate an image of a cat wearing a hat.
Editing Images - Here we can edit the generated images or upload a new image and edit it. It allows us to go beyond the generated image and turn on our imagination. Like changing the background, adding text description, changing the color of the hat or material, changing the color of the cat or fur, and more.
Analyzing Images - We can generate captions for the image, ask questions about the image. For example, we can ask what is in the image, what is the color of the hat, what is the material of the hat, mood of the cat, and more.
Prerequisites
To use Imagen by Vertex AI you should REQUEST ACCESS. Simply fill out the form and you should be good to go.
If you don't have a Google Cloud account yet, you can create one for free. Please, follow up Chirp Tutorial it provides step-by-step guide to create a Google Cloud account set up a new project, bucket end etc.
Time to Dive In!
I will provide screenshots to make it more convinient and easy to digest. Let's get started!
If you already created an account and set up a project. Go to Google Cloud Console.
Now, click burger menu on the top left corner and select APIs & Services
> Library
.
Then, search for Vertex AI API
, select the first Vision AI API
and click Enable
button. After that, you will be redirected to the main page. You may leave all the settings as default for now.
Next, open up the burger menu again and select Vertex AI
> Vision
.
You should see the following page. This is the main page of Vertex AI Vision. Here we will generate images, edit them, generate captions and ask questions about the image.
Generating Images
Let's start with generating images. Click GENERATE
button. And below in the textarea enter the following prompt:
A photo of a cat wearing a hat
Now, click GENERATE
button:
Full image:
You can generate more images by clicking GENERATE
button again. You can also edit the image by clicking EDIT
button. You can change the image, add text, change the background, and more.
Editing Images
Let's try to edit the image. Click EDIT
button and turn on your imagination. For now, I will simply extract the background. Feel free to play around EDIT
feature.
Analyzing Images
You can also generate captions for the image. Click CAPTION
button and upload the image you want to generate caption for, then click GENERATE CAPTION
.
Next, let's ask questions about the image. Click VISUAL Q&A
button and ask any question you want. I tried the following questions:
What is the color of the hat?
What is the color of the background?
What is in the image?
What is the cat wearing?
Feel free to change the number of answers, captions, generated images you want to get by sliding the slider on the right side.
Conclusion
Throughout the tutorial, I utilized screenshots to provide visual guidance and make the learning process more accessible. By following these steps, I hope you gained a comprehensive understanding of Imagen by Vertex AI and its capabilities.
Thank you for following along with this tutorial.