ImageConfig

@Serializable
data class ImageConfig(val aspectRatio: String? = null, val imageSize: String? = null, val personGeneration: String? = null, val prominentPeople: ProminentPeople? = null, val outputMimeType: String? = null, val outputCompressionQuality: Int? = null, val imageOutputOptions: ImageConfigImageOutputOptions? = null)

The image generation configuration to be used in GenerateContentConfig.

Constructors

Link copied to clipboard
constructor(aspectRatio: String? = null, imageSize: String? = null, personGeneration: String? = null, prominentPeople: ProminentPeople? = null, outputMimeType: String? = null, outputCompressionQuality: Int? = null, imageOutputOptions: ImageConfigImageOutputOptions? = null)

Properties

Link copied to clipboard
val aspectRatio: String? = null

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".

Link copied to clipboard

Optional. The image output format for generated images. This field is not supported in Gemini API.

Link copied to clipboard
val imageSize: String? = null

Optional. Specifies the size of generated images. Supported values are 1K, 2K, 4K. If not specified, the model will use default value 1K.

Link copied to clipboard

Compression quality of the generated image (for `image/jpeg` only). This field is not supported in Gemini API.

Link copied to clipboard
val outputMimeType: String? = null

MIME type of the generated image. This field is not supported in Gemini API.

Link copied to clipboard

Controls the generation of people. Supported values are: ALLOW_ALL, ALLOW_ADULT, ALLOW_NONE.

Link copied to clipboard

Optional. Controls whether prominent people (celebrities) generation is allowed. If used with personGeneration, personGeneration enum would take precedence. For instance, if ALLOW_NONE is set, all person generation would be blocked. If this field is unspecified, the default behavior is to allow prominent people. This field is not supported in Gemini API.