
    +h              !          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JrJr  SSKJr  SSKJrJr  S	S
KJr  \R4                  S:  a  SSKrOSSKJr   \R<                  " 5       q\RB                  " \"5      r#1 Skr$\$RK                  S15      r&\RN                  RQ                  SS5      RS                  5       r*\RN                  RQ                  SS5      RS                  5       r+\RN                  RQ                  SS5      RS                  5       r,\RN                  RQ                  SS5      RS                  5       r-\RN                  RQ                  SS5      RS                  5       r.\.\$;   r.\R^                  \R`                  \Rb                  \Rd                  \Rf                  \Rh                  S.r5S\Rl                  ;   =(       d    \7" S \RN                   5       5      r8SS\9S\:S\\:\94   4S jjr;\+\&;   a  \*\$;  a  \;" S5      u  r<r=O\#R}                  S5        Sr<Sr=Sr?Sr@\,\&;   a  \R                  R                  S5      SL=(       a    \R                  R                  S 5      SLrC\C(       a>   \R                  " S5      r?\R                  " S 5      r@\#R}                  S!\? S"\@ S#35        OOSrC\-\&;   a  \;" S$5      u  rFrGO\#R}                  S%5        SrFSrH\R                  R                  S&5      SLrI\I(       a?  S'rJSrH\J H  rK \R                  " \K5      rH  O   \HSLrI\I(       a  \#R                  S(\H 35         S)rJSrM\J H  rK \R                  " \K5      rM  O   \MSLrN\N(       a  \#R                  S*\M 35        \R                  R                  S+5      SLrO \R                  " S,5      rP\#R                  S-\P 35        \R                  R                  S.5      SLrQ \R                  " S/5      rR\#R                  S0\R 35        \;" S15      u  rSrT\;" 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\;" SC5      u  rwrx\;" SLSMSN9u  rr\;" SO5      u  rr\;" SP5      u  rr\;" SQ5      u  rr\;" SR5      u  rr\;" SS5      u  rr\;" ST5      u  rr\;" SU5      u  rr\;" SV5      u  rrSW rSX rSY rSZ rS[ rS\ 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 rSrSrSrSrSrSrSrSrSrSrSrSrSrSrSrSrSrSrSrSrSrSrSrSrSrSrSrSrSr\	" S+\\44S \\44S6\\44S\\44S\\44SF\\44S\\44S3\\44S7\\44SG\\44S8\\44S9\\44S:\\44S;\\44S<\\44SE\\44S>\\44S\\44S?\\44S$\\44SC\\44S=\\44SD\\44SJ\\44SK\\44S\\44SO\\44SP\\44SQ\\44/5      rS r " S S\5      rS\\9\4   S\9S\94S jrS\9S\94S jrS\9S\94S jrS\9S\94S jrS\9S\94S jrS\9S\94S jrS\9S\94S jrS\9S\94S jrS\9S\94S jrS\9S\94S jrS\9S\94S jrS\9S\94S jrS\9S\94S jrS\9S\94S jrS\9S\94S jrS r " S S\5      r " S S\5      rg! \  a    Sq GNEf = f! \R                   a    SrC GNf = f! \R                   a     GM  f = f! \R                   a     GM  f = f! \R                   a    SrN GNf = f! \R                   a    SrO GNmf = f! \R                   a    SrQ GNBf = f)zD
Import utilities: Utilities related to imports and our lazy inits.
    N)OrderedDictdefaultdict)chain)
