Table of Contents

Class MaskReferenceConfig

Namespace
Google.GenAI.Types
Assembly
Google.GenAI.dll

Configuration for a Mask reference image.

public record MaskReferenceConfig : IEquatable<MaskReferenceConfig>
Inheritance
MaskReferenceConfig
Implements
Inherited Members

Properties

MaskDilation

Dilation percentage of the mask provided. Float between 0 and 1.

[JsonPropertyName("maskDilation")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public double? MaskDilation { get; set; }

Property Value

double?

MaskMode

Prompts the model to generate a mask instead of you needing to provide one (unless MASK_MODE_USER_PROVIDED is used).

[JsonPropertyName("maskMode")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public MaskReferenceMode? MaskMode { get; set; }

Property Value

MaskReferenceMode?

SegmentationClasses

A list of up to 5 class ids to use for semantic segmentation. Automatically creates an image mask based on specific objects.

[JsonPropertyName("segmentationClasses")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public List<int>? SegmentationClasses { get; set; }

Property Value

List<int>

Methods

FromJson(string, JsonSerializerOptions?)

Deserializes a JSON string to a MaskReferenceConfig object.

public static MaskReferenceConfig? FromJson(string jsonString, JsonSerializerOptions? options = null)

Parameters

jsonString string

The JSON string to deserialize.

options JsonSerializerOptions

Optional JsonSerializerOptions.

Returns

MaskReferenceConfig

The deserialized MaskReferenceConfig object, or null if deserialization fails.