Table of Contents

Class RecontextImageConfig

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

Configuration for recontextualizing an image.

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

Properties

AddWatermark

Whether to add a SynthID watermark to the generated images.

[JsonPropertyName("addWatermark")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public bool? AddWatermark { get; set; }

Property Value

bool?

BaseSteps

The number of sampling steps. A higher value has better image quality, while a lower value has better latency.

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

Property Value

int?

EnhancePrompt

Whether to use the prompt rewriting logic.

[JsonPropertyName("enhancePrompt")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public bool? EnhancePrompt { get; set; }

Property Value

bool?

HttpOptions

Used to override HTTP request options.

[JsonPropertyName("httpOptions")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public HttpOptions? HttpOptions { get; set; }

Property Value

HttpOptions

Labels

User specified labels to track billing usage.

[JsonPropertyName("labels")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public Dictionary<string, string>? Labels { get; set; }

Property Value

Dictionary<string, string>

NumberOfImages

Number of images to generate.

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

Property Value

int?

OutputCompressionQuality

Compression quality of the generated image (for image/jpeg only).

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

Property Value

int?

OutputGcsUri

Cloud Storage URI used to store the generated images.

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

Property Value

string

OutputMimeType

MIME type of the generated image.

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

Property Value

string

PersonGeneration

Whether allow to generate person images, and restrict to specific ages.

[JsonPropertyName("personGeneration")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public PersonGeneration? PersonGeneration { get; set; }

Property Value

PersonGeneration?

SafetyFilterLevel

Filter level for safety filtering.

[JsonPropertyName("safetyFilterLevel")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public SafetyFilterLevel? SafetyFilterLevel { get; set; }

Property Value

SafetyFilterLevel?

Seed

Random seed for image generation.

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

Property Value

int?

Methods

FromJson(string, JsonSerializerOptions?)

Deserializes a JSON string to a RecontextImageConfig object.

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

Parameters

jsonString string

The JSON string to deserialize.

options JsonSerializerOptions

Optional JsonSerializerOptions.

Returns

RecontextImageConfig

The deserialized RecontextImageConfig object, or null if deserialization fails.