TextConditionerOptions

Options & Configuration · AiDotNet.Diffusion.Conditioning

Transformer dimensions shared by every text conditioner’s options, overriding the ones its variant selects.

Inheritance: ModelOptions → NeuralNetworkOptions → ModelHyperparameterOptions → TextConditionerOptions

Known derived types: CLIPTextConditionerOptions, ChatGLM3TextConditionerOptions, DistilledT5TextConditionerOptions, GemmaTextConditionerOptions, Qwen2TextConditionerOptions, SigLIP2TextConditionerOptions, SigLIPTextConditionerOptions, T5TextConditionerOptions

For Beginners

Leave these unset to get the published model size. Set, for example, HiddenSize = 256 and NumLayers = 2 to build a much smaller text encoder.

How It Works

Every property is nullable, unlike the non-nullable pattern ModelHyperparameterOptions describes, because each conditioner’s variant already fixes a paper value for it: null means “use the variant’s value”, which differs per variant and is only known once Variant is read, so no parameterless constructor could assign it. Set a property only to build a non-paper size, such as a small test-scale encoder.

Key/value heads are not declared here: only the grouped-query conditioners (ChatGLM3, Qwen2) read them, so they live on those two options classes rather than advertising a knob the other six ignore.

Properties

Property Summary
int? HiddenSize { get; set; } Transformer width; the conditioner’s embedding dimension follows it.
int? NumHeads { get; set; } Attention heads; must divide HiddenSize.
int? NumLayers { get; set; } Transformer depth.