Transform the subject in image [1] to have a style of
${STYLE_DESCRIPTION}. The image depicts
${IMAGE_DESCRIPTION}.
Transform the subject in image [1] to have a style of
a watercolor
painting of the image with loose watercolor techniques, soft tone,
pastel colors, brush strokes, delicate, clean background, spontaneity,
analog style drawing, intricate highly detailed painting. The
image depicts a portrait of a proud woman.
[[["易于理解","easyToUnderstand","thumb-up"],["解决了我的问题","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["很难理解","hardToUnderstand","thumb-down"],["信息或示例代码不正确","incorrectInformationOrSampleCode","thumb-down"],["没有我需要的信息/示例","missingTheInformationSamplesINeed","thumb-down"],["翻译问题","translationIssue","thumb-down"],["其他","otherDown","thumb-down"]],["最后更新时间 (UTC):2025-08-25。"],[],[],null,["# Instruct Customization\n\n| **Caution:** Starting on June 24, 2025, Imagen versions 1 and 2 are deprecated. Imagen models `imagegeneration@002`, `imagegeneration@005`, and `imagegeneration@006` will be removed on September 24, 2025 . For more information about migrating to Imagen 3, see [Migrate to\n| Imagen 3](/vertex-ai/generative-ai/docs/image/migrate-to-imagen-3).\n\n\u003cbr /\u003e\n\nYou can use Imagen on Vertex AI to instruct the model how to customize and transform\nthe subjects in an image to a style that you specify in a text prompt.\n\n\n[View Imagen for Editing and Customization model card](https://console.cloud.google.com/vertex-ai/publishers/google/model-garden/imagen-3.0-capability-001)\n\nCustomization prompt writing\n----------------------------\n\nThe prompt that you use with Imagen 3 Customization might affect the\nquality of your generated images. Use the following prompt templates as a\nstarting point for writing customization prompts. You might need to send several\nrequests to get your targeted output.\n\nCustomize using instruct customization for style transfer\n---------------------------------------------------------\n\n\n| To see an example of Imagen 3 Customization,\n| run the \"Imagen 3 Customized Images\" notebook in one of the following\n| environments:\n|\n| [Open in Colab](https://colab.research.google.com/github/GoogleCloudPlatform/generative-ai/blob/main/vision/getting-started/imagen3_customization.ipynb)\n|\n|\n| \\|\n|\n| [Open in Colab Enterprise](https://console.cloud.google.com/vertex-ai/colab/import/https%3A%2F%2Fraw.githubusercontent.com%2FGoogleCloudPlatform%2Fgenerative-ai%2Fmain%2Fvision%2Fgetting-started%2Fimagen3_customization.ipynb)\n|\n|\n| \\|\n|\n| [Open\n| in Vertex AI Workbench](https://console.cloud.google.com/vertex-ai/workbench/deploy-notebook?download_url=https%3A%2F%2Fraw.githubusercontent.com%2FGoogleCloudPlatform%2Fgenerative-ai%2Fmain%2Fvision%2Fgetting-started%2Fimagen3_customization.ipynb)\n|\n|\n| \\|\n|\n| [View on GitHub](https://github.com/GoogleCloudPlatform/generative-ai/blob/main/vision/getting-started/imagen3_customization.ipynb)\n\n\u003cbr /\u003e\n\nUse the following code samples to specify the style of the output images based\non the style described in the text prompt. \n\n### REST\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\nBefore using any of the request data,\nmake the following replacements:\n\n- \u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e: Your Google Cloud [project ID](/resource-manager/docs/creating-managing-projects#identifiers).\n- \u003cvar translate=\"no\"\u003eLOCATION\u003c/var\u003e: Your project's region. For example, `us-central1`, `europe-west2`, or `asia-northeast3`. For a list of available regions, see [Generative AI on Vertex AI locations](/vertex-ai/generative-ai/docs/learn/locations-genai).\n- \u003cvar translate=\"no\"\u003eTEXT_PROMPT\u003c/var\u003e: The text prompt guides what images the model generates. To use Imagen 3 Customization, include the `referenceId` of the reference image or images you provide in the format \u003cvar translate=\"no\"\u003e[$referenceId]\u003c/var\u003e. For example:\n - *Transform the subject in image \u003cvar translate=\"no\"\u003e[1]\u003c/var\u003e to have a Digital Stained Glass style\n image style.*\n - *Add a red cowboy hat to the cat in the image \u003cvar translate=\"no\"\u003e[1]\u003c/var\u003e.*\n - *Remove the corgi dog in the image \u003cvar translate=\"no\"\u003e[1]\u003c/var\u003e.*\n - *Change the red ball in the image \u003cvar translate=\"no\"\u003e[1]\u003c/var\u003e to a blue box.*\n- `\"referenceId\"`: The ID of the reference image, or the ID for a series of reference images that correspond to the same subject or style.\n- \u003cvar translate=\"no\"\u003eBASE64_REFERENCE_IMAGE\u003c/var\u003e: A reference image to guide image generation. The image must be specified as a [base64-encoded](/vertex-ai/generative-ai/docs/image/base64-encode) byte string.\n- \u003cvar translate=\"no\"\u003eIMAGE_COUNT\u003c/var\u003e: The number of generated images. Accepted integer values: 1-4. Default value: 4.\n\n\nHTTP method and URL:\n\n```\nPOST https://LOCATION-aiplatform.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/publishers/google/models/imagen-3.0-capability-001:predict\n```\n\n\nRequest JSON body:\n\n```\n{\n \"instances\": [\n {\n \"prompt\": \"TEXT_PROMPT\",\n \"referenceImages\": [\n {\n \"referenceType\": \"REFERENCE_TYPE_RAW\",\n \"referenceId\": 1,\n \"referenceImage\": {\n \"bytesBase64Encoded\": \"BASE64_REFERENCE_IMAGE\"\n }\n }\n ]\n }\n ],\n \"parameters\": {\n \"sampleCount\": IMAGE_COUNT\n }\n}\n```\n\nTo send your request, choose one of these options: \n\n#### curl\n\n| **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://LOCATION-aiplatform.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/publishers/google/models/imagen-3.0-capability-001:predict\"\n```\n\n#### PowerShell\n\n| **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://LOCATION-aiplatform.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/publishers/google/models/imagen-3.0-capability-001:predict\" | Select-Object -Expand Content\n```\nThe following sample response is for a request with `\"sampleCount\": 2`. The response returns two prediction objects, with the generated image bytes base64-encoded.\n\n```\n{\n \"predictions\": [\n {\n \"bytesBase64Encoded\": \"BASE64_IMG_BYTES\",\n \"mimeType\": \"image/png\"\n },\n {\n \"mimeType\": \"image/png\",\n \"bytesBase64Encoded\": \"BASE64_IMG_BYTES\"\n }\n ]\n}\n```\n\n\u003cbr /\u003e\n\nProduct usage\n-------------\n\nTo view usage standards and content restrictions associated with\nImagen on Vertex AI, see the\n[usage guidelines](/vertex-ai/generative-ai/docs/image/responsible-ai-imagen#imagen-guidelines).\n\nModel versions\n--------------\n\nThere are multiple image generation models that you can use. For more\ninformation, see [Imagen\nmodels](/vertex-ai/generative-ai/docs/models#imagen-models).\n\nWhat's next\n-----------\n\nRead articles about Imagen and other Generative AI on Vertex AI\nproducts:\n\n- [A developer's guide to getting started with Imagen 3 on\n Vertex AI](https://cloud.google.com/blog/products/ai-machine-learning/a-developers-guide-to-imagen-3-on-vertex-ai?e=0?utm_source%3Dlinkedin)\n- [New generative media models and tools, built with and for creators](https://blog.google/technology/ai/google-generative-ai-veo-imagen-3/#veo)\n- [New in Gemini: Custom Gems and improved image generation with\n Imagen 3](https://blog.google/products/gemini/google-gemini-update-august-2024/)\n- [Google DeepMind: Imagen 3 - Our highest quality\n text-to-image model](https://deepmind.google/technologies/imagen-3/)"]]