VertexAIImageGenerator
This component enables image generation using Google Vertex AI generative model.
Basic Information
- Type:
haystack_integrations.components.generators.google_vertex.image_generator.VertexAIImageGenerator
Inputs
| Parameter | Type | Default | Description |
|---|---|---|---|
| prompt | str | The prompt to generate images from. | |
| negative_prompt | Optional[str] | None | A description of what you want to omit in the generated images. |
Outputs
| Parameter | Type | Default | Description |
|---|---|---|---|
| images | List[ByteStream] | A dictionary with the following keys: - images: A list of ByteStream objects, each containing an image. |
Overview
Work in Progress
Bear with us while we're working on adding pipeline examples and most common components connections.
This component enables image generation using Google Vertex AI generative model.
Authenticates using Google Cloud Application Default Credentials (ADCs). For more information see the official Google documentation.
Usage example:
from pathlib import Path
from haystack_integrations.components.generators.google_vertex import VertexAIImageGenerator
generator = VertexAIImageGenerator()
result = generator.run(prompt="Generate an image of a cute cat")
result["images"][0].to_file(Path("my_image.png"))
Usage Example
components:
VertexAIImageGenerator:
type: google_vertex.src.haystack_integrations.components.generators.google_vertex.image_generator.VertexAIImageGenerator
init_parameters:
Parameters
Init Parameters
These are the parameters you can configure in Pipeline Builder:
| Parameter | Type | Default | Description |
|---|---|---|---|
| project_id | Optional[str] | None | ID of the GCP project to use. By default, it is set during Google Cloud authentication. |
| model | str | imagegeneration | Name of the model to use. |
| location | Optional[str] | None | The default location to use when making API calls, if not set uses us-central-1. |
| kwargs | Any | Additional keyword arguments to pass to the model. For a list of supported arguments see the ImageGenerationModel.generate_images() documentation. |
Run Method Parameters
These are the parameters you can configure for the component's run() method. This means you can pass these parameters at query time through the API, in Playground, or when running a job. For details, see Modify Pipeline Parameters at Query Time.
| Parameter | Type | Default | Description |
|---|---|---|---|
| prompt | str | The prompt to generate images from. | |
| negative_prompt | Optional[str] | None | A description of what you want to omit in the generated images. |
Was this page helpful?