
    +h*w                     ,   S SK r S SKJrJrJrJrJ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  SSKJr  SS	KJrJrJrJr  SS
KJr  SSKJrJr  \" 5       (       a  S SK J!s  J"r#  Sr$OSr$\RJ                  " \&5      r'Sr( " S S\\5      r)g)    N)CallableDictListOptionalUnion)T5EncoderModelT5Tokenizer   )VaeImageProcessor)StableDiffusionLoraLoaderMixin)Kandinsky3UNetVQModel)DDPMScheduler)	deprecateis_torch_xla_availableloggingreplace_example_docstring)randn_tensor   )DiffusionPipelineImagePipelineOutputTFa?  
    Examples:
        ```py
        >>> from diffusers import AutoPipelineForImage2Image
        >>> from diffusers.utils import load_image
        >>> import torch

        >>> pipe = AutoPipelineForImage2Image.from_pretrained(
        ...     "kandinsky-community/kandinsky-3", variant="fp16", torch_dtype=torch.float16
        ... )
        >>> pipe.enable_model_cpu_offload()

        >>> prompt = "A painting of the inside of a subway train with tiny raccoons."
        >>> image = load_image(
        ...     "https://huggingface.co/datasets/hf-internal-testing/diffusers-images/resolve/main/kandinsky3/t2i.png"
        ... )

        >>> generator = torch.Generator(device="cpu").manual_seed(0)
        >>> image = pipe(prompt, image=image, strength=0.75, num_inference_steps=25, generator=generator).images[0]
        ```
