Starting April 29, 2025, Gemini 1.5 Pro and Gemini 1.5 Flash models are not available in projects that have no prior usage of these models, including new projects. For details, see Model versions and lifecycle.
This page describes how to set Responsible AI (RAI) filters in
Imagen on Vertex AI.
There are several RAI filtering parameters that you can use with
Imagen on Vertex AI models. For example, you can let the model report RAI filter
codes for blocked content, disable people or face generation using RAI filters,
set the level of content filtering, or return rounded RAI scores of list of
safety attributes for input and output.
The available settings depend on the Imagen model version that
you use. For more information, see Imagen
models and the API
reference.
Click Imagen. The Imagen Media Studio image generation page is
displayed.
In the Settings panel, adjust the following options:
Model: Choose a model from the available options.
For more information about available models, see Imagen
models
Number of results: Adjust the slider or enter a value between
1 and 4.
In the Safety section configure the following settings:
Select one of the following Person generation settings:
Allow (Adults only): Generate adult people or faces only.
Don't generate youth or children people or faces.
Allow (All ages): Generate people or faces of all ages.
Don't allow: Don't generate people or faces.
Select one of the following Safety filter threshold settings:
Block most: Blocks the most of the harmful content.
Block some: Blocks some problematic prompts and responses.
Block few: Blocks very few problematic prompts and responses.
In the Write your prompt box, enter your text prompt that describes
the images to generate. For example, small boat on water in the morning
watercolor illustration.
Click sendGenerate.
REST
Before using any of the request data,
make the following replacements:
LOCATION: 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.
TEXT_PROMPT: The text prompt that guides what images the model
generates. This field is required for both generation and editing.
IMAGE_COUNT: The number of generated images.
Accepted integer values: 1-8 (imagegeneration@002), 1-4 (all other model versions).
Default value: 4.
SAFETY_SETTING: string. Optional. A setting that controls safety filter thresholds
for generated images. Available values:
block_low_and_above: The highest safety threshold, resulting in the largest
amount of
generated images that are filtered. Previous value: block_most.
block_medium_and_above (default): A medium safety threshold that balances
filtering for
potentially harmful and safe content. Previous value: block_some.
block_only_high: A safety threshold that reduces the number of
requests blocked
due to safety filters. This setting might increase objectionable content generated by
Imagen. Previous value: block_few.
PERSON_SETTING: string. Optional. The safety setting that controls the type of
people or face generation the model allows. Available values:
allow_adult (default): Allow generation of adults only, except for celebrity
generation. Celebrity generation is not allowed for any setting.
dont_allow: Disable the inclusion of people or faces in generated images.
INCLUDE_RAI_REASON: boolean. Optional. Whether to enable the Responsible AI filtered reason
code in responses with blocked input or output. Default value:
true.
INCLUDE_SAFETY_ATTRIBUTES: boolean. Optional. Whether to enable rounded
Responsible AI scores for a list of safety attributes in responses for unfiltered input and
output. Safety attribute categories: "Death, Harm & Tragedy",
"Firearms & Weapons", "Hate", "Health",
"Illicit Drugs", "Politics", "Porn",
"Religion & Belief", "Toxic", "Violence",
"Vulgarity", "War & Conflict". Default value: false.
HTTP method and URL:
POST https://LOCATION-aiplatform.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/publishers/google/models/imagegeneration@006:predict
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-27 UTC."],[],[],null,["# Configure Responsible AI safety settings\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\n\n[Try image generation (Vertex AI Studio)](https://console.cloud.google.com/vertex-ai/studio/media/generate;tab=image)\n\n[Try Imagen in a Colab](https://colab.research.google.com/github/GoogleCloudPlatform/generative-ai/blob/main/vision/getting-started/imagen4_image_generation.ipynb)\n\nThis page describes how to set Responsible AI (RAI) filters in\nImagen on Vertex AI.\n\nThere are several RAI filtering parameters that you can use with\nImagen on Vertex AI models. For example, you can let the model report RAI filter\ncodes for blocked content, disable people or face generation using RAI filters,\nset the level of content filtering, or return rounded RAI scores of list of\nsafety attributes for input and output.\n\nThe available settings depend on the Imagen model version that\nyou use. For more information, see [Imagen\nmodels](/vertex-ai/generative-ai/docs/models#imagen-models) and the [API\nreference](/vertex-ai/generative-ai/docs/model-reference/image-generation).\n\nFor more information about RAI, see [Responsible AI and usage guidelines for\nImagen](/vertex-ai/generative-ai/docs/image/responsible-ai-imagen).\n\nSet RAI parameters\n------------------\n\nDo the following: \n\n### Console\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 - **Number of results** : Adjust the slider or enter a value between\n **1** and **4**.\n\n4. In the **Safety** section configure the following settings:\n\n - Select one of the following **Person generation** settings:\n\n - **Allow (Adults only)**: Generate adult people or faces only. Don't generate youth or children people or faces.\n - **Allow (All ages)**: Generate people or faces of all ages.\n - **Don't allow**: Don't generate people or faces.\n - Select one of the following **Safety filter threshold** settings:\n\n - **Block most**: Blocks the most of the harmful content.\n - **Block some**: Blocks some problematic prompts and responses.\n - **Block few**: Blocks very few problematic prompts and responses.\n5. 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\n6. Click send **Generate**.\n\n### REST\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 that guides what images the model generates. This field is required for both generation and editing.\n- \u003cvar translate=\"no\"\u003eIMAGE_COUNT\u003c/var\u003e: The number of generated images. Accepted integer values: 1-8 (`imagegeneration@002`), 1-4 (all other model versions). Default value: 4.\n- \u003cvar translate=\"no\"\u003eSAFETY_SETTING\u003c/var\u003e: string. Optional. A setting that controls safety filter thresholds for generated images. Available values:\n - `block_low_and_above`: The highest safety threshold, resulting in the largest amount of generated images that are filtered. Previous value: `block_most`.\n - `block_medium_and_above` (default): A medium safety threshold that balances filtering for potentially harmful and safe content. Previous value: `block_some`.\n - `block_only_high`: A safety threshold that reduces the number of requests blocked due to safety filters. This setting might increase objectionable content generated by Imagen. Previous value: `block_few`.\n- \u003cvar translate=\"no\"\u003ePERSON_SETTING\u003c/var\u003e: string. Optional. The safety setting that controls the type of people or face generation the model allows. Available values:\n - `allow_adult` (default): Allow generation of adults only, except for celebrity generation. Celebrity generation is not allowed for any setting.\n - `dont_allow`: Disable the inclusion of people or faces in generated images.\n- \u003cvar translate=\"no\"\u003eINCLUDE_RAI_REASON\u003c/var\u003e: boolean. Optional. Whether to enable the [Responsible AI filtered reason\n code](/vertex-ai/generative-ai/docs/image/responsible-ai-imagen#safety-categories) in responses with blocked input or output. Default value: `true`.\n- \u003cvar translate=\"no\"\u003eINCLUDE_SAFETY_ATTRIBUTES\u003c/var\u003e: boolean. Optional. Whether to enable rounded Responsible AI scores for a list of safety attributes in responses for unfiltered input and output. Safety attribute categories: `\"Death, Harm & Tragedy\"`, `\"Firearms & Weapons\"`, `\"Hate\"`, `\"Health\"`, `\"Illicit Drugs\"`, `\"Politics\"`, `\"Porn\"`, `\"Religion & Belief\"`, `\"Toxic\"`, `\"Violence\"`, `\"Vulgarity\"`, `\"War & Conflict\"`. Default value: `false`.\n\n\nHTTP method and URL:\n\n```\nPOST https://LOCATION-aiplatform.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/publishers/google/models/imagegeneration@006:predict\n```\n\n\nRequest JSON body:\n\n```\n{\n \"instances\": [\n {\n \"prompt\": \"TEXT_PROMPT\"\n }\n ],\n \"parameters\": {\n \"sampleCount\": IMAGE_COUNT,\n \"safetySetting\": \"\u003cvar translate=\"no\"\u003eSAFETY_SETTING\u003c/var\u003e\",\n \"personGeneration\": \"\u003cvar translate=\"no\"\u003ePERSON_SETTING\u003c/var\u003e\",\n \"includeRaiReason\": \u003cvar translate=\"no\"\u003eINCLUDE_RAI_REASON\u003c/var\u003e,\n \"includeSafetyAttributes\": \u003cvar translate=\"no\"\u003eINCLUDE_SAFETY_ATTRIBUTES\u003c/var\u003e\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/imagegeneration@006: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/imagegeneration@006:predict\" | Select-Object -Expand Content\n```\nThe response you get depends on the safety settings you set. For more information, see [Understand and configure\nResponsible AI (RAI) for Imagen](/vertex-ai/generative-ai/docs/image/responsible-ai-imagen).\n\n\u003cbr /\u003e\n\nWhat's next\n-----------\n\n- [Responsible AI and usage guidelines for\n Imagen](/vertex-ai/generative-ai/docs/image/responsible-ai-imagen)\n\n- [Verify an image\n watermark](/vertex-ai/generative-ai/docs/image/verify-watermark)"]]