Table of Contents

Class MaskReferenceImage

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

A mask reference image. This encapsulates either a mask image provided by the user and configs for the user provided mask, or only config parameters for the model to generate a mask. A mask image is an image whose non-zero values indicate where to edit the base image. If the user provides a mask image, the mask must be in the same dimensions as the raw image.

public record MaskReferenceImage : IReferenceImage, IEquatable<MaskReferenceImage>
Inheritance
MaskReferenceImage
Implements
Inherited Members

Properties

Config

Configuration for the mask reference image.

[JsonPropertyName("config")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public MaskReferenceConfig? Config { get; set; }

Property Value

MaskReferenceConfig

ReferenceId

The id of the reference image.

[JsonPropertyName("referenceId")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public int? ReferenceId { get; set; }

Property Value

int?

ReferenceImage

The reference image for the editing operation.

[JsonPropertyName("referenceImage")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public Image? ReferenceImage { get; set; }

Property Value

Image

ReferenceType

The type of the reference image. Only set by the SDK.

[JsonPropertyName("referenceType")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public string? ReferenceType { get; set; }

Property Value

string

Methods

FromJson(string, JsonSerializerOptions?)

Deserializes a JSON string to a MaskReferenceImage object.

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

Parameters

jsonString string

The JSON string to deserialize.

options JsonSerializerOptions

Optional JsonSerializerOptions.

Returns

MaskReferenceImage

The deserialized MaskReferenceImage object, or null if deserialization fails.