c            %         ^  \ rS rSrSr/ SQrS\S\S\S\	S\
4
U 4S	 jjrS
 rS r\R                  " 5                S-S\\R"                     S\\R"                     S\\R"                     S\\R"                     4S jj5       rS.S jrS r      S/S jr\S 5       r\S 5       r\S 5       r\R                  " 5       \" \5      SSSSSSSSSSSSSSSS/4S\\\\   4   S \\R"                  \R@                  R@                  \\R"                     \\R@                  R@                     4   S!\!S"\"S#\!S$\\\\\   4      S%\\"   S&\\\RF                  \\RF                     4      S\\R"                     S\\R"                     S\\R"                     S\\R"                     S'\\   S(\$S)\\%\"\"\&/S4      S*\\   4 S+ jj5       5       r'S,r(U =r)$ )0Kandinsky3Img2ImgPipeline8   ztext_encoder->movq->unet->movq)latentsprompt_embedsnegative_prompt_embedsnegative_attention_maskattention_mask	tokenizertext_encoderunet	schedulermovqc                 T  > [         TU ]  5         U R                  XX4US9  [        U SS 5      (       a/  S[	        U R
                  R                  R                  5      S-
  -  OSn[        U SS 5      (       a   U R
                  R                  R                  OSn[        UUSSS9U l
        g )	N)r    r!   r"   r#   r$   r$   r            bicubic)vae_scale_factorvae_latent_channelsresamplereducing_gap)super__init__register_modulesgetattrlenr$   configblock_out_channelslatent_channelsr   image_processor)	selfr    r!   r"   r#   r$   movq_scale_factormovq_latent_channels	__class__s	           t/home/james-whalen/.local/lib/python3.13/site-packages/diffusers/pipelines/kandinsky3/pipeline_kandinsky3_img2img.pyr/   "Kandinsky3Img2ImgPipeline.__init__B   s     	ae 	 	
 T[[_agimSnSnA#dii&6&6&I&I"JQ"NOtuCJ4QWY]C^C^tyy//??de0. 4	 
    c                     [        [        X-  5      U5      n[        X-
  S5      nU R                  R                  US  nXaU-
  4$ )Nr   )minintmaxr#   	timesteps)r7   num_inference_stepsstrengthdeviceinit_timestept_startrB   s          r;   get_timesteps'Kandinsky3Img2ImgPipeline.get_timestepsX   sL    C 3 >?ATU)91=NN,,WX6	777r=   c                     U(       aX  [         R                  " XS:H     5      XS:H  '   UR                  S5      R                  5       S-   nUS S 2S U24   nUS S 2S U24   nX4$ )Nr   r&   )torch
zeros_likesumrA   )r7   
embeddingsr   cut_contextmax_seq_lengths        r;   _process_embeds)Kandinsky3Img2ImgPipeline._process_embedsa   ss    .3.>.>z\]J]?^._J*++//3779A=N#A$67J+A,>?N))r=   Tr&   Nr   r   r   r   c                    Ub>  Ub;  [        U5      [        U5      La$  [        S[        U5       S[        U5       S35      eUc  U R                  nUb  [        U[        5      (       a  SnO3Ub!  [        U[
        5      (       a  [        U5      nOUR                  S   nSnUc  U R                  USUS	S
S9nUR                  R                  U5      nUR                  R                  U5      n	U R                  UU	S9nUS   nU R                  XiU5      u  piXiR                  S5      -  nU R                  b  U R                  R                  nOSnUR                  XS9nUR                  u  nnnUR!                  SUS5      nUR#                  UU-  US5      nU	R!                  US5      n	U(       Ga+  UGc'  Uc  S/U-  nOK[        U[        5      (       a  U/nO2U[        U5      :w  a!  [%        SU S[        U5       SU SU S3	5      eUnUb  U R                  USSS	S	S
S9nUR                  R                  U5      nUR                  R                  U5      n
U R                  UU
S9nUS   nUSS2SUR                  S   24   nU
SS2SUR                  S   24   n
XzR                  S5      -  nO,[&        R(                  " U5      n[&        R(                  " U	5      n
U(       as  UR                  S   nUR                  XS9nUR                  UR                  :w  a:  UR!                  SUS5      nUR#                  X-  US5      nU
R!                  US5      n
OSnSn
XgX4$ )a  
Encodes the prompt into text encoder hidden states.

Args:
     prompt (`str` or `List[str]`, *optional*):
        prompt to be encoded
    device: (`torch.device`, *optional*):
        torch device to place the resulting embeddings on
    num_images_per_prompt (`int`, *optional*, defaults to 1):
        number of images that should be generated per prompt
    do_classifier_free_guidance (`bool`, *optional*, defaults to `True`):
        whether to use classifier free guidance or not
    negative_prompt (`str` or `List[str]`, *optional*):
        The prompt or prompts not to guide the image generation. If not defined, one has to pass
        `negative_prompt_embeds`. instead. If not defined, one has to pass `negative_prompt_embeds`. instead.
        Ignored when not using guidance (i.e., ignored if `guidance_scale` is less than `1`).
    prompt_embeds (`torch.Tensor`, *optional*):
        Pre-generated text embeddings. Can be used to easily tweak text inputs, *e.g.* prompt weighting. If not
        provided, text embeddings will be generated from `prompt` input argument.
    negative_prompt_embeds (`torch.Tensor`, *optional*):
        Pre-generated negative text embeddings. Can be used to easily tweak text inputs, *e.g.* prompt
        weighting. If not provided, negative_prompt_embeds will be generated from `negative_prompt` input
        argument.
    attention_mask (`torch.Tensor`, *optional*):
        Pre-generated attention mask. Must provide if passing `prompt_embeds` directly.
    negative_attention_mask (`torch.Tensor`, *optional*):
        Pre-generated negative attention mask. Must provide if passing `negative_prompt_embeds` directly.
Nz?`negative_prompt` should be the same type to `prompt`, but got z != .r&   r      
max_lengthTpt)paddingrW   
truncationreturn_tensors)r   r   dtyperE   rK    z`negative_prompt`: z has batch size z, but `prompt`: zT. Please make sure that passed `negative_prompt` matches the batch size of `prompt`.)rY   rW   rZ   return_attention_maskr[   )type	TypeError_execution_device
isinstancestrlistr2   shaper    	input_idstor   r!   rR   	unsqueezer]   repeatview
ValueErrorrL   rM   )r7   promptdo_classifier_free_guidancenum_images_per_promptrE   negative_promptr   r   _cut_contextr   r   
batch_sizerW   text_inputstext_input_idsr]   bs_embedseq_len_uncond_tokensuncond_inputs                        r;   encode_prompt'Kandinsky3Img2ImgPipeline.encode_promptj   s   T /"=F|4#88UVZ[jVkUl mV~Q( 
 >++F*VS"9"9JJvt$<$<VJ&,,Q/J
 ..$%# ) K )2255f=N(77::6BN --- . M *!,M,0,@,@`l,m)M),D,DQ,GGM(%%++EE%((u(D,22'1%,,Q0EqI%**86K+KWVXY'../DaH&+A+I &!#z 1OS11!0 1s?33 )/)::J3K_J` ax/
| <33  !0*#~~!("#*.#'  .   ".!7!7!:!:6!B*6*E*E*H*H*P')-):):"#: *; *& *@)B&)?C[]EXEXYZE[C[@[)\&*A!E]}GZGZ[\G]E]B]*^')?BcBcdeBf)f& */)9)9-)H&*/*:*:>*J'&,2215G%;%>%>U%>%Z"%++}/B/BB)?)F)FqJ_ab)c&)?)D)DZEgiprt)u&*A*H*HI^`a*b' &*"&*#n]]r=   c           	         [        U[        R                  [        R                  R                  [
        45      (       d  [        S[        U5       35      eUR                  XeS9nX4-  nUR                  S   S:X  a  UnGO[        U[
        5      (       a*  [        U5      U:w  a  [        S[        U5       SU S35      e[        U[
        5      (       ai  [        U5       V	s/ s H=  oR                  R                  XU	S-    5      R                  R                  Xy   5      PM?     nn	[        R                   " USS	9nO4U R                  R                  U5      R                  R                  U5      nU R                  R"                  R$                  U-  n[        R                   " U/SS	9nUR                  n
['        XXeS
9nU R(                  R+                  XU5      nUnU$ s  sn	f )NzK`image` has to be of type `torch.Tensor`, `PIL.Image.Image` or list but is )rE   r]   r&   r(   z/You have passed a list of generators of length z+, but requested an effective batch size of z@. Make sure the batch size matches the length of the generators.r   dim)	generatorrE   r]   )rc   rL   TensorPILImagere   rl   r`   rh   rf   r2   ranger$   encodelatent_distsamplecatr3   scaling_factorr   r#   	add_noise)r7   imagetimesteprr   ro   r]   rE   r   init_latentsirf   noiser   s                r;   prepare_latents)Kandinsky3Img2ImgPipeline.prepare_latents   s   %%,,		!FGG]^bch^i]jk  47
;;q>Q L )T**s9~/K Ec)nEU V  *|+km 
 It,,afgqar ar\]II$$Uq1u%56BBII),War     %yy1=#yy//6BBII)T99++::\ILyy,Q7""UT ~~//XN' s   !AG c                 n   S[        [        R                  " U R                  R                  5      R
                  R                  5       5      ;   n0 nU(       a  X$S'   S[        [        R                  " U R                  R                  5      R
                  R                  5       5      ;   nU(       a  XS'   U$ )Netar   )setinspect	signaturer#   step
parameterskeys)r7   r   r   accepts_etaextra_step_kwargsaccepts_generators         r;   prepare_extra_step_kwargs3Kandinsky3Img2ImgPipeline.prepare_extra_step_kwargs+  s     s7#4#4T^^5H5H#I#T#T#Y#Y#[\\'*e$ (3w/@/@ATAT/U/`/`/e/e/g+hh-6k*  r=   c	           
      D  ^  Ub6  [        U[        5      (       a  US::  a  [        SU S[        U5       S35      eUbW  [	        U 4S jU 5       5      (       d=  [        ST R
                   SU V	s/ s H  oT R
                  ;  d  M  U	PM     sn	 35      eUb  Ub  [        SU S	U S
35      eUc  Uc  [        S5      eUbA  [        U[        5      (       d,  [        U[        5      (       d  [        S[        U5       35      eUb  Ub  [        SU SU S
35      eUbC  Ub@  UR                  UR                  :w  a&  [        SUR                   SUR                   S35      eUb  Uc  [        S5      eUbI  UbF  UR                  S S UR                  :w  a)  [        SUR                  S S  SUR                   S35      eUb  Uc  [        S5      eUbK  UbG  UR                  S S UR                  :w  a)  [        SUR                  S S  SUR                   S35      eg g g s  sn	f )Nr   z5`callback_steps` has to be a positive integer but is z	 of type rU   c              3   @   >#    U  H  oTR                   ;   v   M     g 7fN_callback_tensor_inputs.0kr7   s     r;   	<genexpr>9Kandinsky3Img2ImgPipeline.check_inputs.<locals>.<genexpr>M        F
7Y!---7Y   2`callback_on_step_end_tensor_inputs` has to be in , but found zCannot forward both `prompt`: z and `prompt_embeds`: z2. Please make sure to only forward one of the two.zeProvide either `prompt` or `prompt_embeds`. Cannot leave both `prompt` and `prompt_embeds` undefined.z2`prompt` has to be of type `str` or `list` but is z'Cannot forward both `negative_prompt`: z and `negative_prompt_embeds`: zu`prompt_embeds` and `negative_prompt_embeds` must have the same shape when passed directly, but got: `prompt_embeds` z != `negative_prompt_embeds` zLPlease provide `negative_attention_mask` along with `negative_prompt_embeds`r   z`negative_prompt_embeds` and `negative_attention_mask` must have the same batch_size and token length when passed directly, but got: `negative_prompt_embeds` z != `negative_attention_mask` z:Please provide `attention_mask` along with `prompt_embeds`z`prompt_embeds` and `attention_mask` must have the same batch_size and token length when passed directly, but got: `prompt_embeds` z != `attention_mask` )	rc   r@   rl   r`   allr   rd   re   rf   )
r7   rm   callback_stepsrp   r   r   "callback_on_step_end_tensor_inputsr   r   r   s
   `         r;   check_inputs&Kandinsky3Img2ImgPipeline.check_inputs<  s    %z.#/N/NR`deReGGW X(), 
 .9# F
7YF
 C
 C
 DTEaEaDbbn  |^  pH  |^vw  ko  kG  kG  bGpq  |^  pH  oI  J  -";08N}o ^0 0  ^ 5w  FC)@)@TZ\`IaIaQRVW]R^Q_`aa&+A+M9/9J K*++]_ 
 $)?)K""&<&B&BB --:-@-@,A B.445Q8  "-2I2Qkll!-2I2U%++BQ/3J3P3PP 66L6R6RSUTU6V5W X/556a9  $)?YZZ$)C""2A&.*>*>> --:-@-@!-D,E F&,,-Q0  ? *D$W pHs   /HHc                     U R                   $ r   _guidance_scaler7   s    r;   guidance_scale(Kandinsky3Img2ImgPipeline.guidance_scale  s    ###r=   c                      U R                   S:  $ )Nr&   r   r   s    r;   rn   5Kandinsky3Img2ImgPipeline.do_classifier_free_guidance  s    ##a''r=   c                     U R                   $ r   )_num_timestepsr   s    r;   num_timesteps'Kandinsky3Img2ImgPipeline.num_timesteps  s    """r=   g333333?   g      @pilr   rm   r   rD   rC   r   rp   ro   r   output_typereturn_dictcallback_on_step_endr   c                 r  ^  UR                  SS5      nUR                  SS5      nUb  [        SSS5        Ub  [        SSS5        UbX  [        U 4S jU 5       5      (       d>  [        ST R                   S	U Vs/ s H  nUT R                  ;  d  M  UPM     sn 35      eS
nT R                  UUUU	U
UUU5        UT l        Ub  [        U[        5      (       a  SnO3Ub!  [        U[        5      (       a  [        U5      nOU	R                  S   nT R                  nT R                  UT R                  UUUU	U
UUUS9
u  ppT R                  (       a<  [        R                   " X/5      n	[        R                   " X/5      R#                  5       n[        U[        5      (       d  U/n[        S U 5       5      (       d)  [        SU Vs/ s H  n[%        U5      PM     sn S35      e[        R                   " U Vs/ s H  nT R&                  R)                  U5      PM      snSS9nUR+                  U	R,                  US9nT R.                  R1                  UUS9  T R3                  XCU5      u  nnT R4                  R7                  U5      S   nUR9                  USS9nUSS R;                  UU-  5      nT R=                  UUUXyR,                  UU5      n[?        T S5      (       a'  T R@                  b  T R@                  RC                  5         [        U5      UT R.                  RD                  -  -
  n[        U5      T l#        T RI                  US9 n[K        U5       GH  u  nnT R                  (       a  [        R                   " U/S-  5      OUnT RM                  UUU	US9S   n T R                  (       a"  U RO                  S5      u  n!n"US-   U"-  UU!-  -
  n T R.                  RQ                  U UUUS9RR                  nUb  0 n#U H  n[U        5       U   U#U'   M     U" T UUU#5      n$U$R                  SU5      nU$R                  SU	5      n	U$R                  SU
5      n
U$R                  SU5      nU$R                  SU5      nU[        U5      S-
  :X  d)  US-   U:  a`  US-   T R.                  RD                  -  S:X  a@  URW                  5         Ub-  UU-  S:X  a$  U[Y        T R.                  SS5      -  n%U" U%UU5        [Z        (       d  GM  [\        R^                  " 5         GM     US :X  d9  T R4                  Ra                  US
S!9S"   nT R&                  Rc                  X-5      nOUnT Re                  5         U(       d  U4sSSS5        $ [g        US#9sSSS5        $ s  snf s  snf s  snf ! , (       d  f       g= f)$aG  
Function invoked when calling the pipeline for generation.

Args:
    prompt (`str` or `List[str]`, *optional*):
        The prompt or prompts to guide the image generation. If not defined, one has to pass `prompt_embeds`.
        instead.
    image (`torch.Tensor`, `PIL.Image.Image`, `np.ndarray`, `List[torch.Tensor]`, `List[PIL.Image.Image]`, or `List[np.ndarray]`):
        `Image`, or tensor representing an image batch, that will be used as the starting point for the
        process.
    strength (`float`, *optional*, defaults to 0.8):
        Indicates extent to transform the reference `image`. Must be between 0 and 1. `image` is used as a
        starting point and more noise is added the higher the `strength`. The number of denoising steps depends
        on the amount of noise initially added. When `strength` is 1, added noise is maximum and the denoising
        process runs for the full number of iterations specified in `num_inference_steps`. A value of 1
        essentially ignores `image`.
    num_inference_steps (`int`, *optional*, defaults to 50):
        The number of denoising steps. More denoising steps usually lead to a higher quality image at the
        expense of slower inference.
    guidance_scale (`float`, *optional*, defaults to 3.0):
        Guidance scale as defined in [Classifier-Free Diffusion
        Guidance](https://huggingface.co/papers/2207.12598). `guidance_scale` is defined as `w` of equation 2.
        of [Imagen Paper](https://huggingface.co/papers/2205.11487). Guidance scale is enabled by setting
        `guidance_scale > 1`. Higher guidance scale encourages to generate images that are closely linked to
        the text `prompt`, usually at the expense of lower image quality.
    negative_prompt (`str` or `List[str]`, *optional*):
        The prompt or prompts not to guide the image generation. If not defined, one has to pass
        `negative_prompt_embeds` instead. Ignored when not using guidance (i.e., ignored if `guidance_scale` is
        less than `1`).
    num_images_per_prompt (`int`, *optional*, defaults to 1):
        The number of images to generate per prompt.
    generator (`torch.Generator` or `List[torch.Generator]`, *optional*):
        One or a list of [torch generator(s)](https://pytorch.org/docs/stable/generated/torch.Generator.html)
        to make generation deterministic.
    prompt_embeds (`torch.Tensor`, *optional*):
        Pre-generated text embeddings. Can be used to easily tweak text inputs, *e.g.* prompt weighting. If not
        provided, text embeddings will be generated from `prompt` input argument.
    negative_prompt_embeds (`torch.Tensor`, *optional*):
        Pre-generated negative text embeddings. Can be used to easily tweak text inputs, *e.g.* prompt
        weighting. If not provided, negative_prompt_embeds will be generated from `negative_prompt` input
        argument.
    attention_mask (`torch.Tensor`, *optional*):
        Pre-generated attention mask. Must provide if passing `prompt_embeds` directly.
    negative_attention_mask (`torch.Tensor`, *optional*):
        Pre-generated negative attention mask. Must provide if passing `negative_prompt_embeds` directly.
    output_type (`str`, *optional*, defaults to `"pil"`):
        The output format of the generate image. Choose between
        [PIL](https://pillow.readthedocs.io/en/stable/): `PIL.Image.Image` or `np.array`.
    return_dict (`bool`, *optional*, defaults to `True`):
        Whether or not to return a [`~pipelines.stable_diffusion.IFPipelineOutput`] instead of a plain tuple.
    callback_on_step_end (`Callable`, *optional*):
        A function that calls at the end of each denoising steps during the inference. The function is called
        with the following arguments: `callback_on_step_end(self: DiffusionPipeline, step: int, timestep: int,
        callback_kwargs: Dict)`. `callback_kwargs` will include a list of all tensors as specified by
        `callback_on_step_end_tensor_inputs`.
    callback_on_step_end_tensor_inputs (`List`, *optional*):
        The list of tensor inputs for the `callback_on_step_end` function. The tensors specified in the list
        will be passed as `callback_kwargs` argument. You will only be able to include variables listed in the
        `._callback_tensor_inputs` attribute of your pipeline class.

Examples:

Returns:
    [`~pipelines.ImagePipelineOutput`] or `tuple`

callbackNr   z1.0.0zhPassing `callback` as an input argument to `__call__` is deprecated, consider use `callback_on_step_end`znPassing `callback_steps` as an input argument to `__call__` is deprecated, consider use `callback_on_step_end`c              3   @   >#    U  H  oTR                   ;   v   M     g 7fr   r   r   s     r;   r   5Kandinsky3Img2ImgPipeline.__call__.<locals>.<genexpr>  r   r   r   r   Tr&   r   )ro   rE   rp   r   r   rq   r   r   c              3      #    U  H9  n[        U[        R                  R                  [        R                  45      v   M;     g 7fr   )rc   r   r   rL   r   )r   r   s     r;   r   r   *  s+     Q5a:a#))//5<<!@AA5s   AAzInput is in incorrect format: z:. Currently, we only support  PIL image and pytorch tensorr}   r\   )rE   r   text_encoder_offload_hook)totalr   )encoder_hidden_statesencoder_attention_maskg      ?)r   r   r   r   r   orderlatent)force_not_quantizer   )images)4popr   r   rl   r   r   r   rc   rd   re   r2   rf   rb   rz   rn   rL   r   boolr`   r6   
preprocessrh   r]   r#   set_timestepsrH   r$   r   repeat_interleaverj   r   hasattrr   offloadr   r   progress_bar	enumerater"   chunkr   prev_samplelocalsupdater1   XLA_AVAILABLExm	mark_stepdecodepostprocessmaybe_free_model_hooksr   )&r7   rm   r   rD   rC   r   rp   ro   r   r   r   r   r   r   r   r   r   kwargsr   r   r   rP   rr   rE   r   rB   r   latent_timestepnum_warmup_stepsr   tlatent_model_input
noise_prednoise_pred_uncondnoise_pred_textcallback_kwargscallback_outputsstep_idxs&   `                                     r;   __call__"Kandinsky3Img2ImgPipeline.__call__  s3   p ::j$/$4d;z
 %  A .9# F
7YF
 C
 C
 DTEaEaDbbn  |^  pH  |^vw  bc  ko  kG  kG  bGpq  |^  pH  oI  J  ".#		
  .*VS"9"9JJvt$<$<VJ&,,Q/J'' Z^YkYk,,"7+'#9$)$; Zl Z
V~ ++!II'=&MNM"YY(?'PQVVXN%&&GEQ5QQQ051I5a$q'51I0J  KE  F  		uMu!4//::1=uMSTU}226B$$%8$H)-););<O[a)b&	&))""5))4++,Aq+I#BQ-..z<Q/QR&&_j2GI\I\^dfo
 4455$:X:X:d**224 y>,?$..BVBV,VV!)n%89\!),1AEAaAaUYYy1}%=gn" "YY&*7+9	 ' 
 
 339C9I9I!9L6%"03"6/!IN]nLn!nJ ..--'	 . 
 +  (3&(O?-3Xa[* @';D!Q'X$.229gFG$4$8$8-$XM-=-A-ABZ\r-s*%5%9%9:JN%[N.>.B.BC\^u.v+I**A9I/IqSTuX\XfXfXlXlNlpqNq '')+N0Ba0G#$(K#K 1g6 =LLNU -Z (*		((T(J8T,,88L'')xo :9r 'e4s :9K pH` 2J N$ :9s2   :VVV
:%V#F5V(	A4V(V((
V6)r   r   r6   )	Tr&   NNNNFNNr   )NNNNNN)*__name__
__module____qualname____firstlineno__model_cpu_offload_seqr   r	   r   r   r   r   r/   rH   rR   rL   no_gradr   r   rz   r   r   r   propertyr   rn   r   r   EXAMPLE_DOC_STRINGr   rd   r   r   r   floatr@   	Generatorr   r   r   r   __static_attributes____classcell__)r:   s   @r;   r   r   8   s   <

 %
 	

 !
 
,8* ]]_ %)049=15:>S^  -S^ !) 6S^ !.S^ "*%,,!7S^ S^j(V!* #+/ $FP $ $ ( ( # # ]]_12 )-ae#% #;?/0MQ049=15:>%* KO9B#h5c49n%h5 U\\399??D4FSYY__H]]^h5 	h5
 !h5 h5 "%T#Y"78h5  (}h5 E%//43H"HIJh5  -h5 !) 6h5 !.h5 "*%,,!7h5 c]h5 h5  'xc40@$0F'GH!h5" -1I#h5 3 h5r=   r   )*r   typingr   r   r   r   r   r   	PIL.ImagerL   transformersr   r	   r6   r   loadersr   modelsr   r   
schedulersr   utilsr   r   r   r   utils.torch_utilsr   pipeline_utilsr   r   torch_xla.core.xla_modelcore	xla_modelr   r   
get_loggerr   loggerr   r    r=   r;   <module>r
     s}     8 8 
   4 0 5 - '  . C ))MM			H	% .B	5 13Q B	5r=   