T5TextConditioner<T>
Models & Types · AiDotNet.Diffusion.Conditioning
T5 text encoder conditioning module (Raffel et al., JMLR 2020). Used as the conditioning encoder for Stable Diffusion 3, FLUX.1, and Imagen pipelines. Pre-LN RMSNorm stack with learned relative position bias (paper-shared across all encoder layers).
Inheritance: NeuralNetworkBase<T> → TextConditioningBase<T> → T5TextConditioner<T>
Constructors
| Constructor | Summary |
|---|---|
T5TextConditioner(ITokenizer tokenizer, NeuralNetworkArchitecture<T> architecture, T5TextConditionerOptions options) |
Properties
| Property | Summary |
|---|---|
bool ProducesPooledOutput { get; } |
Methods
| Method | Summary |
|---|---|
T5TextConditioner<T> FromPretrained(T5Variant variant, string huggingFaceModelName, string cacheDir) |
Loads a paper-canonical T5 conditioner with its real pretrained SentencePiece tokenizer from HuggingFace. |
Tensor<T> GetPooledEmbedding(Tensor<T> sequenceEmbeddings) |
T5 pools by mean over non-pad tokens. |