Class ImageConfig.Builder

  • All Implemented Interfaces:

    
    public abstract class ImageConfig.Builder
    
                        

    Builder for ImageConfig.

    • Constructor Detail

      • ImageConfig.Builder

        ImageConfig.Builder()
    • Method Detail

      • aspectRatio

         abstract ImageConfig.Builder aspectRatio(String aspectRatio)

        Setter for aspectRatio.

        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

         abstract ImageConfig.Builder imageSize(String imageSize)

        Setter for imageSize.

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

      • personGeneration

         abstract ImageConfig.Builder personGeneration(String personGeneration)

        Setter for personGeneration.

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

      • prominentPeople

         abstract ImageConfig.Builder prominentPeople(ProminentPeople prominentPeople)

        Setter for prominentPeople.

        prominentPeople: 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.

      • prominentPeople

        @CanIgnoreReturnValue() ImageConfig.Builder prominentPeople(ProminentPeople.Known knownType)

        Setter for prominentPeople given a known enum.

        prominentPeople: 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.

      • prominentPeople

        @CanIgnoreReturnValue() ImageConfig.Builder prominentPeople(String prominentPeople)

        Setter for prominentPeople given a string.

        prominentPeople: 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.

      • outputMimeType

         abstract ImageConfig.Builder outputMimeType(String outputMimeType)

        Setter for outputMimeType.

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

      • outputCompressionQuality

         abstract ImageConfig.Builder outputCompressionQuality(Integer outputCompressionQuality)

        Setter for outputCompressionQuality.

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