ModuleType)AnyTupleUnion)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/james-whalen/.local/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>L   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_infered_opt_names_top_level_inferredpkg_s              r#   _is_package_availablerT   =   s   ))(34?JK&t,L.<<>D+/>>/+J+Pb*W*W*Y'_c_i_i_omo_o*_oYZc!''lQ&6
G<Q<QRS<TT_o**& +11MOa*b'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.safetensorsz+Disabling Safetensors because USE_TF is setonnxruntime)rY   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transformershuggingface_hubkernelsinflect	unidecodek_diffusion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korniac                      [         $ N)_torch_availabler-   r1   r#   is_torch_availabler          r1   c                      [         $ r   )_torch_xla_availabler-   r1   r#   is_torch_xla_availabler          r1   c                      [         $ r   )_torch_npu_availabler-   r1   r#   is_torch_npu_availabler      r   r1   c                      [         $ r   )_flax_availabler-   r1   r#   is_flax_availabler          r1   c                      [         $ r   )_transformers_availabler-   r1   r#   is_transformers_availabler          ""r1   c                      [         $ r   )_inflect_availabler-   r1   r#   is_inflect_availabler          r1   c                      [         $ r   )_unidecode_availabler-   r1   r#   is_unidecode_availabler      r   r1   c                      [         $ r   )_onnx_availabler-   r1   r#   is_onnx_availabler     r   r1   c                      [         $ r   )_opencv_availabler-   r1   r#   is_opencv_availabler         r1   c                      [         $ r   )_scipy_availabler-   r1   r#   is_scipy_availabler   
  r   r1   c                      [         $ r   )_librosa_availabler-   r1   r#   is_librosa_availabler     r   r1   c                      [         $ r   )_xformers_availabler-   r1   r#   is_xformers_availabler         r1   c                      [         $ r   )_accelerate_availabler-   r1   r#   is_accelerate_availabler           r1   c                      [         $ r   )_kernels_availabler-   r1   r#   is_kernels_availabler     r   r1   c                      [         $ r   )_k_diffusion_availabler-   r1   r#   is_k_diffusion_availabler         !!r1   c                      [         $ r   )_note_seq_availabler-   r1   r#   is_note_seq_availabler   "  r   r1   c                      [         $ r   )_wandb_availabler-   r1   r#   is_wandb_availabler   &  r   r1   c                      [         $ r   )_tensorboard_availabler-   r1   r#   is_tensorboard_availabler   *  r   r1   c                      [         $ r   )_compel_availabler-   r1   r#   is_compel_availabler   .  r   r1   c                      [         $ r   )_ftfy_availabler-   r1   r#   is_ftfy_availabler   2  r   r1   c                      [         $ r   )_bs4_availabler-   r1   r#   is_bs4_availabler   6  s    r1   c                      [         $ r   )_torchsde_availabler-   r1   r#   is_torchsde_availabler   :  r   r1   c                      [         $ r   )_invisible_watermark_availabler-   r1   r#    is_invisible_watermark_availabler   >  s    ))r1   c                      [         $ r   )_peft_availabler-   r1   r#   is_peft_availabler   B  r   r1   c                      [         $ r   )_torchvision_availabler-   r1   r#   is_torchvision_availabler   F  r   r1   c                      [         $ r   )_matplotlib_availabler-   r1   r#   is_matplotlib_availabler   J  r   r1   c                      [         $ r   )_safetensors_availabler-   r1   r#   is_safetensors_availabler   N  r   r1   c                      [         $ r   )_bitsandbytes_availabler-   r1   r#   is_bitsandbytes_availabler   R  r   r1   c                      [         $ r   )_is_google_colabr-   r1   r#   is_google_colabr   V  r   r1   c                      [         $ r   )_sentencepiece_availabler-   r1   r#   is_sentencepiece_availabler   Z      ##r1   c                      [         $ r   )_imageio_availabler-   r1   r#   is_imageio_availabler   ^  r   r1   c                      [         $ r   )_gguf_availabler-   r1   r#   is_gguf_availabler   b  r   r1   c                      [         $ r   )_torchao_availabler-   r1   r#   is_torchao_availabler   f  r   r1   c                      [         $ r   )_optimum_quanto_availabler-   r1   r#   is_optimum_quanto_availabler   j  s    $$r1   c                      [         $ r   )_timm_availabler-   r1   r#   is_timm_availabler   n  r   r1   c                      [         $ r   )_pytorch_retinaface_availabler-   r1   r#   is_pytorch_retinaface_availabler   r  s    ((r1   c                      [         $ r   )_better_profanity_availabler-   r1   r#   is_better_profanity_availabler   v      &&r1   c                      [         $ r   )_nltk_availabler-   r1   r#   is_nltk_availabler   z  r   r1   c                      [         $ r   )_cosmos_guardrail_availabler-   r1   r#   is_cosmos_guardrail_availabler  ~  r   r1   c                  &    [        S S 5       5      $ )Nc              3   `   #    U  H$  n[         R                  R                  U5      v   M&     g 7fr   )r3   r4   r5   )r!   libs     r#   r$   #is_hpu_available.<locals>.<genexpr>  s$     i8hy~~'',,8hs   ,.)habana_frameworkszhabana_frameworks.torch)allr-   r1   r#   is_hpu_availabler
    s    i8hiiir1   c                      [         $ r   )_sageattention_availabler-   r1   r#   is_sageattention_availabler    r   r1   c                      [         $ r   )_flash_attn_availabler-   r1   r#   is_flash_attn_availabler    r   r1   c                      [         $ r   )_flash_attn_3_availabler-   r1   r#   is_flash_attn_3_availabler    r   r1   c                      [         $ r   )_kornia_availabler-   r1   r#   is_kornia_availabler    r   r1   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 k-diffusion library but it was not found in your environment. You can install it with pip: `pip
