Package com.google.genai.types
Class ImageConfig
java.lang.Object
com.google.genai.JsonSerializable
com.google.genai.types.ImageConfig
The image generation configuration to be used in GenerateContentConfig.
-
Nested Class Summary
Nested Classes -
Field Summary
Fields inherited from class com.google.genai.JsonSerializable
MAX_READ_LENGTH_PROPERTY -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionAspect ratio of the generated images.static ImageConfig.Builderbuilder()Instantiates a builder for ImageConfig.static ImageConfigDeserializes a JSON string to a ImageConfig object.Optional.Compression quality of the generated image (for ``image/jpeg`` only).MIME type of the generated image.abstract ImageConfig.BuilderCreates a builder with the same values as this instance.Methods inherited from class com.google.genai.JsonSerializable
setMaxReadLength, stringToJsonNode, toJson
-
Constructor Details
-
ImageConfig
public ImageConfig()
-
-
Method Details
-
aspectRatio
Aspect ratio of the generated images. Supported values are "1:1", "2:3", "3:2", "3:4", "4:3", "9:16", "16:9", and "21:9". -
imageSize
Optional. Specifies the size of generated images. Supported values are `1K`, `2K`, `4K`. If not specified, the model will use default value `1K`. -
outputMimeType
MIME type of the generated image. This field is not supported in Gemini API. -
outputCompressionQuality
Compression quality of the generated image (for ``image/jpeg`` only). This field is not supported in Gemini API. -
builder
Instantiates a builder for ImageConfig. -
toBuilder
Creates a builder with the same values as this instance. -
fromJson
Deserializes a JSON string to a ImageConfig object.
-