Table of Contents

Class UpscaleImageConfig

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

Configuration for upscaling an image. For more information on this configuration, refer to the Imagen API reference documentation (https://cloud.google.com/vertex-ai/generative-ai/docs/model-reference/imagen-api).

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

Properties

EnhanceInputImage

Whether to add an image enhancing step before upscaling. It is expected to suppress the noise and JPEG compression artifacts from the input image.

[JsonPropertyName("enhanceInputImage")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public bool? EnhanceInputImage { 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

ImagePreservationFactor

With a higher image preservation factor, the original image pixels are more respected. With a lower image preservation factor, the output image will have be more different from the input image, but with finer details and less noise.

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

Property Value

double?

IncludeRaiReason

Whether to include a reason for filtered-out images in the response.

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

Property Value

bool?

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>

OutputCompressionQuality

The level of compression. Only applicable if the output_mime_type is image/jpeg.

[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

The image format that the output should be saved as.

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

Property Value

string

PersonGeneration

Allows generation of people by the model.

[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?

Methods

FromJson(string, JsonSerializerOptions?)

Deserializes a JSON string to a UpscaleImageConfig object.

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

Parameters

jsonString string

The JSON string to deserialize.

options JsonSerializerOptions

Optional JsonSerializerOptions.

Returns

UpscaleImageConfig

The deserialized UpscaleImageConfig object, or null if deserialization fails.