CLIPTextConditioner<T>
Models & Types · AiDotNet.Diffusion.Conditioning
CLIP text encoder conditioning module (Radford et al., ICML 2021). Primary text conditioner for Stable Diffusion 1.x / 2.x and one of two encoders in SDXL / SD3 / FLUX.1.
Inheritance: NeuralNetworkBase<T> → TextConditioningBase<T> → CLIPTextConditioner<T>
Constructors
| Constructor | Summary |
|---|---|
CLIPTextConditioner(ITokenizer tokenizer, NeuralNetworkArchitecture<T> architecture, CLIPTextConditionerOptions options) |
Constructs a CLIP text conditioner with an explicit paper-canonical tokenizer. |
Properties
| Property | Summary |
|---|---|
bool ProducesPooledOutput { get; } |
Methods
| Method | Summary |
|---|---|
CLIPTextConditioner<T> FromPretrained(CLIPVariant variant, string huggingFaceModelName, string cacheDir) |
Loads a paper-canonical CLIP text conditioner with its real pretrained HuggingFace tokenizer. |
Tensor<T> GetPooledEmbedding(Tensor<T> sequenceEmbeddings) |
CLIP pools by extracting the embedding at the EOS token position (Radford 2021 §3.1) and then applying _textProjection to map hidden-dim → embedding-dim. |