You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs-devsite/vertexai.imagenmodel.md
+30-16Lines changed: 30 additions & 16 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -31,15 +31,16 @@ export declare class ImagenModel extends VertexAIModel
31
31
32
32
| Property | Modifiers | Type | Description |
33
33
| --- | --- | --- | --- |
34
-
| [modelConfig](./vertexai.imagenmodel.md#imagenmodelmodelconfig) | | [ImagenModelConfig](./vertexai.imagenmodelconfig.md#imagenmodelconfig_interface) | Model-level configurations to use when using Imagen. |
| [generateImages(prompt, imagenRequestOptions)](./vertexai.imagenmodel.md#imagenmodelgenerateimages) | | Generates images using the Imagen model and returns them as base64-encoded strings. |
42
-
| [generateImagesGCS(prompt, gcsURI, imagenRequestOptions)](./vertexai.imagenmodel.md#imagenmodelgenerateimagesgcs) | | Generates images to Google Cloud Storage (GCS) using the Imagen model. |
42
+
| [generateImages(prompt)](./vertexai.imagenmodel.md#imagenmodelgenerateimages) | | Generates images using the Imagen model and returns them as base64-encoded strings. |
43
+
| [generateImagesGCS(prompt, gcsURI)](./vertexai.imagenmodel.md#imagenmodelgenerateimagesgcs) | | Generates images to Google Cloud Storage (GCS) using the Imagen model. |
Safety settings for filtering inappropriate content.
88
+
89
+
<b>Signature:</b>
90
+
91
+
```typescript
92
+
readonlysafetySettings?:ImagenSafetySettings;
93
+
```
94
+
84
95
## ImagenModel.generateImages()
85
96
86
97
Generates images using the Imagen model and returns them as base64-encoded strings.
87
98
88
-
If one or more images are filtered, the returned object will have a defined `filteredReason` property. If all images are filtered, the `images` array will be empty, and no error will be thrown.
99
+
If the prompt was not blocked, but one or more of the generated images were filtered, the returned object will have a `filteredReason` property. If all images are filtered, the `images` array will be empty.
| prompt | string | The text prompt used to generate the images. |
101
-
| imagenRequestOptions | [ImagenGenerationConfig](./vertexai.imagengenerationconfig.md#imagengenerationconfig_interface) | Configuration options for the Imagen generation request. See [ImagenGenerationConfig](./vertexai.imagengenerationconfig.md#imagengenerationconfig_interface)<!-- -->. |
102
112
103
113
<b>Returns:</b>
104
114
@@ -114,12 +124,12 @@ If the request to generate images fails. This happens if the prompt is blocked.
114
124
115
125
Generates images to Google Cloud Storage (GCS) using the Imagen model.
116
126
117
-
If one or more images are filtered due to safety reasons, the returned object will have a defined `filteredReason` property. If all images are filtered, the `images` array will be empty, and no error will be thrown.
127
+
If the prompt was not blocked, but one or more of the generated images were filtered, the returned object will have a `filteredReason` property. If all images are filtered, the `images` array will be empty.
| prompt | string | The text prompt used to generate the images. |
130
140
| gcsURI | string | The GCS URI where the images should be stored. This should be a directory. For example, <code>gs://my-bucket/my-directory/</code>. |
131
-
| imagenRequestOptions | [ImagenGenerationConfig](./vertexai.imagengenerationconfig.md#imagengenerationconfig_interface) | Configuration options for the Imagen generation request. See [ImagenGenerationConfig](./vertexai.imagengenerationconfig.md#imagengenerationconfig_interface)<!-- -->. |
132
141
133
142
<b>Returns:</b>
134
143
@@ -144,12 +153,17 @@ If the request fails to generate images fails. This happens if the prompt is blo
144
153
145
154
146
155
```javascript
147
-
constimagen=newImagenModel(vertexAI, {
148
-
model: 'imagen-3.0-generate-001'
149
-
});
156
+
constimagen=newImagenModel(
157
+
vertexAI,
158
+
{
159
+
model: 'imagen-3.0-generate-001'
160
+
}
161
+
);
150
162
151
163
constresponse=awaitimagen.generateImages('A photo of a cat');
|[ImagenAspectRatio](./vertexai.md#imagenaspectratio)| Aspect ratios for Imagen images. |
56
56
|[ImagenPersonFilterLevel](./vertexai.md#imagenpersonfilterlevel)| Person filter levels for Imagen. |
57
-
|[ImagenSafetyFilterLevel](./vertexai.md#imagensafetyfilterlevel)| Safety filter levels for Imagen.|
57
+
|[ImagenSafetyFilterLevel](./vertexai.md#imagensafetyfilterlevel)| Safety filter levels for Imagen |
58
58
|[SchemaType](./vertexai.md#schematype)| Contains the list of OpenAPI data types as defined by the [OpenAPI specification](https://swagger.io/docs/specification/data-models/data-types/)|
59
59
|[VertexAIErrorCode](./vertexai.md#vertexaierrorcode)| Standardized error codes that <code>[VertexAIError](./vertexai.vertexaierror.md#vertexaierror_class)</code> can have. |
60
60
@@ -91,10 +91,9 @@ The Vertex AI in Firebase Web SDK.
|[GroundingMetadata](./vertexai.groundingmetadata.md#groundingmetadata_interface)| Metadata returned to client when grounding is enabled. |
93
93
|[ImagenGCSImage](./vertexai.imagengcsimage.md#imagengcsimage_interface)| An image generated by Imagen, stored in Google Cloud Storage (GCS). |
94
-
|[ImagenGenerationConfig](./vertexai.imagengenerationconfig.md#imagengenerationconfig_interface)|Request-level configuration options for generating images with Imagen. |
94
+
|[ImagenGenerationConfig](./vertexai.imagengenerationconfig.md#imagengenerationconfig_interface)|Configuration options for generating images with Imagen.<!---->See the \[Google Cloud Docs\](https://cloud.google.com/vertex-ai/generative-ai/docs/model-reference/imagen-api\#rest\_1).|
95
95
|[ImagenGenerationResponse](./vertexai.imagengenerationresponse.md#imagengenerationresponse_interface)| The response from a request to generate images with Imagen. |
96
96
|[ImagenInlineImage](./vertexai.imageninlineimage.md#imageninlineimage_interface)| An image generated by Imagen, represented as inline bytes. |
97
-
|[ImagenModelConfig](./vertexai.imagenmodelconfig.md#imagenmodelconfig_interface)| Model-level configuration options for Imagen. |
98
97
|[ImagenModelParams](./vertexai.imagenmodelparams.md#imagenmodelparams_interface)| Parameters for configuring an [ImagenModel](./vertexai.imagenmodel.md#imagenmodel_class)<!---->. |
99
98
|[ImagenSafetySettings](./vertexai.imagensafetysettings.md#imagensafetysettings_interface)| Safety settings for Imagen. |
100
99
|[InlineDataPart](./vertexai.inlinedatapart.md#inlinedatapart_interface)| Content part interface if the part represents an image. |
0 commit comments