快速入门:使用 Imagen 文本转图片功能生成和验证图片的水印(控制台)

了解如何使用 Imagen on Vertex AI 的文本转图片功能并对生成的图片验证数字水印 (SynthID)。本快速入门介绍如何在Google Cloud 控制台中使用 Imagen 图片生成。

Imageer on Vertex AI 价格取决于您使用的功能。如需了解详情,请参阅价格

生成的狗狗图片
通过 Imagen on Vertex AI 根据提示生成的图片:海滩上的一只法国斗牛犬的照片 (85mm f/2.8)

准备工作

  1. Sign in to your Google Cloud account. If you're new to Google Cloud, create an account to evaluate how our products perform in real-world scenarios. New customers also get $300 in free credits to run, test, and deploy workloads.
  2. In the Google Cloud console, on the project selector page, select or create a Google Cloud project.

    Go to project selector

  3. Make sure that billing is enabled for your Google Cloud project.

  4. Enable the Vertex AI API.

    Enable the API

  5. In the Google Cloud console, on the project selector page, select or create a Google Cloud project.

    Go to project selector

  6. Make sure that billing is enabled for your Google Cloud project.

  7. Enable the Vertex AI API.

    Enable the API

  8. 生成图片并保存本地副本

    使用 Google Cloud 控制台发送文本到图像生成请求。

    1. 在 Google Cloud 控制台中,依次前往 Vertex AI > Media Studio 页面。

      前往 Media Studio

    2. 提示(在此处输入提示)字段中,输入以下提示:

       portrait of a french bulldog at the beach, 85mm f/2.8
      
    3. 如果未选择,请在参数面板的模型选项框中选择 Imagen 3

    4. 如果未选择,请在参数面板的宽高比部分中选择 1:1

    5. 结果数量部分中,将结果数量更改为 2

    6. 点击 生成

      生成的图片类似于以下图片:

      控制台中生成的图片的示例

    7. 如需保存图片的本地副本,请点击其中一个图片。

    8. 在打开的图片详情窗口中,点击导出

    9. 导出图片对话框中,点击导出

    验证图片的数字水印

    生成带水印的图片后,您可以验证新图片的数字水印。

    1. 按照上一步中的说明创建生成式图片并保存本地副本

    2. 图片详情窗口中,点击导出

    3. 在下方面板中,点击验证

    4. 点击上传图片

    5. 选择本地保存的生成的图片。

      控制台中生成的图片的已验证水印示例

    恭喜!您刚刚使用 Imagen 文本到图像生成功能创建了新图片并验证其中一个图片的数字水印。

    清理

    为避免因本页中使用的资源导致您的 Google Cloud 账号产生费用,请按照以下步骤操作。

    删除项目

    1. In the Google Cloud console, go to the Manage resources page.

      Go to Manage resources

    2. In the project list, select the project that you want to delete, and then click Delete.
    3. In the dialog, type the project ID, and then click Shut down to delete the project.

    后续步骤