Table of Contents

Class RecontextImageSource

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

A set of source input(s) for image recontextualization.

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

Properties

PersonImage

Image of the person or subject who will be wearing the product(s).

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

Property Value

Image

ProductImages

A list of product images.

[JsonPropertyName("productImages")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public List<ProductImage>? ProductImages { get; set; }

Property Value

List<ProductImage>

Prompt

A text prompt for guiding the model during image recontextualization. Not supported for Virtual Try-On.

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

Property Value

string

Methods

FromJson(string, JsonSerializerOptions?)

Deserializes a JSON string to a RecontextImageSource object.

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

Parameters

jsonString string

The JSON string to deserialize.

options JsonSerializerOptions

Optional JsonSerializerOptions.

Returns

RecontextImageSource

The deserialized RecontextImageSource object, or null if deserialization fails.