Fluent builder for assembling ImageGenerationOptions before calling ImageGenerationManager.generateImage. Obtained from ImageGenerationManager.imageOptionsBuilder(), it accumulates the target model, prompt and formatting choices and validates the required fields when build() is called.
Group: Builders
Methods
model(ImageModel model) · setModel(ImageModel model) · usage(String usage) · setUsage(String usage) · prompt(String prompt) · setPrompt(String prompt) · count(Integer count) · setCount(Integer count) · size(String size) · setSize(String size) · setStyle(String style) · style(String style) · build()
model(ImageModel model)
Returns: ImageGenerationOptionsBuilder
Specifies the model to use for generating the images.
| Parameter | Description |
|---|---|
model | the image model to generate with |
setModel(ImageModel model)
Returns: void
Specifies the model to use for generating the images.
| Parameter | Description |
|---|---|
model | the image model to generate with |
usage(String usage)
Returns: ImageGenerationOptionsBuilder
Identifies who is making this request, typically the calling app name or task.
| Parameter | Description |
|---|---|
usage | the usage identifier |
setUsage(String usage)
Returns: void
Identifies who is making this request, typically the calling app name or task.
| Parameter | Description |
|---|---|
usage | the usage identifier |
prompt(String prompt)
Returns: ImageGenerationOptionsBuilder
Sets the text description of the desired image or images.
| Parameter | Description |
|---|---|
prompt | the generation prompt |
setPrompt(String prompt)
Returns: void
Sets the text description of the desired image or images.
| Parameter | Description |
|---|---|
prompt | the generation prompt |
count(Integer count)
Returns: ImageGenerationOptionsBuilder
Sets the number of images to generate.
| Parameter | Description |
|---|---|
count | the number of images to generate |
setCount(Integer count)
Returns: void
Sets the number of images to generate.
| Parameter | Description |
|---|---|
count | the number of images to generate |
size(String size)
Returns: ImageGenerationOptionsBuilder
Sets the size of the generated images, for example 512x512. The available sizes for the chosen model can be read from ImageModel.getSizes().
| Parameter | Description |
|---|---|
size | the requested image size |
setSize(String size)
Returns: void
Sets the size of the generated images, for example 512x512. The available sizes for the chosen model can be read from ImageModel.getSizes().
| Parameter | Description |
|---|---|
size | the requested image size |
setStyle(String style)
Returns: void
Sets the visual style of the generated images. Supported values are provider and model specific.
| Parameter | Description |
|---|---|
style | the requested image style |
style(String style)
Returns: ImageGenerationOptionsBuilder
Sets the visual style of the generated images. Supported values are provider and model specific.
| Parameter | Description |
|---|---|
style | the requested image style |
build()
Returns: ImageGenerationOptions
Validates the accumulated fields and builds the immutable ImageGenerationOptions to pass to ImageGenerationManager.generateImage.