
    
3j                         S r SSKrSSKrSSKrSSKrSSKrSSKJ	r	J
r
  SSKJr  SSKJr  SSKJr  SSKJr  SSKJr  SS	KJrJr  S
SKJr  \R6                  S:  a  SSKrOSSKJr   \R>                  " 5       q \RD                  " \#5      r$1 Skr%\%RM                  S15      r'\RP                  RS                  SS5      RU                  5       r+\RP                  RS                  SS5      RU                  5       r,\RP                  RS                  SS5      RU                  5       r-\RP                  RS                  SS5      RU                  5       r.\RP                  RS                  SS5      RU                  5       r/\/\%;   r/\R`                  \Rb                  \Rd                  \Rf                  \Rh                  \Rj                  S.r6S\Rn                  ;   =(       d    \8" S \RP                   5       5      r9SS\:S\;S\<\;\:4   4S jjr=\,\';   a  \+\%;  a  \=" S5      u  r>r?O\$R                  S5        Sr>Sr?SrASrB\-\';   a  \R                  R                  S 5      SL=(       a    \R                  R                  S!5      SLrE\E(       a>   \R                  " S 5      rA\R                  " S!5      rB\$R                  S"\A S#\B S$35        OOSrE\.\';   a  \=" S%5      u  rHrIO\$R                  S&5        SrHSrJ\R                  R                  S'5      SLrK\K(       a?  S(rLSrJ\L H  rM \R                  " \M5      rJ  O   \JSLrK\K(       a  \$R                  S)\J 35         S*rLSrO\L H  rM \R                  " \M5      rO  O   \OSLrP\P(       a  \$R                  S+\O 35        \R                  R                  S,5      SLrQ \R                  " S-5      rR\$R                  S.\R 35        \R                  R                  S/5      SLrS \R                  " S05      rT\$R                  S1\T 35        \=" S25      u  rUrV\=" S35      u  rWrX\=" S45      u  rYrZ\=" S55      u  r[r\\=" S65      u  r]r^\=" S75      u  r_r`\=" S85      u  rarb\=" S95      u  rcrd\=" S:5      u  rerf\=" S;5      u  rgrh\=" S<5      u  rirj\=" S=5      u  rkrl\=" S>5      u  rmrn\=" S?5      u  rorp\=" S@5      u  rqrr\=" SA5      u  rsrt\=" SB5      u  rurv\=" SC5      u  rwrx\=" SD5      u  ryrz\=" SE5      u  r{r|\=" SF5      u  r}r~\=" SG5      u  rr\=" SH5      u  rr\=" SI5      u  rr\=" SJ5      u  rr\=" SK5      u  rr\=" SL5      u  rr\=" SD5      u  ryrz\=" SMSNSO9u  rr\=" SP5      u  rr\=" SQ5      u  rr\=" SR5      u  rr\=" SS5      u  rr\=" ST5      u  rr\=" SU5      u  rr\=" SV5      u  rr\=" SWSNSO9u  rr\=" SX5      u  rr\=" SYSNSO9u  rr\=" SZ5      u  rr\=" S[5      u  rrS\ rS] rS^ rS_ rS` rSa rSb rSc rSd rSe rSf rSg rSh rSi rSj rSk rSl rSm rSn rSo rSp rSq rSr rSs rSt rSu rSv rSw rSx rSy rSz rS{ rS| rS} rS~ rS rS rS rS rS rS rS rS rS rS rS rS rS rSrSrSrSrSrSrSrSrSrSrSrSrSrSrSrSrSrSrSrSrSrSrSrSrSrSrSrSr\	" S,\\44S!\\44S8\\44S\\44S\\44SG\\44S\\44S5\\44S9\\44SH\\44S:\\44S;\\44S<\\44S=\\44SF\\44S?\\44S\\44S@\\44S%\\44SD\\44S>\\44SE\\44SK\\44SL\\44S\\44SP\\44SQ\\44SR\\44/5      rS r " S S\5      rS\:\-  S\:S\:4S jr\S\:S\:4S j5       r\S\:S\:4S j5       r\S\:S\:4S j5       r\S\:S\:4S j5       r\S\:S\:4S j5       r\S\:S\:4S j5       r\S\:S\:4S j5       r\S\:S\:4S j5       r\S\:S\:4S j5       r\S\:S\:4S j5       r\S\:S\:4S j5       Gr \S\:S\:4S j5       Gr\S\:S\:4S j5       Gr\S\:S\:4S j5       Gr\S\:S\:4S j5       Gr\S\:S\:4S j5       GrS Gr " S SG\5      Gr " S S\5      Gr	g! \! a    Sq  GNf = f! \R                   a    SrE GNf = f! \R                   a     GMy  f = f! \R                   a     GMQ  f = f! \R                   a    SrP GN1f = f! \R                   a    SrQ GNf = f! \R                   a    SrS GNf = f)zD
Import utilities: Utilities related to imports and our lazy inits.
    N)OrderedDictdefaultdict)	lru_cache)chain)
