Table of Contents

Class VisualMediaGenerationRequest<TTask, TPrompt, TOutput, TChunk, TEvent>

Namespace
Glitch9.AIDevKit
public abstract class VisualMediaGenerationRequest<TTask, TPrompt, TOutput, TChunk, TEvent> : GenerativeRequest<TTask, TPrompt, TOutput, TChunk, TEvent>, IGenerativeRequest, ISequentialRequest where TTask : VisualMediaGenerationRequest<TTask, TPrompt, TOutput, TChunk, TEvent> where TPrompt : IPrompt where TOutput : IGeneratedOutput where TEvent : IGenerativeEvent<TChunk, TOutput>

Type Parameters

TTask
TPrompt
TOutput
TChunk
TEvent
Inheritance
object
FluentApiRequest<TTask, TOutput>
GenerativeRequest<TTask, TPrompt, TOutput, TChunk, TEvent>
VisualMediaGenerationRequest<TTask, TPrompt, TOutput, TChunk, TEvent>
Implements
Derived
Inherited Members
Extension Methods

Constructors

VisualMediaGenerationRequest(TPrompt)

protected VisualMediaGenerationRequest(TPrompt prompt)

Parameters

prompt TPrompt

Properties

AspectRatio

public GoogleTypes.AspectRatio? AspectRatio { get; set; }

Property Value

GoogleTypes.AspectRatio?

Background

Allows to set transparency for the background of the generated image(s). This parameter is only supported for gpt-image-1. Must be one of transparent, opaque or auto (default value). When auto is used, the model will automatically determine the best background for the image.

If transparent, the output format needs to support transparency, so it should be set to either png (default value) or webp.

public ImageBackground? Background { get; set; }

Property Value

ImageBackground?

ImageFormat

The format of the response.

public GeneratedImageFormat? ImageFormat { get; set; }

Property Value

GeneratedImageFormat?

Moderation

Control the content-moderation level for images generated by gpt-image-1. Must be either low for less restrictive filtering or auto (default value).

public string Moderation { get; set; }

Property Value

string

OutputCompression

The compression level (0-100%) for the generated images. This parameter is only supported for gpt-image-1 with the webp or jpeg output formats, and defaults to 100.

public ImageCompressionLevel OutputCompression { get; set; }

Property Value

ImageCompressionLevel

PersonGeneration

public GoogleTypes.PersonGeneration? PersonGeneration { get; set; }

Property Value

GoogleTypes.PersonGeneration?

Quality

The quality of the image that will be generated. ImageQuality.HighDefinition creates images with finer details and greater consistency across the image. This param is only supported for DallE3.

public ImageQuality? Quality { get; set; }

Property Value

ImageQuality?

Remarks

Defaults to ImageQuality.Standard

Size

public ImageSize? Size { get; set; }

Property Value

ImageSize?

Style

The style of the generated images. Vivid causes the model to lean towards generating hyper-real and dramatic images. Natural causes the model to produce more natural, less hyper-real looking images. This param is only supported for DallE3.

public OpenAITypes.ImageStyle? Style { get; set; }

Property Value

OpenAITypes.ImageStyle?

Remarks

Defaults to ImageStyle.Vivid

Methods

GetRequestParameters()

public override Dictionary<string, object> GetRequestParameters()

Returns

Dictionary<string, object>

SetAspectRatio(AspectRatio)

public TTask SetAspectRatio(GoogleTypes.AspectRatio aspectRatio)

Parameters

aspectRatio GoogleTypes.AspectRatio

Returns

TTask

SetPersonGeneration(PersonGeneration)

public TTask SetPersonGeneration(GoogleTypes.PersonGeneration personGeneration)

Parameters

personGeneration GoogleTypes.PersonGeneration

Returns

TTask

SetQuality(ImageQuality)

public TTask SetQuality(ImageQuality quality)

Parameters

quality ImageQuality

Returns

TTask

SetSize(ImageSize)

public TTask SetSize(ImageSize size)

Parameters

size ImageSize

Returns

TTask

SetStyle(ImageStyle)

public TTask SetStyle(OpenAITypes.ImageStyle style)

Parameters

style OpenAITypes.ImageStyle

Returns

TTask