クイックスタート: Imagen text-to-image を使用して画像の透かしを生成して検証する(コンソール)

Vertex AI のテキストから画像を生成する機能で Imagen を使用し、生成された画像のデジタル透かし(SynthID)を検証する方法について説明します。このクイックスタートでは、Google Cloud コンソールで Imagen 画像生成機能を使用する方法について説明します。

Vertex AI で Imagen を使用する場合の料金は、使用する機能によって異なります。詳細については、料金をご覧ください。

生成された犬の画像
「ビーチにいるフレンチブルドックの写真、85mm f/2.8」というプロンプトから Vertex AI が Imagen で生成した画像。

始める前に

  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.

    Roles required to select or create a project

    • Select a project: Selecting a project doesn't require a specific IAM role—you can select any project that you've been granted a role on.
    • Create a project: To create a project, you need the Project Creator (roles/resourcemanager.projectCreator), which contains the resourcemanager.projects.create permission. Learn how to grant roles.

    Go to project selector

  3. Verify that billing is enabled for your Google Cloud project.

  4. Enable the Vertex AI API.

    Roles required to enable APIs

    To enable APIs, you need the Service Usage Admin IAM role (roles/serviceusage.serviceUsageAdmin), which contains the serviceusage.services.enable permission. Learn how to grant roles.

    Enable the API

  5. Make sure that you have the following role or roles on the project: Vertex AI User

    Check for the roles

    1. In the Google Cloud console, go to the IAM page.

      Go to IAM
    2. Select the project.
    3. In the Principal column, find all rows that identify you or a group that you're included in. To learn which groups you're included in, contact your administrator.

    4. For all rows that specify or include you, check the Role column to see whether the list of roles includes the required roles.

    Grant the roles

    1. In the Google Cloud console, go to the IAM page.

      IAM に移動
    2. プロジェクトを選択します。
    3. [ アクセスを許可] をクリックします。
    4. [新しいプリンシパル] フィールドに、ユーザー ID を入力します。 これは通常、Google アカウントのメールアドレスです。

    5. [ロールを選択] リストでロールを選択します。
    6. 追加のロールを付与するには、 [別のロールを追加] をクリックして各ロールを追加します。
    7. [保存] をクリックします。
  6. In the Google Cloud console, on the project selector page, select or create a Google Cloud project.

    Roles required to select or create a project

    • Select a project: Selecting a project doesn't require a specific IAM role—you can select any project that you've been granted a role on.
    • Create a project: To create a project, you need the Project Creator (roles/resourcemanager.projectCreator), which contains the resourcemanager.projects.create permission. Learn how to grant roles.

    Go to project selector

  7. Verify that billing is enabled for your Google Cloud project.

  8. Enable the Vertex AI API.

    Roles required to enable APIs

    To enable APIs, you need the Service Usage Admin IAM role (roles/serviceusage.serviceUsageAdmin), which contains the serviceusage.services.enable permission. Learn how to grant roles.

    Enable the API

  9. Make sure that you have the following role or roles on the project: Vertex AI User

    Check for the roles

    1. In the Google Cloud console, go to the IAM page.

      Go to IAM
    2. Select the project.
    3. In the Principal column, find all rows that identify you or a group that you're included in. To learn which groups you're included in, contact your administrator.

    4. For all rows that specify or include you, check the Role column to see whether the list of roles includes the required roles.

    Grant the roles

    1. In the Google Cloud console, go to the IAM page.

      IAM に移動
    2. プロジェクトを選択します。
    3. [ アクセスを許可] をクリックします。
    4. [新しいプリンシパル] フィールドに、ユーザー ID を入力します。 これは通常、Google アカウントのメールアドレスです。

    5. [ロールを選択] リストでロールを選択します。
    6. 追加のロールを付与するには、 [別のロールを追加] をクリックして各ロールを追加します。
    7. [保存] をクリックします。
  10. 画像を生成してローカルコピーを保存する

    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.

    次のステップ