Class EditImageConfig
Configuration for editing an image.
public record EditImageConfig : IEquatable<EditImageConfig>
- Inheritance
-
EditImageConfig
- Implements
- Inherited Members
Properties
AddWatermark
Whether to add a watermark to the generated images.
[JsonPropertyName("addWatermark")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public bool? AddWatermark { get; set; }
Property Value
- bool?
AspectRatio
Aspect ratio of the generated images. Supported values are "1:1", "3:4", "4:3", "9:16", and "16:9".
[JsonPropertyName("aspectRatio")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public string? AspectRatio { get; set; }
Property Value
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?
EditMode
Describes the editing mode for the request.
[JsonPropertyName("editMode")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public EditMode? EditMode { get; set; }
Property Value
GuidanceScale
Controls how much the model adheres to the text prompt. Large values increase output and prompt alignment, but may compromise image quality.
[JsonPropertyName("guidanceScale")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public double? GuidanceScale { get; set; }
Property Value
HttpOptions
Used to override HTTP request options.
[JsonPropertyName("httpOptions")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public HttpOptions? HttpOptions { get; set; }
Property Value
IncludeRaiReason
Whether to include the Responsible AI filter reason if the image is filtered out of the response.
[JsonPropertyName("includeRaiReason")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public bool? IncludeRaiReason { get; set; }
Property Value
- bool?
IncludeSafetyAttributes
Whether to report the safety scores of each generated image and the positive prompt in the response.
[JsonPropertyName("includeSafetyAttributes")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public bool? IncludeSafetyAttributes { 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
Language
Language of the text in the prompt.
[JsonPropertyName("language")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public ImagePromptLanguage? Language { get; set; }
Property Value
NegativePrompt
Description of what to discourage in the generated images.
[JsonPropertyName("negativePrompt")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public string? NegativePrompt { get; set; }
Property Value
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
OutputMimeType
MIME type of the generated image.
[JsonPropertyName("outputMimeType")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public string? OutputMimeType { get; set; }
Property Value
PersonGeneration
Allows generation of people by the model.
[JsonPropertyName("personGeneration")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public PersonGeneration? PersonGeneration { get; set; }
Property Value
SafetyFilterLevel
Filter level for safety filtering.
[JsonPropertyName("safetyFilterLevel")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public SafetyFilterLevel? SafetyFilterLevel { get; set; }
Property Value
Seed
Random seed for image generation. This is not available when add_watermark is set to
true.
[JsonPropertyName("seed")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public int? Seed { get; set; }
Property Value
- int?
Methods
FromJson(string, JsonSerializerOptions?)
Deserializes a JSON string to a EditImageConfig object.
public static EditImageConfig? FromJson(string jsonString, JsonSerializerOptions? options = null)
Parameters
jsonStringstringThe JSON string to deserialize.
optionsJsonSerializerOptionsOptional JsonSerializerOptions.
Returns
- EditImageConfig
The deserialized EditImageConfig object, or null if deserialization fails.