Table of Contents

Class StyleReferenceImage

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

A style reference image. This encapsulates a style reference image provided by the user, and additionally optional config parameters for the style reference image. A raw reference image can also be provided as a destination for the style to be applied to.

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

Properties

Config

Configuration for the style reference image.

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

Property Value

StyleReferenceConfig

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 StyleReferenceImage object.

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

Parameters

jsonString string

The JSON string to deserialize.

options JsonSerializerOptions

Optional JsonSerializerOptions.

Returns

StyleReferenceImage

The deserialized StyleReferenceImage object, or null if deserialization fails.