ModuleType)Any)is_jinja_available)Versionparse   )logging)      >   1ONYESTRUEAUTOUSE_TF	USE_TORCHUSE_FLAXUSE_SAFETENSORSDIFFUSERS_SLOW_IMPORTFALSE)>z>=z==z!=z<=<zgoogle.colabc              #   B   #    U  H  oR                  S 5      v   M     g7f)COLAB_N)
startswith).0ks     V/home/wildlama/miniconda3/lib/python3.13/site-packages/diffusers/utils/import_utils.py	<genexpr>r#   ;   s     7cXbSTX8N8NXbs   Fpkg_nameget_dist_namereturnc                    [         R                  R                  U 5      S LnSnU(       Ga  [        c  [	        [
        5      q [        R                  " 5        H  nUR                  S5      =(       d    SR                  5       nUR                  =(       d    /  Vs1 s HA  n[        UR                  5      S:  a  UR                  S   O[        R                  " U5      iMC     snS 1-
  n[        S U5      nU=(       d    U H(  n	[        U	   R!                  UR"                  S   5        M*     M      U(       a_  U [        ;   aU  [        U    (       aG  [        [        U    5      S:  a%  [&        R)                  SU  S	[        U    S    35        [        U    S   n [        R*                  " U 5      n[&        R-                  S
U  SU 35        X#4$ X#4$ s  snf ! [$         a
  n
 S n
A
NS n
A
ff = f! [.        [        R0                  4 a    Sn X#4$ f = f)NN/Aztop_level.txt r   r   c                     SU ;  $ )N. )names    r"   <lambda>'_is_package_available.<locals>.<lambda>N   s    co    Namez)Multiple distributions found for package z. Picked distribution: zSuccessfully imported z	 version F)	importlibutil	find_spec_package_mapr   listimportlib_metadatadistributions	read_textsplitfileslenpartsinspectgetmodulenamefilterappendmetadata	ExceptionloggerwarningversiondebugImportErrorPackageNotFoundError)r$   r%   
pkg_existspkg_versiondist_top_level_declaredf_inferred_opt_names_top_level_inferredpkg_s              r"   _is_package_availablerS   >   s   ))(34?JK&t,L.<<>D+/>>/+J+Pb*W*W*Y' `d_i_i_omo_o+_oYZc!''lQ&6
G<Q<QRS<TT_o++' +11MOb*c'2I6II$S)00v1FG  J ?
	\!9l8>T|H-.2NNCH:Mdeqrze{|}e~d  A (1!4,44X>KLL1(9[MRS "":"")+   /DDE 	J""	s:   AG AG"AG 2BG+ G 
G(#G(+HHtorchz*Disabling PyTorch because USE_TORCH is setr(   jaxflaxzJAX version z, Flax version z available.safetensorsz4Disabling Safetensors because USE_SAFETENSORS is setonnxruntime)rX   zonnxruntime-cannzonnxruntime-directmlort_nightly_directmlzonnxruntime-gpuort_nightly_gpuzonnxruntime-migraphxzonnxruntime-openvinozonnxruntime-qnnzonnxruntime-rocmzonnxruntime-trainingzonnxruntime-vitisaiz*Successfully imported onnxruntime version )zopencv-pythonzopencv-contrib-pythonzopencv-python-headlesszopencv-contrib-python-headlessz"Successfully imported cv2 version bs4beautifulsoup4z#Successfully imported ftfy version imwatermarkzinvisible-watermarkz2Successfully imported invisible-watermark version 	torch_xla	torch_npu	torch_mlutransformershuggingface_hubkernelsinflect	unidecodenote_seqwandbtensorboardcompelsentencepiecetorchsdepefttorchvision
matplotlibtimmbitsandbytesimageioftfyscipylibrosa
acceleratexformersgguftorchaooptimumT)r%   pytorch_retinafacebetter_profanitynltkcosmos_guardrailsageattention
flash_attnflash_attn_3aiterkorniamodelopt	flashpackavc                      [         $ N)_torch_availabler,   r0   r"   is_torch_availabler          r0   c                      [         $ r   )_torch_xla_availabler,   r0   r"   is_torch_xla_availabler          r0   c                      [         $ r   )_torch_npu_availabler,   r0   r"   is_torch_npu_availabler      r   r0   c                      [         $ r   )_torch_mlu_availabler,   r0   r"   is_torch_mlu_availabler      r   r0   c                      [         $ r   )_flax_availabler,   r0   r"   is_flax_availabler          r0   c                      [         $ r   )_transformers_availabler,   r0   r"   is_transformers_availabler         ""r0   c                      [         $ r   )_inflect_availabler,   r0   r"   is_inflect_availabler         r0   c                      [         $ r   )_unidecode_availabler,   r0   r"   is_unidecode_availabler   	  r   r0   c                      [         $ r   )_onnx_availabler,   r0   r"   is_onnx_availabler     r   r0   c                      [         $ r   )_opencv_availabler,   r0   r"   is_opencv_availabler         r0   c                      [         $ r   )_scipy_availabler,   r0   r"   is_scipy_availabler     r   r0   c                      [         $ r   )_librosa_availabler,   r0   r"   is_librosa_availabler     r   r0   c                      [         $ r   )_xformers_availabler,   r0   r"   is_xformers_availabler         r0   c                      [         $ r   )_accelerate_availabler,   r0   r"   is_accelerate_availabler   !        r0   c                      [         $ r   )_kernels_availabler,   r0   r"   is_kernels_availabler   %  r   r0   c                      [         $ r   )_note_seq_availabler,   r0   r"   is_note_seq_availabler   )  r   r0   c                      [         $ r   )_wandb_availabler,   r0   r"   is_wandb_availabler   -  r   r0   c                      [         $ r   )_tensorboard_availabler,   r0   r"   is_tensorboard_availabler   1      !!r0   c                      [         $ r   )_compel_availabler,   r0   r"   is_compel_availabler   5  r   r0   c                      [         $ r   )_ftfy_availabler,   r0   r"   is_ftfy_availabler   9  r   r0   c                      [         $ r   )_bs4_availabler,   r0   r"   is_bs4_availabler   =  s    r0   c                      [         $ r   )_torchsde_availabler,   r0   r"   is_torchsde_availabler   A  r   r0   c                      [         $ r   )_invisible_watermark_availabler,   r0   r"    is_invisible_watermark_availabler   E  s    ))r0   c                      [         $ r   )_peft_availabler,   r0   r"   is_peft_availabler   I  r   r0   c                      [         $ r   )_torchvision_availabler,   r0   r"   is_torchvision_availabler   M  r   r0   c                      [         $ r   )_matplotlib_availabler,   r0   r"   is_matplotlib_availabler   Q  r   r0   c                      [         $ r   )_safetensors_availabler,   r0   r"   is_safetensors_availabler   U  r   r0   c                      [         $ r   )_bitsandbytes_availabler,   r0   r"   is_bitsandbytes_availabler   Y  r   r0   c                      [         $ r   )_is_google_colabr,   r0   r"   is_google_colabr   ]  r   r0   c                      [         $ r   )_sentencepiece_availabler,   r0   r"   is_sentencepiece_availabler   a      ##r0   c                      [         $ r   )_imageio_availabler,   r0   r"   is_imageio_availabler   e  r   r0   c                      [         $ r   )_gguf_availabler,   r0   r"   is_gguf_availabler   i  r   r0   c                      [         $ r   )_flashpack_availabler,   r0   r"   is_flashpack_availabler   m  r   r0   c                      [         $ r   )_torchao_availabler,   r0   r"   is_torchao_availabler   q  r   r0   c                      [         $ r   )_optimum_quanto_availabler,   r0   r"   is_optimum_quanto_availabler   u  s    $$r0   c                      [         $ r   )_nvidia_modelopt_availabler,   r0   r"   is_nvidia_modelopt_availabler   y  s    %%r0   c                      [         $ r   )_timm_availabler,   r0   r"   is_timm_availabler   }  r   r0   c                      [         $ r   )_pytorch_retinaface_availabler,   r0   r"   is_pytorch_retinaface_availabler    s    ((r0   c                      [         $ r   )_better_profanity_availabler,   r0   r"   is_better_profanity_availabler        &&r0   c                      [         $ r   )_nltk_availabler,   r0   r"   is_nltk_availabler	    r   r0   c                      [         $ r   )_cosmos_guardrail_availabler,   r0   r"   is_cosmos_guardrail_availabler    r  r0   c                  &    [        S S 5       5      $ )Nc              3   `   #    U  H$  n[         R                  R                  U5      v   M&     g 7fr   )r2   r3   r4   )r    libs     r"   r#   #is_hpu_available.<locals>.<genexpr>  s$     i8hy~~'',,8hs   ,.)habana_frameworkszhabana_frameworks.torch)allr,   r0   r"   is_hpu_availabler    s    i8hiiir0   c                      [         $ r   )_sageattention_availabler,   r0   r"   is_sageattention_availabler    r   r0   c                      [         $ r   )_flash_attn_availabler,   r0   r"   is_flash_attn_availabler    r   r0   c                      [         $ r   )_flash_attn_3_availabler,   r0   r"   is_flash_attn_3_availabler    r   r0   c                      [         $ r   )_aiter_availabler,   r0   r"   is_aiter_availabler    r   r0   c                      [         $ r   )_kornia_availabler,   r0   r"   is_kornia_availabler"    r   r0   c                      [         $ r   )_av_availabler,   r0   r"   is_av_availabler%    s    r0   z
{0} requires the FLAX library but it was not found in your environment. Checkout the instructions on the
installation page: https://github.com/google/flax and follow the ones that match your environment.
z
{0} requires the inflect library but it was not found in your environment. You can install it with pip: `pip install
inflect`
z
{0} requires the PyTorch library but it was not found in your environment. Checkout the instructions on the
installation page: https://pytorch.org/get-started/locally/ and follow the ones that match your environment.
z
{0} requires the onnxruntime library but it was not found in your environment. You can install it with pip: `pip
install onnxruntime`
z
{0} requires the OpenCV library but it was not found in your environment. You can install it with pip: `pip
install opencv-python`
z{
{0} requires the scipy library but it was not found in your environment. You can install it with pip: `pip install
scipy`
z
{0} requires the librosa library but it was not found in your environment.  Checkout the instructions on the
installation page: https://librosa.org/doc/latest/install.html and follow the ones that match your environment.
z
{0} requires the transformers library but it was not found in your environment. You can install it with pip: `pip
install transformers`
z
{0} requires the unidecode library but it was not found in your environment. You can install it with pip: `pip install
Unidecode`
z
{0} requires the note-seq library but it was not found in your environment. You can install it with pip: `pip
install note-seq`
z{
{0} requires the wandb library but it was not found in your environment. You can install it with pip: `pip
install wandb`
z
{0} requires the tensorboard library but it was not found in your environment. You can install it with pip: `pip
install tensorboard`
z}
{0} requires the compel library but it was not found in your environment. You can install it with pip: `pip install compel`
z
{0} requires the Beautiful Soup library but it was not found in your environment. You can install it with pip:
`pip install beautifulsoup4`. Please note that you may need to restart your runtime after installation.
a8  
{0} requires the ftfy library but it was not found in your environment. Checkout the instructions on the
installation section: https://github.com/rspeer/python-ftfy/tree/master#installing and follow the ones
that match your environment. Please note that you may need to restart your runtime after installation.
z
{0} requires the torchsde library but it was not found in your environment. You can install it with pip: `pip install torchsde`
z
{0} requires the invisible-watermark library but it was not found in your environment. You can install it with pip: `pip install invisible-watermark>=0.2.0`
zy
{0} requires the peft library but it was not found in your environment. You can install it with pip: `pip install peft`
z
{0} requires the safetensors library but it was not found in your environment. You can install it with pip: `pip install safetensors`
z
{0} requires the sentencepiece library but it was not found in your environment. You can install it with pip: `pip install sentencepiece`
z
{0} requires the bitsandbytes library but it was not found in your environment. You can install it with pip: `pip install bitsandbytes`
z
{0} requires the imageio library and ffmpeg but it was not found in your environment. You can install it with pip: `pip install imageio imageio-ffmpeg`
zy
{0} requires the gguf library but it was not found in your environment. You can install it with pip: `pip install gguf`
z
{0} requires the torchao library but it was not found in your environment. You can install it with pip: `pip install
torchao`
z
{0} requires the optimum-quanto library but it was not found in your environment. You can install it with pip: `pip
install optimum-quanto`
z
{0} requires the pytorch_retinaface library but it was not found in your environment. You can install it with pip: `pip install pytorch_retinaface`
z
{0} requires the better_profanity library but it was not found in your environment. You can install it with pip: `pip install better_profanity`
zy
{0} requires the nltk library but it was not found in your environment. You can install it with pip: `pip install nltk`
onnxopencvinvisible_watermarkquantoc                    [        U[        [        45      (       d  U/n[        U S5      (       a  U R                  OU R
                  R                  nS U 5       nU VVs/ s H$  u  pEU" 5       (       a  M  UR                  U5      PM&     nnnU(       a  [        SR                  U5      5      eUS;   a   [        SS5      (       a  [        SU S35      eUS	;   a!  [        SS
5      (       a  [        SU S35      eg g s  snnf )N__name__c              3   4   #    U  H  n[         U   v   M     g 7fr   )BACKENDS_MAPPING)r    backends     r"   r#   $requires_backends.<locals>.<genexpr>r  s     @xGw'xs   r)   )%VersatileDiffusionTextToImagePipelineVersatileDiffusionPipeline$VersatileDiffusionDualGuidedPipeline%StableDiffusionImageVariationPipelineUnCLIPPipeliner   z4.25.0z9You need to install `transformers>=4.25` in order to use z/: 
```
 pip install --upgrade transformers 
```) StableDiffusionDepth2ImgPipeline"StableDiffusionPix2PixZeroPipelinez4.26.0z9You need to install `transformers>=4.26` in order to use )

isinstancer6   tuplehasattrr+  	__class__formatrH   joinis_transformers_version)objbackendsr-   checks	availablemsgfaileds          r"   requires_backendsrD  m  s   hu..:"3
333<<9O9OD@x@F5;OV>99;cjjVFO"''&/**   "#x
0
0Gv N, ,
 	

 YY^uX_ _ Gv N, ,
 	
_Y! Ps    C=6C=c                   ,   ^  \ rS rSrSrU 4S jrSrU =r$ )DummyObjecti  z
Metaclass for the dummy objects. Any class inheriting from it will return the ImportError generated by
`requires_backend` each time a user tries to access any method of that class.
c                    > UR                  S5      (       a  US;  a  [        TU ]	  X5      $ [        X R                  5        g )NrR   )_load_connected_pipes_is_onnx)r   super__getattr__rD  	_backends)clskeyr:  s     r"   rK  DummyObject.__getattr__  s6    >>#3.S#S7&s00#}}-r0   r,   )r+  
__module____qualname____firstlineno____doc__rK  __static_attributes____classcell__r:  s   @r"   rF  rF    s    
. .r0   rF  library_or_version	operationrequirement_versionc                 (   U[         R                  5       ;  a,  [        S[        [         R                  5       5       SU 35      e[         U   n[	        U [
        5      (       a  [        [        R                  " U 5      5      n U" U [        U5      5      $ )ay  
Compares a library version to some requirement using a given operation.

Args:
    library_or_version (`str` or `packaging.version.Version`):
        A library name or a version to check.
    operation (`str`):
        A string representation of an operator, such as `">"` or `"<="`.
    requirement_version (`str`):
        The version to compare the library version against
z`operation` must be one of z, received )	STR_OPERATION_TO_FUNCkeys
ValueErrorr6   r7  strr   r7   rF   )rW  rX  rY  s      r"   compare_versionsr_    s     -22446t<Q<V<V<X7Y6ZZefoepqrr%i0I$c**"#5#=#=>P#QR'/B)CDDr0   rF   c                 4    [        [        [        5      X5      $ )z
Compares the current PyTorch version to a given reference with an operation.

Args:
    operation (`str`):
        A string representation of an operator, such as `">"` or `"<="`
    version (`str`):
        A string version of PyTorch
)r_  r   _torch_versionrX  rF   s     r"   is_torch_versionrc    s     E.19FFr0   c                 L    [         (       d  g[        [        [        5      X5      $ )z
Compares the current torch_xla version to a given reference with an operation.

Args:
    operation (`str`):
        A string representation of an operator, such as `">"` or `"<="`
    version (`str`):
        A string version of torch_xla
F)r   r_  r   _torch_xla_versionrb  s     r"   is_torch_xla_versionrf    s      "!E"45yJJr0   c                 L    [         (       d  g[        [        [        5      X5      $ )z
Compares the current Transformers version to a given reference with an operation.

Args:
    operation (`str`):
        A string representation of an operator, such as `">"` or `"<="`
    version (`str`):
        A version string
F)r   r_  r   _transformers_versionrb  s     r"   r=  r=    s      #"E"78)MMr0   c                 L    [         (       d  g[        [        [        5      X5      $ )z
Compares the current Kernels version to a given reference with an operation.

Args:
    operation (`str`):
        A string representation of an operator, such as `">"` or `"<="`
    version (`str`):
        A version string
F)r   r_  r   _kernels_versionrb  s     r"   is_kernels_versionrk          E"23YHHr0   c                 L    [         (       d  g[        [        [        5      X5      $ )z
Compares the current Hugging Face Hub version to a given reference with an operation.

Args:
    operation (`str`):
        A string representation of an operator, such as `">"` or `"<="`
    version (`str`):
        A version string
F)_hf_hub_availabler_  r   _hf_hub_versionrb  s     r"   is_hf_hub_versionrp    s     E/2IGGr0   c                 L    [         (       d  g[        [        [        5      X5      $ z
Compares the current Accelerate version to a given reference with an operation.

Args:
    operation (`str`):
        A string representation of an operator, such as `">"` or `"<="`
    version (`str`):
        A version string
F)r   r_  r   _accelerate_versionrb  s     r"   is_accelerate_versionrt          ! E"56	KKr0   c                 L    [         (       d  g[        [        [        5      X5      $ )z
Compares the current PEFT version to a given reference with an operation.

Args:
    operation (`str`):
        A string representation of an operator, such as `">"` or `"<="`
    version (`str`):
        A version string
F)r   r_  r   _peft_versionrb  s     r"   is_peft_versionrx         ?E-0)EEr0   c                 L    [         (       d  g[        [        [        5      X5      $ )z
Args:
Compares the current bitsandbytes version to a given reference with an operation.
    operation (`str`):
        A string representation of an operator, such as `">"` or `"<="`
    version (`str`):
        A version string
F)r   r_  r   _bitsandbytes_versionrb  s     r"   is_bitsandbytes_versionr|    s      #"E"78)MMr0   c                 L    [         (       d  g[        [        [        5      X5      $ rr  )r   r_  r   _gguf_versionrb  s     r"   is_gguf_versionr  +  ry  r0   c                 L    [         (       d  g[        [        [        5      X5      $ )z
Compares the current torchao version to a given reference with an operation.

Args:
    operation (`str`):
        A string representation of an operator, such as `">"` or `"<="`
    version (`str`):
        A version string
F)r   r_  r   _torchao_versionrb  s     r"   is_torchao_versionr  ;  rl  r0   c                 L    [         (       d  g[        [        [        5      X5      $ rr  )r   r_  r   _optimum_quanto_versionrb  s     r"   is_optimum_quanto_versionr  K  s      %$E"9:IOOr0   c                 L    [         (       d  g[        [        [        5      X5      $ )z
Compares the current Nvidia ModelOpt version to a given reference with an operation.

Args:
    operation (`str`):
        A string representation of an operator, such as `">"` or `"<="`
    version (`str`):
        A version string
F)r   r_  r   _nvidia_modelopt_versionrb  s     r"   is_nvidia_modelopt_versionr  [  s      &%E":;YPPr0   c                 L    [         (       d  g[        [        [        5      X5      $ )z
Compares the current xformers version to a given reference with an operation.

Args:
    operation (`str`):
        A string representation of an operator, such as `">"` or `"<="`
    version (`str`):
        A version string
F)r   r_  r   _xformers_versionrb  s     r"   is_xformers_versionr  k  s      E"34iIIr0   c                 L    [         (       d  g[        [        [        5      X5      $ )z
Compares the current sageattention version to a given reference with an operation.

Args:
    operation (`str`):
        A string representation of an operator, such as `">"` or `"<="`
    version (`str`):
        A version string
F)r  r_  r   _sageattention_versionrb  s     r"   is_sageattention_versionr  {  s      $#E"899NNr0   c                 L    [         (       d  g[        [        [        5      X5      $ )z
Compares the current flash-attention version to a given reference with an operation.

Args:
    operation (`str`):
        A string representation of an operator, such as `">"` or `"<="`
    version (`str`):
        A version string
F)r  r_  r   _flash_attn_versionrb  s     r"   is_flash_attn_versionr    ru  r0   c                 L    [         (       d  g[        [        [        5      X5      $ )z
Compares the current aiter version to a given reference with an operation.

Args:
    operation (`str`):
        A string representation of an operator, such as `">"` or `"<="`
    version (`str`):
        A version string
F)r  r_  r   _aiter_versionrb  s     r"   is_aiter_versionr    s     E.19FFr0   c                 x    0 n[        U 5       H(  nUR                  S5      (       a  M  [        X5      X'   M*     U$ )z
Returns a dict of object names and values in a module, while skipping private/internal objects

Args:
    module (ModuleType):
        Module to extract the objects from.

Returns:
    dict: Dictionary of object names and corresponding values
rR   )dirr   getattr)moduleobjectsr-   s      r"   get_objects_from_moduler    s<     GF??3- 
 Nr0   c                       \ rS rSrSrSrg)OptionalDependencyNotAvailablei  z`
An error indicating that an optional dependency of Diffusers was not found in the environment.
r,   N)r+  rP  rQ  rR  rS  rT  r,   r0   r"   r  r    s    r0   r  c                   b   ^  \ rS rSrSrSU 4S jjrU 4S jrS\S\4S jr	S\4S	 jr
S
 rSrU =r$ )_LazyModulei  zm
Module class that surfaces all objects but only performs associated imports when the objects are requested.
c                   > [         T	U ]  U5        [        UR                  5       5      U l        0 U l        UR                  5        H  u  pgU H  nX`R
                  U'   M     M     [        UR                  5       5      [        [        UR                  5       6 5      -   U l
        X l        X@l        [        R                  R                  U5      /U l        Uc  0 OUU l        Xl        X0l        g r   )rJ  __init__setr\  _modules_class_to_moduleitemsr6   r   values__all____file____spec__ospathdirname__path___objects_name_import_structure)
selfr-   module_fileimport_structuremodule_specextra_objectsrN  r  valuer:  s
            r"   r  _LazyModule.__init__  s    ,1134 "+113KC/2%%e,   4 ,1134tECSCZCZC\<]7^^##56+3
!1r0   c                 z   > [         TU ]  5       nU R                   H  nX!;  d  M
  UR                  U5        M     U$ r   )rJ  __dir__r  rA   )r  resultattrr:  s      r"   r  _LazyModule.__dir__  s8    " LLD!d# ! r0   r-   r&   c                 `   XR                   ;   a  U R                   U   $ XR                  ;   a  U R                  U5      nObXR                  R	                  5       ;   a*  U R                  U R                  U   5      n[        X15      nO[        SU R                   SU 35      e[        XU5        U$ )Nzmodule z has no attribute )	r  r  _get_moduler  r\  r  AttributeErrorr+  setattr)r  r-   r  r  s       r"   rK  _LazyModule.__getattr__  s    == ==&&== $$T*E**//11%%d&;&;D&ABFF)E 74==/9KD6!RSSE"r0   module_namec           	           [         R                  " SU-   U R                  5      $ ! [         a$  n[	        SU R                   SU SU 35      UeS nAff = f)Nr+   zFailed to import z@ because of the following error (look up to see its traceback):
)r2   import_moduler+  rC   RuntimeError)r  r  es      r"   r  _LazyModule._get_module  sf    	**3+<dmmLL 	#DMM?!K= A!!"% 	s   #& 
AAAc                 `    U R                   U R                  U R                  U R                  44$ r   )r:  r  r  r  )r  s    r"   
__reduce___LazyModule.__reduce__  s&    T]]D<R<R STTr0   )	r  r  r  r  r  r  r  r  r  )NN)r+  rP  rQ  rR  rS  r  r  r^  r   rK  r  r  rT  rU  rV  s   @r"   r  r    s=    2"  s U Ur0   r  )F(
  rS  importlib.utilr2   r>   operatoropr  syscollectionsr   r   	functoolsr   cache	itertoolsr   typesr   typingr   huggingface_hub.utilsr	   packaging.versionr
   r   r)   r   version_infor7   importlib.metadatarB   packages_distributionsr5   rC   
get_loggerr+  rD   ENV_VARS_TRUE_VALUESunionENV_VARS_TRUE_AND_AUTO_VALUESenvirongetupperr   r   USE_JAXr   r   gtgeeqneleltr[  modulesanyr   r^  boolr8  rS   r   ra  info_jax_version_flax_versionr3   r4   r   rF   rI   r   _safetensors_version_onnxruntime_versionr   
candidatesrQ   rG   _opencv_versionr   r   _bs4_versionr   _invisible_watermark_versionr   re  r   _torch_npu_versionr   _torch_mlu_versionr   rh  rn  ro  r   rj  r   _inflect_versionr   _unidecode_versionr   _note_seq_versionr   _wandb_versionr   _tensorboard_versionr   _compel_versionr   _sentencepiece_versionr   _torchsde_versionr   rw  r   _torchvision_versionr   _matplotlib_versionr   _timm_versionr   r{  r   _imageio_versionr   _ftfy_versionr   _scipy_versionr   _librosa_versionr   rs  r   r  r   r~  r   r  r   r  r  _pytorch_retinaface_versionr  _better_profanity_versionr  _nltk_versionr  _cosmos_guardrail_versionr  r  r  r  r  _flash_attn_3_versionr  r  r!  _kornia_versionr   r  r   _flashpack_versionr$  _av_versionr   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r  r  r	  r  r  r  r  r  r  r"  r%  FLAX_IMPORT_ERRORINFLECT_IMPORT_ERRORPYTORCH_IMPORT_ERRORONNX_IMPORT_ERROROPENCV_IMPORT_ERRORSCIPY_IMPORT_ERRORLIBROSA_IMPORT_ERRORTRANSFORMERS_IMPORT_ERRORUNIDECODE_IMPORT_ERRORNOTE_SEQ_IMPORT_ERRORWANDB_IMPORT_ERRORTENSORBOARD_IMPORT_ERRORCOMPEL_IMPORT_ERRORBS4_IMPORT_ERRORFTFY_IMPORT_ERRORTORCHSDE_IMPORT_ERROR INVISIBLE_WATERMARK_IMPORT_ERRORPEFT_IMPORT_ERRORSAFETENSORS_IMPORT_ERRORSENTENCEPIECE_IMPORT_ERRORBITSANDBYTES_IMPORT_ERRORIMAGEIO_IMPORT_ERRORGGUF_IMPORT_ERRORTORCHAO_IMPORT_ERRORQUANTO_IMPORT_ERRORPYTORCH_RETINAFACE_IMPORT_ERRORBETTER_PROFANITY_IMPORT_ERRORNLTK_IMPORT_ERRORr-  rD  typerF  r_  rc  rf  r=  rk  rp  rt  rx  r|  r  r  r  r  r  r  r  r  r  BaseExceptionr  r  r,   r0   r"   <module>r*     s      	 
 0 (    4 ,  f3%<<>L 
		H	%1  4 : :F8 D 	&	)	/	/	1JJNN;/557	
**..V
,
2
2
4**..!2F;AAC

'>HNNP -1EE  ee255RUURTRWRW^`^c^cd !S[[0cC7cXZXbXb7c4c !#C !# !#tUXyIY !#H --&@T2T'<W'E$n KK<=N
++nn..u5TArinnF^F^_eFfnrFrO	$-55e<L.66v>MKK,|nOM?R]^_	  O333H3W00 KKFG" ..**=9EJ  	#5#=#=c#B   +$6OABVAWXYJ O	088=O  (t39/9JKL ))%0<%--.>?L
LL6|nEF "+!9!9-!HPT!T +#5#=#=>S#T 
LLEFbEcde ,A+M ( (+@+M ( (+@+M ( (1F~1V . .%:;L%M " ?'<Y'G $ $'<Y'G $ $+@+M ( ()>z)J & &#8#A   ./D]/S , ,%:8%D " ?3H3Y 0 0)>z)J & &!6v!> /D]/S , ,-B<-P * *!6v!> 1F~1V . .'<Y'G $ $!6v!> #8#A   .'<Y'G $ $-B<-P * *)>z)J & &!6v!> '<Y'G $ $1F~1V . .5J9dh5i 2 2=RSg=h : :9NOa9b 6 6!6v!> 9NOa9b 6 63H3Y 0 0-B<-P * *1F~1V . .#8PT#U   .%:8%D " ?7LZgk7l 4 4+@+M ( (248 {   # !"*"!"#$ %&)''j$!#
             
   
$  
 
 
  
 
  
 # 
! 
 
 	!#345	#%678	)+?@A	#%678	')<=>	%'9:;	%';<=	35NOP	-/EFG	)+?@A	+-BCD	%'9:;	13KLM	')<=>	#%678	+-BCD	!ACc de	#%678	13KLM	35NOP	57QRS	)+?@A	#%678	)+?@A	/1DEF	 ?A`ab	;=Z[\	#%6789 D
>	.$ 	.Ew E3 E]` E* 
G 
Gc 
G 
G KC K# K K Ns NS N N I# I I I H Hs H H LS L3 L L Fs FS F F Ns NS N N Fs FS F F I# I I I P Ps P P Q# Q Q Q J3 J J J O Oc O O LS L3 L L G Gc G G*] 9U* 9Uy  LR "66 	$#O	$F "66 		( "66 		
 ..  .. N .. +%*"+s   'a =<a a3	b# b$#b# %&b< )&c aaa0/a03bbb b# b  b# #b98b9<ccc+*c+