Package com.google.genai.types
Class MaskReferenceConfig
-
- All Implemented Interfaces:
public abstract class MaskReferenceConfig extends JsonSerializable
Configuration for a Mask reference image.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public abstract classMaskReferenceConfig.BuilderBuilder for MaskReferenceConfig.
-
Field Summary
Fields Modifier and Type Field Description public final static StringMAX_READ_LENGTH_PROPERTY
-
Constructor Summary
Constructors Constructor Description MaskReferenceConfig()
-
Method Summary
Modifier and Type Method Description abstract Optional<MaskReferenceMode>maskMode()Prompts the model to generate a mask instead of you needing to provide one (unless MASK_MODE_USER_PROVIDED is used). abstract Optional<List<Integer>>segmentationClasses()A list of up to 5 class ids to use for semantic segmentation. abstract Optional<Float>maskDilation()Dilation percentage of the mask provided. static MaskReferenceConfig.Builderbuilder()Instantiates a builder for MaskReferenceConfig. abstract MaskReferenceConfig.BuildertoBuilder()Creates a builder with the same values as this instance. static MaskReferenceConfigfromJson(String jsonString)Deserializes a JSON string to a MaskReferenceConfig object. -
Methods inherited from class com.google.genai.JsonSerializable
fromJsonNode, fromJsonString, objectMapper, setMaxReadLength, stringToJsonNode, toJson, toJsonNode, toJsonString -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Method Detail
-
maskMode
abstract Optional<MaskReferenceMode> maskMode()
Prompts the model to generate a mask instead of you needing to provide one (unless MASK_MODE_USER_PROVIDED is used).
-
segmentationClasses
abstract Optional<List<Integer>> segmentationClasses()
A list of up to 5 class ids to use for semantic segmentation. Automatically creates an image mask based on specific objects.
-
maskDilation
abstract Optional<Float> maskDilation()
Dilation percentage of the mask provided. Float between 0 and 1.
-
builder
static MaskReferenceConfig.Builder builder()
Instantiates a builder for MaskReferenceConfig.
-
toBuilder
abstract MaskReferenceConfig.Builder toBuilder()
Creates a builder with the same values as this instance.
-
fromJson
static MaskReferenceConfig fromJson(String jsonString)
Deserializes a JSON string to a MaskReferenceConfig object.
-
-
-
-