install k-diffusion`
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>b  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 )

isinstancer7   tuplehasattrr  	__class__formatrI   joinis_transformers_version)objbackendsr.   checks	availablemsgfaileds          r#   requires_backendsr5  ]  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 )NrS   )_load_connected_pipes_is_onnx)r    super__getattr__r5  	_backends)clskeyr+  s     r#   r<  DummyObject.__getattr__  s6    >>#3.S#S7&s00#}}-r1   r-   )r  
__module____qualname____firstlineno____doc__r<  __static_attributes____classcell__r+  s   @r#   r7  r7  |  s    
. .r1   r7  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
ValueErrorr7   r(  strr   r8   rG   )rH  rI  rJ  s      r#   compare_versionsrP    s     -22446t<Q<V<V<X7Y6ZZefoepqrr%i0I$c**"#5#=#=>P#QR'/B)CDDr1   rG   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
)rP  r   _torch_versionrI  rG   s     r#   is_torch_versionrT    s     E.19FFr1   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   rP  r   _torch_xla_versionrS  s     r#   is_torch_xla_versionrW    s      "!E"45yJJr1   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   rP  r   _transformers_versionrS  s     r#   r.  r.    s      #"E"78)MMr1   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_availablerP  r   _hf_hub_versionrS  s     r#   is_hf_hub_versionr]    s     E/2IGGr1   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   rP  r   _accelerate_versionrS  s     r#   is_accelerate_versionra          ! E"56	KKr1   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   rP  r   _peft_versionrS  s     r#   is_peft_versionre         ?E-0)EEr1   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   rP  r   _bitsandbytes_versionrS  s     r#   is_bitsandbytes_versionri    s      #"E"78)MMr1   c                 L    [         (       d  g[        [        [        5      X5      $ r_  )r   rP  r   _gguf_versionrS  s     r#   is_gguf_versionrl    rf  r1   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   rP  r   _torchao_versionrS  s     r#   is_torchao_versionro    s      E"23YHHr1   c                 L    [         (       d  g[        [        [        5      X5      $ )z
Compares the current k-diffusion 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   rP  r   _k_diffusion_versionrS  s     r#   is_k_diffusion_versionrr  "  s      "!E"67LLr1   c                 L    [         (       d  g[        [        [        5      X5      $ r_  )r   rP  r   _optimum_quanto_versionrS  s     r#   is_optimum_quanto_versionru  1  s      %$E"9:IOOr1   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   rP  r   _xformers_versionrS  s     r#   is_xformers_versionrx  @  s      E"34iIIr1   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  rP  r   _sageattention_versionrS  s     r#   is_sageattention_versionr{  O  s      $#E"899NNr1   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  rP  r   _flash_attn_versionrS  s     r#   is_flash_attn_versionr~  ^  rb  r1   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
rS   )dirr    getattr)moduleobjectsr.   s      r#   get_objects_from_moduler  m  s<     GF??3- 
 Nr1   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  rA  rB  rC  rD  rE  r-   r1   r#   r  r    s    r1   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   )r;  __init__setrM  _modules_class_to_moduleitemsr7   r   values__all____file____spec__ospathdirname__path___objects_name_import_structure)
selfr.   module_fileimport_structuremodule_specextra_objectsr?  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r1   c                 z   > [         TU ]  5       nU R                   H  nX!;  d  M
  UR                  U5        M     U$ r   )r;  __dir__r  rB   )r  resultattrr+  s      r#   r  _LazyModule.__dir__  s8    " LLD!d# ! r1   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  rM  r  AttributeErrorr  setattr)r  r.   r  r  s       r#   r<  _LazyModule.__getattr__  s    == ==&&== $$T*E**//11%%d&;&;D&ABFF)E 74==/9KD6!RSSE"r1   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):
)r3   import_moduler  rD   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Tr1   )	r  r  r  r  r  r  r  r  r  )NN)r  rA  rB  rC  rD  r  r  rO  r   r<  r  r  rE  rF  rG  s   @r#   r  r    s=    2"  s U Ur1   r  )F)rD  importlib.utilr3   r?   operatoropr  syscollectionsr   r   	itertoolsr   typesr   typingr   r   r	   huggingface_hub.utilsr
   packaging.versionr   r   r*   r   version_infor8   importlib.metadatarC   packages_distributionsr6   rD   
get_loggerr  rE   ENV_VARS_TRUE_VALUESunionENV_VARS_TRUE_AND_AUTO_VALUESenvirongetupperr   r   USE_JAXr   r   gtgeeqneleltrL  modulesanyr   rO  boolrT   r   rR  info_jax_version_flax_versionr4   r5   r   rG   rJ   r   _safetensors_version_onnxruntime_versionr   
candidatesrR   rH   _opencv_versionr   r   _bs4_versionr   _invisible_watermark_versionr   rV  r   _torch_npu_versionr   rY  r[  r\  r   _kernels_versionr   _inflect_versionr   _unidecode_versionr   rq  r   _note_seq_versionr   _wandb_versionr   _tensorboard_versionr   _compel_versionr   _sentencepiece_versionr   _torchsde_versionr   rd  r   _torchvision_versionr   _matplotlib_versionr   _timm_versionr   rh  r   _imageio_versionr   _ftfy_versionr   _scipy_versionr   _librosa_versionr   r`  r   rw  r   rk  r   rn  r   rt  r   _pytorch_retinaface_versionr   _better_profanity_versionr   _nltk_versionr  _cosmos_guardrail_versionr  rz  r  r}  r  _flash_attn_3_versionr  _kornia_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  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K_DIFFUSION_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  r5  typer7  rP  rT  rW  r.  r]  ra  re  ri  rl  ro  rr  ru  rx  r{  r~  r  BaseExceptionr  r  r-   r1   r#   <module>r     sH      	 
 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  #F --&@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=>" ..**=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 ( (1F~1V . .%:;L%M " ?'<Y'G $ $'<Y'G $ $+@+M ( (/D]/S , ,)>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%D " ?  # !""*"!"#$%)''j$!#
              
   
$  
 
 
  
 
  
 # 
! 
 
 	!#345	#%678	)+?@A	#%678	')<=>	%'9:;	%';<=	35NOP	-/EFG	)+?@A	13KLM	+-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8;  F
>	.$ 	.EsG|)< E Ecf E*
G 
Gc 
GKC K# KNs NS NH Hs HLS L3 LFs FS FNs NS NFs FS FI# I IMc MC MP Ps PJ3 J JO Oc OLS L3 L*] 9U* 9U  LP "66 	$#O	$F "66 		( "66 		
 ..  .. N .. +%*"+s   %^0 ;<^? _	` _0"#` #&`! '&`: 0^<;^<?___-,_-0` ` `` ``!`76`7:aa