Mulai 29 April 2025, model Gemini 1.5 Pro dan Gemini 1.5 Flash tidak tersedia di project yang belum pernah menggunakan model ini, termasuk project baru. Untuk mengetahui detailnya, lihat Versi dan siklus proses model.
Klik Imagen. Halaman pembuatan gambar Imagen Media Studio akan ditampilkan.
Di panel Setelan, sesuaikan opsi berikut:
Model: Pilih model dari opsi yang tersedia.
Untuk mengetahui informasi selengkapnya tentang model yang tersedia, lihat Model Imagen.
Resolusi output: Pilih resolusi output dari opsi yang tersedia.
Di kotak Tulis perintah Anda, masukkan perintah teks yang menjelaskan gambar yang akan dibuat. Contoh, "small boat on water in the morning
watercolor illustration".
Klik sendBuat.
REST
Sebelum menggunakan salah satu data permintaan,
lakukan penggantian berikut:
REGION: Region tempat
project Anda berada. Untuk mengetahui informasi selengkapnya tentang region yang didukung, lihat Lokasi AI Generatif di Vertex AI.
TEXT_PROMPT: Perintah
teks yang akan digunakan untuk membuat gambar.
PROJECT_ID: ID project
Google Cloud Anda.
MODEL_VERSION:
Versi model Imagen yang akan digunakan. Nilai berikut diterima
saat menggunakan sampleImageSize:
imagen-4.0-generate-001
imagen-4.0-ultra-generate-001
IMAGE_RESOLUTION: Resolusi
gambar output. Berikut ini diterima:
"1K"
"2K"
Setelan default-nya adalah "1K".
IMAGE_COUNT: Jumlah gambar yang akan dibuat. Rentang nilai yang diterima adalah 1
hingga 4.
Metode HTTP dan URL:
POST https://REGION-aiplatform.googleapis.com/v1/projects/PROJECT_ID/locations/REGION/publishers/google/models/MODEL_VERSION:predict
[[["Mudah dipahami","easyToUnderstand","thumb-up"],["Memecahkan masalah saya","solvedMyProblem","thumb-up"],["Lainnya","otherUp","thumb-up"]],[["Sulit dipahami","hardToUnderstand","thumb-down"],["Informasi atau kode contoh salah","incorrectInformationOrSampleCode","thumb-down"],["Informasi/contoh yang saya butuhkan tidak ada","missingTheInformationSamplesINeed","thumb-down"],["Masalah terjemahan","translationIssue","thumb-down"],["Lainnya","otherDown","thumb-down"]],["Terakhir diperbarui pada 2025-09-04 UTC."],[],[],null,["Imagen on Vertex AI lets you set the output resolution of generated images when you\nuse the following Imagen 4 models:\n\n- `imagen-4.0-generate-001`\n- `imagen-4.0-ultra-generate-001`\n\nConsole\n\n1. In the Google Cloud console, go to the **Vertex AI \\\u003e Media\n Studio** page.\n\n [Go to Media\n Studio](https://console.cloud.google.com/vertex-ai/studio/media/generate;tab=image)\n2. Click **Imagen**. The Imagen Media Studio image generation page is\n displayed.\n\n3. In the **Settings** panel, adjust the following options:\n\n - **Model**: Choose a model from the available options.\n\n For more information about available models, see [Imagen\n models](/vertex-ai/generative-ai/docs/models#imagen-models).\n - **Output resolution**: Choose an output resolution from the available\n options.\n\n4. In the **Write your prompt** box, enter your text prompt that describes\n the images to generate. For example, `\"small boat on water in the morning\n watercolor illustration\"`.\n\n5. Click send **Generate**.\n\nREST\n\n\nBefore using any of the request data,\nmake the following replacements:\n\n- \u003cvar class=\"edit\" scope=\"REGION\" translate=\"no\"\u003eREGION\u003c/var\u003e: The region that your project is located in. For more information about supported regions, see [Generative AI on\n Vertex AI locations](/vertex-ai/generative-ai/docs/learn/locations).\n- \u003cvar class=\"edit\" scope=\"TEXT_PROMPT\" translate=\"no\"\u003eTEXT_PROMPT\u003c/var\u003e: The text prompt to use to generate images.\n- \u003cvar class=\"edit\" scope=\"PROJECT_ID\" translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e: Your Google Cloud project ID.\n- \u003cvar class=\"edit\" scope=\"MODEL_VERSION\" translate=\"no\"\u003eMODEL_VERSION\u003c/var\u003e: The Imagen model version to use. The following are accepted values when using `sampleImageSize`:\n - `imagen-4.0-generate-001`\n - `imagen-4.0-ultra-generate-001`\n- \u003cvar class=\"edit\" scope=\"IMAGE_RESOLUTION\" translate=\"no\"\u003eIMAGE_RESOLUTION\u003c/var\u003e: The output image resolution. The following are accepted:\n - `\"1K\"`\n - `\"2K\"`\n\n The default setting is `\"1K\"`.\n- \u003cvar class=\"edit\" scope=\"IMAGE_COUNT\" translate=\"no\"\u003eIMAGE_COUNT\u003c/var\u003e: The number of images to generate. The accepted range of values is `1` to `4`.\n\n\nHTTP method and URL:\n\n```\nPOST https://REGION-aiplatform.googleapis.com/v1/projects/PROJECT_ID/locations/REGION/publishers/google/models/MODEL_VERSION:predict\n```\n\n\nRequest JSON body:\n\n```\n{\n \"instances\": [\n {\n \"prompt\": \"TEXT_PROMPT\"\n }\n ],\n \"parameters\": {\n \"sampleImageSize\": \"IMAGE_RESOLUTION\",\n \"sampleCount\": IMAGE_COUNT\n }\n}\n```\n\nTo send your request, choose one of these options: \n\ncurl **Note:** The following command assumes that you have logged in to the `gcloud` CLI with your user account by running [`gcloud init`](/sdk/gcloud/reference/init) or [`gcloud auth login`](/sdk/gcloud/reference/auth/login) , or by using [Cloud Shell](/shell/docs), which automatically logs you into the `gcloud` CLI . You can check the currently active account by running [`gcloud auth list`](/sdk/gcloud/reference/auth/list).\n\n\nSave the request body in a file named `request.json`,\nand execute the following command:\n\n```\ncurl -X POST \\\n -H \"Authorization: Bearer $(gcloud auth print-access-token)\" \\\n -H \"Content-Type: application/json; charset=utf-8\" \\\n -d @request.json \\\n \"https://REGION-aiplatform.googleapis.com/v1/projects/PROJECT_ID/locations/REGION/publishers/google/models/MODEL_VERSION:predict\"\n```\n\nPowerShell **Note:** The following command assumes that you have logged in to the `gcloud` CLI with your user account by running [`gcloud init`](/sdk/gcloud/reference/init) or [`gcloud auth login`](/sdk/gcloud/reference/auth/login) . You can check the currently active account by running [`gcloud auth list`](/sdk/gcloud/reference/auth/list).\n\n\nSave the request body in a file named `request.json`,\nand execute the following command:\n\n```\n$cred = gcloud auth print-access-token\n$headers = @{ \"Authorization\" = \"Bearer $cred\" }\n\nInvoke-WebRequest `\n -Method POST `\n -Headers $headers `\n -ContentType: \"application/json; charset=utf-8\" `\n -InFile request.json `\n -Uri \"https://REGION-aiplatform.googleapis.com/v1/projects/PROJECT_ID/locations/REGION/publishers/google/models/MODEL_VERSION:predict\" | Select-Object -Expand Content\n```\nThe request returns image objects. In this example, two image objects are returned, with two prediction objects as base64-encoded images.\n\n```\n{\n \"predictions\": [\n {\n \"mimeType\": \"image/png\",\n \"bytesBase64Encoded\": \"BASE64_IMG_BYTES\"\n },\n {\n \"bytesBase64Encoded\": \"BASE64_IMG_BYTES\",\n \"mimeType\": \"image/png\"\n }\n ]\n}\n```\n\n\u003cbr /\u003e"]]