+
    ƒ°ñjR	  ã                   óÊ   € ^ RI t^ RIHt  ! R R]P                  P                  P
                  4      t ! R R]P                  4      t ! R R]P                  4      t
R
R	 ltR# )é    N)Úsd1_clipc                   ó>   a a€ ] tR t^t oRtR/ 3V 3R lltRtVtV ;t# )ÚCogVideoXT5Tokenizera	  Inner T5 tokenizer for CogVideoX.

CogVideoX was trained with T5 embeddings padded to 226 tokens (not 77 like SD3).
Used both directly by supported_models.CogVideoX_T2V.clip_target (paired with
the raw T5XXLModel) and by the CogVideoXTokenizer outer wrapper below.
Nc                ó*   <€ \         SV `  W^âR7       R# )éâ   )Úembedding_directoryÚtokenizer_dataÚ
min_lengthN)ÚsuperÚ__init__©Úselfr   r	   Ú	__class__s   &&&€Ú@C:\Ai_Coding\apps\studio\ComfyUI\comfy\text_encoders\cogvideo.pyr   ÚCogVideoXT5Tokenizer.__init__   s   ø€ Ü‰ÑÐ-@ÐloÐÖpó    © ©	Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__r   Ú__static_attributes__Ú__classdictcell__Ú__classcell__©r   Ú__classdict__s   @@r   r   r      s   ù‡ € ñð ,0À÷ q÷ qr   r   c                   ó>   a a€ ] tR t^t oRtR/ 3V 3R lltRtVtV ;t# )ÚCogVideoXTokenizerz:Outer tokenizer wrapper for CLIPLoader (type="cogvideox").Nc                ó4   <€ \         SV `  WR \        R7       R# )Út5xxl)r   r	   Ú	clip_nameÚ	tokenizerN)r   r   r   r   s   &&&€r   r   ÚCogVideoXTokenizer.__init__   s   ø€ Ü‰ÑÐ-@Ø#*Ô6Jð 	ö 	Lr   r   r   r   s   @@r   r    r       s   ù‡ € ÙDØ+/À÷ L÷ Lr   r    c                   ó@   a a€ ] tR t^t oRtRR/ 3V 3R lltRtVtV ;t# )ÚCogVideoXT5XXLa  Outer T5XXL model wrapper for CLIPLoader (type="cogvideox").

Wraps the raw T5XXL model in the SD1ClipModel interface so that CLIP.__init__
(which reads self.dtypes) works correctly. The inner model is the standard
sd3_clip.T5XXLModel (no attention_mask change needed for CogVideoX).
ÚcpuNc                ór   <€ \         SV `  WR \        P                  P                  P
                  VR7       R# )r"   )ÚdeviceÚdtypeÚnameÚ
clip_modelÚmodel_optionsN)r   r   ÚcomfyÚtext_encodersÚsd3_clipÚ
T5XXLModel)r   r*   r+   r.   r   s   &&&&€r   r   ÚCogVideoXT5XXL.__init__   s1   ø€ Ü‰Ñ ¸'Ü$)×$7Ñ$7×$@Ñ$@×$KÑ$KØ'4ð 	ö 	6r   r   r   r   s   @@r   r'   r'      s   ù‡ € ñð $¨4¸r÷ 6÷ 6r   r'   c                ó0   a a€  ! V V3R lR\         4      pV# )z Factory that returns a CogVideoXT5XXL class configured with the detected
T5 dtype and optional quantization metadata, for use in load_text_encoder_state_dicts.
c                   óB   <a a€ ] tR t^(t oRR/ 3V VV3R lltRtVtV ;t# )Ú&cogvideo_te.<locals>.CogVideoXTEModel_r(   Nc                óh   <€ Se   VP                  4       pSVR&   Se   Sp\        SV `	  WVR7       R # )NÚt5xxl_quantization_metadata)r*   r+   r.   )Úcopyr   r   )r   r*   r+   r.   r   Údtype_t5Út5_quantization_metadatas   &&&&€€€r   r   Ú/cogvideo_te.<locals>.CogVideoXTEModel_.__init__)   s?   ø€ Ø'Ò3Ø -× 2Ñ 2Ó 4�Ø?W�Ð;Ñ<ØÒ#Ø �Ü‰GÑ FÀ}ÐÖUr   r   )r   r   r   r   r   r   r   r   )r   r   r:   r;   s   @@€€r   ÚCogVideoXTEModel_r6   (   s   ú‡ € Ø"'¨tÀ2÷ 	V÷ 	Vñ 	Vr   r=   )r'   )r:   r;   r=   s   ff r   Úcogvideo_ter>   $   s   ù€ ÷Vð VœNô Vð Ðr   )NN)Úcomfy.text_encoders.sd3_clipr/   r   r0   r1   ÚT5XXLTokenizerr   ÚSD1Tokenizerr    ÚSD1ClipModelr'   r>   r   r   r   Ú<module>rC      sV   ðÛ #Ý ôq˜5×.Ñ.×7Ñ7×FÑFô qôL˜×.Ñ.ô Lô
6�X×*Ñ*ô 
6ör   