ó
    oM‡j»  ã            
       ó�  • S SK r S SKJrJr  S SKrS SKJrJ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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%\RL                  " \'5      r(Sr)    SS\*S-  S\+\RX                  -  S-  S\-\*   S-  S\-\.   S-  4S jjr/ " S S\\5      r0g)é    N)ÚAnyÚCallable)ÚT5TokenizerÚUMT5EncoderModelé   )ÚMultiPipelineCallbacksÚPipelineCallback)ÚVaeImageProcessor)ÚAuraFlowLoraLoaderMixin)ÚAuraFlowTransformer2DModelÚAutoencoderKL)ÚFlowMatchEulerDiscreteScheduler)ÚUSE_PEFT_BACKENDÚ	deprecateÚis_torch_xla_availableÚloggingÚreplace_example_docstringÚscale_lora_layersÚunscale_lora_layers)Úrandn_tensoré   )ÚDiffusionPipelineÚImagePipelineOutputTFa�  
    Examples:
        ```py
        >>> import torch
        >>> from diffusers import AuraFlowPipeline

        >>> pipe = AuraFlowPipeline.from_pretrained("fal/AuraFlow", torch_dtype=torch.float16)
        >>> pipe = pipe.to("cuda")
        >>> prompt = "A cat holding a sign that says hello world"
        >>> image = pipe(prompt).images[0]
        >>> image.save("aura_flow.png")
        ```
Únum_inference_stepsÚdeviceÚ	timestepsÚsigmasc                 óÀ  • Ub  Ub  [        S5      eUb’  S[        [        R                  " U R                  5      R
                  R                  5       5      ;   nU(       d  [        SU R                   S35      eU R                  " S
X2S.UD6  U R                  n[        U5      nX14$ Ub’  S[        [        R                  " U R                  5      R
                  R                  5       5      ;   nU(       d  [        SU R                   S35      eU R                  " S
XBS.UD6  U R                  n[        U5      nX14$ U R                  " U4S	U0UD6  U R                  nX14$ )aµ  
Calls the scheduler's `set_timesteps` method and retrieves timesteps from the scheduler after the call. Handles
custom timesteps. Any kwargs will be supplied to `scheduler.set_timesteps`.

Args:
    scheduler (`SchedulerMixin`):
        The scheduler to get timesteps from.
    num_inference_steps (`int`):
        The number of diffusion steps used when generating samples with a pre-trained model. If used, `timesteps`
        must be `None`.
    device (`str` or `torch.device`, *optional*):
        The device to which the timesteps should be moved to. If `None`, the timesteps are not moved.
    timesteps (`list[int]`, *optional*):
        Custom timesteps used to override the timestep spacing strategy of the scheduler. If `timesteps` is passed,
        `num_inference_steps` and `sigmas` must be `None`.
    sigmas (`list[float]`, *optional*):
        Custom sigmas used to override the timestep spacing strategy of the scheduler. If `sigmas` is passed,
        `num_inference_steps` and `timesteps` must be `None`.

Returns:
    `tuple[torch.Tensor, int]`: A tuple where the first element is the timestep schedule from the scheduler and the
    second element is the number of inference steps.
zYOnly one of `timesteps` or `sigmas` can be passed. Please choose one to set custom valuesr   zThe current scheduler class zx's `set_timesteps` does not support custom timestep schedules. Please check whether you are using the correct scheduler.)r   r   r   zv's `set_timesteps` does not support custom sigmas schedules. Please check whether you are using the correct scheduler.)r   r   r   © )
Ú
ValueErrorÚsetÚinspectÚ	signatureÚset_timestepsÚ
parametersÚkeysÚ	__class__r   Úlen)Ú	schedulerr   r   r   r   ÚkwargsÚaccepts_timestepsÚaccept_sigmass           Ú¾C:\Users\johnn\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.13_qbz5n2kfra8p0\LocalCache\local-packages\Python313\site-packages\diffusers/pipelines/aura_flow/pipeline_aura_flow.pyÚretrieve_timestepsr.   @   s}  € ð> Ñ Ñ!3ÜÐtÓuÐuØÑØ'¬3¬w×/@Ò/@À×AXÑAXÓ/Y×/dÑ/d×/iÑ/iÓ/kÓ+lÑlÐÞ ÜØ.¨y×/BÑ/BÐ.Cð Dað bóð ð 	×ÒÐM¨)ÑMÀfÒMØ×'Ñ'ˆ	Ü! )›nÐð Ð)Ð)ð 
Ñ	Ø ¤C¬×(9Ò(9¸)×:QÑ:QÓ(R×(]Ñ(]×(bÑ(bÓ(dÓ$eÑeˆÞÜØ.¨y×/BÑ/BÐ.Cð D_ð `óð ð 	×ÒÐG vÑGÀÒGØ×'Ñ'ˆ	Ü! )›nÐð Ð)Ð)ð 	×ÒÐ 3ÑM¸FÐMÀfÒMØ×'Ñ'ˆ	ØÐ)Ð)ó    c            .       ó�  ^ • \ rS rSrSr/ rSrSS/rS\S\	S\
S	\S
\4
U 4S jjr     S3S jr          S4S\\\   -  S\\\   -  S\S\S\R(                  S-  S\R*                  S-  S\R*                  S-  S\R*                  S-  S\R*                  S-  S\S\S-  4S jjr S5S jrS 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$SSSS/4S\\\   -  S\\\   -  S%\S&\\   S'\S\S-  S(\S-  S)\S-  S*\RB                  \\RB                     -  S-  S\R*                  S-  S\R*                  S-  S\R*                  S-  S\R*                  S-  S\R*                  S-  S\S+\S-  S,\S-\"\\#4   S-  S.\$\\/S4   \%-  \&-  S-  S/\\   S0\'\(-  4*S1 jj5       5       r)S2r*U =r+$ )6ÚAuraFlowPipelineé{   a‚  
Args:
    tokenizer (`T5TokenizerFast`):
        Tokenizer of class
        [T5Tokenizer](https://huggingface.co/docs/transformers/model_doc/t5#transformers.T5Tokenizer).
    text_encoder ([`T5EncoderModel`]):
        Frozen text-encoder. AuraFlow uses
        [T5](https://huggingface.co/docs/transformers/model_doc/t5#transformers.T5EncoderModel), specifically the
        [EleutherAI/pile-t5-xl](https://huggingface.co/EleutherAI/pile-t5-xl) variant.
    vae ([`AutoencoderKL`]):
        Variational Auto-Encoder (VAE) Model to encode and decode images to and from latent representations.
    transformer ([`AuraFlowTransformer2DModel`]):
        Conditional Transformer (MMDiT and DiT) architecture to denoise the encoded image latents.
    scheduler ([`FlowMatchEulerDiscreteScheduler`]):
        A scheduler to be used in combination with `transformer` to denoise the encoded image latents.
ztext_encoder->transformer->vaeÚlatentsÚprompt_embedsÚ	tokenizerÚtext_encoderÚvaeÚtransformerr)   c                 ó  >• [         TU ]  5         U R                  XX4US9  [        U SS 5      (       a/  S[	        U R
                  R                  R                  5      S-
  -  OSU l        [        U R                  S9U l
        g )N)r5   r6   r7   r8   r)   r7   r   é   é   )Úvae_scale_factor)ÚsuperÚ__init__Úregister_modulesÚgetattrr(   r7   ÚconfigÚblock_out_channelsr<   r
   Úimage_processor)Úselfr5   r6   r7   r8   r)   r'   s         €r-   r>   ÚAuraFlowPipeline.__init__”   s|   ø€ ô 	‰ÑÔà×ÑØÀÐhqð 	ñ 	
ô W^Ð^bÐdiÐko×VpÑVp ¤c¨$¯(©(¯/©/×*LÑ*LÓ&MÐPQÑ&QÒ RÐvwˆÔÜ0À$×BWÑBWÑXˆÕr/   Nc
           
      óî  ^ • UT R                   S-  -  S:w  d  UT R                   S-  -  S:w  a"  [        ST R                   S-   SU SU S35      eU	bW  [        U 4S jU	 5       5      (       d=  [        ST R                   S	U	 V
s/ s H  oªT 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b  Ub  [        SU SU S35      eUb  Uc  [        S5      eUb  Uc  [        S5      eUb…  Ub�  UR                  UR                  :w  a&  [        SUR                   SUR                   S35      eUR                  UR                  :w  a&  [        SUR                   SUR                   S35      eg g g s  sn
f )Nr   r   z-`height` and `width` have to be divisible by z	 but are z and Ú.c              3   ó@   >#   • U  H  oTR                   ;   v •  M     g 7f©N)Ú_callback_tensor_inputs)Ú.0ÚkrD   s     €r-   Ú	<genexpr>Ú0AuraFlowPipeline.check_inputs.<locals>.<genexpr>¶   s   øé € ð F
Ú7Y°!�×-Ñ-Ö-Ò7Yùs   ƒz2`callback_on_step_end_tensor_inputs` has to be in z, 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 and `negative_prompt_embeds`: z'Cannot forward both `negative_prompt`: zEMust provide `prompt_attention_mask` when specifying `prompt_embeds`.zWMust provide `negative_prompt_attention_mask` when specifying `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` z�`prompt_attention_mask` and `negative_prompt_attention_mask` must have the same shape when passed directly, but got: `prompt_attention_mask` z% != `negative_prompt_attention_mask` )	r<   r    ÚallrJ   Ú
isinstanceÚstrÚlistÚtypeÚshape)rD   ÚpromptÚheightÚwidthÚnegative_promptr4   Únegative_prompt_embedsÚprompt_attention_maskÚnegative_prompt_attention_maskÚ"callback_on_step_end_tensor_inputsrL   s   `          r-   Úcheck_inputsÚAuraFlowPipeline.check_inputs¥   sï  ø€ ð �T×*Ñ*¨QÑ.Ñ/°1Ó4¸À×AVÑAVÐYZÑAZÑ8[Ð_`Ó8`ÜØ?À×@UÑ@UÐXYÑ@YÐ?ZÐZcÐdjÐckÐkpÐqvÐpwÐwxÐyóð ð .Ñ9Ä#ô F
Ù7YóF
÷ C
ñ C
ô ØDÀT×EaÑEaÐDbÐbnñ  |^ó  pHò  |^Ðvwð  ko÷  kGñ  kGñ  bG×pqñ  |^ñ  pHð  oIð  Jóð ð Ñ -Ñ";ÜØ0°°Ð8NÈ}Èoð ^0ð 0óð ð ‰^ Ñ 5ÜØwóð ð Ñ¬°F¼C×)@Ñ)@ÌÐTZÔ\`×IaÑIaÜÐQÔRVÐW]ÓR^ÐQ_Ð`ÓaÐaàÑÐ"8Ñ"DÜØ0°°ð 9Ø*Ð+Ð+]ð_óð ð
 Ñ&Ð+AÑ+MÜØ9¸/Ð9Jð KØ*Ð+Ð+]ð_óð ð
 Ñ$Ð)>Ñ)FÜÐdÓeÐeà!Ñ-Ð2PÑ2XÜÐvÓwÐwàÑ$Ð)?Ñ)KØ×"Ñ"Ð&<×&BÑ&BÓBÜ ð-Ø-:×-@Ñ-@Ð,Að BØ.×4Ñ4Ð5°Qð8óð ð
 %×*Ñ*Ð.L×.RÑ.RÓRÜ ð5Ø5J×5PÑ5PÐ4Qð RØ6×<Ñ<Ð=¸Qð@óð ð Sð *LÐ$ùòA pHs   ÂG2ÂG2Tr:   é   rU   rX   Údo_classifier_free_guidanceÚnum_images_per_promptr   rY   rZ   r[   Úmax_sequence_lengthÚ
lora_scalec                 óX  • UbI  [        U [        5      (       a4  X°l        U R                  b!  [        (       a  [        U R                  U5        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U
nUGc,  U R                  USUSSS9nUS   nU R                  US	SS
9R                  nUR                  S   UR                  S   :¼  a^  [        R                  " UU5      (       dB  U R                  R                  USS2US-
  S24   5      n[         R#                  SU SU 35        UR%                  5        VVs0 s H  u  nnUUR'                  U5      _M     nnnU R                  " S0 UD6S   nUS   R)                  S5      R+                  UR                  5      nXh-  nU R                  b  U R                  R,                  nO&U R.                  b  U R.                  R,                  nOSnUR'                  UUS9nUR                  u  nnnUR1                  SUS5      nUR3                  UU-  US5      nUR5                  US5      nUR1                  US5      nU(       aÈ  UcÅ  U=(       d    Sn[        U[        5      (       a  U/U-  OUnUR                  S   nU R                  USUSSS9nUR%                  5        VVs0 s H  u  nnUUR'                  U5      _M     nnnU R                  " S0 UD6S   nUS   R)                  S5      R+                  UR                  5      n	Xy-  nU(       al  UR                  S   nUR'                  UUS9nUR1                  SUS5      nUR3                  XÄ-  US5      nU	R5                  US5      n	U	R1                  US5      n	OSnSn	U R                  b6  [        U [        5      (       a!  [        (       a  [7        U R                  U5        XhXy4$ s  snnf s  snnf )a:  
Encodes the prompt into text encoder hidden states.

Args:
    prompt (`str` or `list[str]`, *optional*):
        prompt to be encoded
    negative_prompt (`str` or `list[str]`, *optional*):
        The prompt 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`).
    do_classifier_free_guidance (`bool`, *optional*, defaults to `True`):
        whether to use classifier free guidance or not
    num_images_per_prompt (`int`, *optional*, defaults to 1):
        number of images that should be generated per prompt
    device: (`torch.device`, *optional*):
        torch device to place the resulting embeddings on
    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.
    prompt_attention_mask (`torch.Tensor`, *optional*):
        Pre-generated attention mask for text embeddings.
    negative_prompt_embeds (`torch.Tensor`, *optional*):
        Pre-generated negative text embeddings.
    negative_prompt_attention_mask (`torch.Tensor`, *optional*):
        Pre-generated attention mask for negative text embeddings.
    max_sequence_length (`int`, defaults to 256): Maximum sequence length to use for the prompt.
    lora_scale (`float`, *optional*):
        A lora scale that will be applied to all LoRA layers of the text encoder if LoRA layers are loaded.
Nr:   r   TÚ
max_lengthÚpt)Ú
truncationre   ÚpaddingÚreturn_tensorsÚ	input_idsÚlongest)rh   ri   éÿÿÿÿzZThe following part of your input was truncated because T5 can only handle sequences up to z	 tokens: Úattention_mask)Údtyper   Ú r   )rP   r   Ú_lora_scaler6   r   r   Ú_execution_devicerQ   rR   r(   rT   r5   rj   ÚtorchÚequalÚbatch_decodeÚloggerÚwarningÚitemsÚtoÚ	unsqueezeÚexpandrn   r8   ÚrepeatÚviewÚreshaper   )rD   rU   rX   r`   ra   r   r4   rY   rZ   r[   rb   rc   Ú
batch_sizere   Útext_inputsÚtext_input_idsÚuntruncated_idsÚremoved_textrL   Úvrn   Úbs_embedÚseq_lenÚ_Úuncond_tokensÚuncond_inputs                             r-   Úencode_promptÚAuraFlowPipeline.encode_promptè   sb  € ðX Ñ!¤j°Ô7N×&OÑ&OØ)Ôð × Ñ Ñ,×1AÒ1AÜ! $×"3Ñ"3°ZÔ@à‰>Ø×+Ñ+ˆFØÑ¤*¨V´S×"9Ñ"9Ø‰JØÑ¤J¨v´t×$<Ñ$<Ü˜V›‰Jà&×,Ñ,¨QÑ/ˆJà(ˆ
ØÒ ØŸ.™.ØØØ%Ø$Ø#ð )ð ˆKð )¨Ñ5ˆNØ"Ÿn™n¨V¸YÐW[˜nÐ\×fÑfˆOà×$Ñ$ RÑ(¨N×,@Ñ,@ÀÑ,DÓDÌUÏ[Ê[Ø ÷Nñ Nð  $Ÿ~™~×:Ñ:¸?Ê1ÈjÐ[\ÉnÐ_aÐNaÐKaÑ;bÓc�Ü—‘ðØ"�| 9¨\¨Nð<ôð
 8C×7HÑ7HÔ7JÔKÒ7J©t¨q°!˜1˜aŸd™d 6›lš?Ñ7JˆKÑKØ ×-Ò-Ñ<°Ñ<¸QÑ?ˆMØ$/Ð0@Ñ$A×$KÑ$KÈBÓ$O×$VÑ$VÐWd×WjÑWjÓ$kÐ!Ø)ÑAˆMà×ÑÑ(Ø×%Ñ%×+Ñ+‰EØ×ÑÑ)Ø×$Ñ$×*Ñ*‰EàˆEà%×(Ñ(¨u¸VÐ(ÐDˆà,×2Ñ2Ñˆ�'˜1à%×,Ñ,¨QÐ0EÀqÓIˆØ%×*Ñ*¨8Ð6KÑ+KÈWÐVXÓYˆØ 5× =Ñ =¸hÈÓ KÐØ 5× <Ñ <Ð=RÐTUÓ VÐö 'Ð+AÑ+IØ-×3°ˆOÜ>HÈÔZ]×>^Ñ>^˜_Ð-°
Ò:ÐdsˆMØ&×,Ñ,¨QÑ/ˆJØŸ>™>ØØØ%Ø$Ø#ð *ð ˆLð 9E×8JÑ8JÔ8LÔMÒ8L±°°1˜A˜qŸt™t F›|šOÑ8LˆLÑMØ%)×%6Ò%6Ñ%F¸Ñ%FÀqÑ%IÐ"àÐ-Ñ.×8Ñ8¸Ó<×CÑCÐDZ×D`ÑD`Óað +ð &<Ñ%\Ð"æ&à,×2Ñ2°1Ñ5ˆGà%;×%>Ñ%>ÀUÐSYÐ%>Ð%ZÐ"à%;×%BÑ%BÀ1ÐF[Ð]^Ó%_Ð"Ø%;×%@Ñ%@ÀÑAcÐelÐnpÓ%qÐ"à-K×-SÑ-SÐT\Ð^`Ó-aÐ*Ø-K×-RÑ-RÐShÐjkÓ-lÑ*à%)Ð"Ø-1Ð*à×ÑÑ(Ü˜$Ô 7×8Ñ8×=MÒ=Mä# D×$5Ñ$5°zÔBàÐ5KÐkÐkùóy LùóB Ns   Å4P Ë:P&c	                 ó   • Ub  UR                  XeS9$ UU[        U5      U R                  -  [        U5      U R                  -  4n	[        U[        5      (       a*  [        U5      U:w  a  [        S[        U5       SU S35      e[        X—XeS9nU$ )N)r   rn   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.)Ú	generatorr   rn   )rx   Úintr<   rP   rR   r(   r    r   )
rD   r~   Únum_channels_latentsrV   rW   rn   r   rŒ   r3   rT   s
             r-   Úprepare_latentsÚ AuraFlowPipeline.prepare_latentsx  s¨   € ð ÑØ—:‘: V�:Ð9Ð9ð Ø Ü�‹K˜4×0Ñ0Ñ0Ü�‹J˜$×/Ñ/Ñ/ð	
ˆô �i¤×&Ñ&¬3¨y«>¸ZÓ+GÜØAÄ#ÀiÃ.ÐAQð RØ&˜<Ð'gðióð ô
 ˜uÀ&ÑVˆàˆr/   c                 ól   • [        SSS5        U R                  R                  [        R                  S9  g )NÚ
upcast_vaez1.0.0z­`upcast_vae` is deprecated. Please use `pipe.vae.to(torch.float32)`. For more details, please refer to: https://github.com/huggingface/diffusers/pull/12619#issue-3606633695.©rn   )r   r7   rx   rr   Úfloat32©rD   s    r-   r’   ÚAuraFlowPipeline.upcast_vae˜  s.   € ÜØØð |ô	
ð
 	�‰�‰œ%Ÿ-™-ˆÒ(r/   c                 ó   • U R                   $ rI   )Ú_guidance_scaler•   s    r-   Úguidance_scaleÚAuraFlowPipeline.guidance_scale   s   € à×#Ñ#Ð#r/   c                 ó   • U R                   $ rI   )Ú_attention_kwargsr•   s    r-   Úattention_kwargsÚ!AuraFlowPipeline.attention_kwargs¤  s   € à×%Ñ%Ð%r/   c                 ó   • U R                   $ rI   )Ú_num_timestepsr•   s    r-   Únum_timestepsÚAuraFlowPipeline.num_timesteps¨  s   € à×"Ñ"Ð"r/   é2   g      @i   Úpilr   r   r™   rV   rW   rŒ   Úoutput_typeÚreturn_dictr�   Úcallback_on_step_endr\   Úreturnc                 óØ	  • U=(       d-    U R                   R                  R                  U R                  -  nU=(       d-    U R                   R                  R                  U R                  -  nU R	                  UUUUUUUUUS9	  XPl        UU l        Ub  [        U[        5      (       a  SnO3Ub!  [        U[        5      (       a  [        U5      nOUR                  S   nU R                  nU R                  b  U R                  R                  SS5      OSnUS:„  nU R                  UUUUUUUUUUUS9u  nnnnU(       a  [         R"                  " XÛ/SS9n[$        (       a  S	nOUn['        U R(                  UUUS
9u  nnU R                   R                  R*                  nU R-                  UU-  UUUUR.                  UU	U
5      n
[1        [        U5      X0R(                  R2                  -  -
  S5      n[        U5      U l        U R7                  US9 n[9        U5       GH¤  u  nnU(       a  [         R"                  " U
/S-  5      OU
n [         R:                  " US-  /5      R=                  U R                  S   5      n!U!R?                  U
R@                  U
R.                  S9n!U R                  U UU!SU R                  S9S   n"U(       a  U"RC                  S5      u  n#n$U#UU$U#-
  -  -   n"U R(                  RE                  U"UU
SS9S   n
UbJ  0 n%U H  n&[G        5       U&   U%U&'   M     U" U UUU%5      n'U'RI                  SU
5      n
U'RI                  SU5      nU[        U5      S-
  :X  d)  US-   U:”  a0  US-   U R(                  R2                  -  S:X  a  URK                  5         [$        (       d  GM�  [L        RN                  " 5         GM§     SSS5        US:X  a  U
n(OàU RP                  R.                  [         RR                  :H  =(       a     U RP                  R                  RT                  n)U)(       a  U RW                  5         U RP                  RY                  U
R?                  U RP                  R.                  5      U RP                  R                  RZ                  -  SS9S   n(U R\                  R_                  U(US9n(U Ra                  5         U(       d  U(4$ [c        U(S9$ ! , (       d  f       GN= f)aW  
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.
    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`).
    height (`int`, *optional*, defaults to self.transformer.config.sample_size * self.vae_scale_factor):
        The height in pixels of the generated image. This is set to 1024 by default for best results.
    width (`int`, *optional*, defaults to self.transformer.config.sample_size * self.vae_scale_factor):
        The width in pixels of the generated image. This is set to 1024 by default for best results.
    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.
    sigmas (`list[float]`, *optional*):
        Custom sigmas used to override the timestep spacing strategy of the scheduler. If `sigmas` is passed,
        `num_inference_steps` and `timesteps` must be `None`.
    guidance_scale (`float`, *optional*, defaults to 5.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.
    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.
    latents (`torch.FloatTensor`, *optional*):
        Pre-generated noisy latents, sampled from a Gaussian distribution, to be used as inputs for image
        generation. Can be used to tweak the same generation with different prompts. If not provided, a latents
        tensor will be generated by sampling using the supplied random `generator`.
    prompt_embeds (`torch.FloatTensor`, *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.
    prompt_attention_mask (`torch.Tensor`, *optional*):
        Pre-generated attention mask for text embeddings.
    negative_prompt_embeds (`torch.FloatTensor`, *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.
    negative_prompt_attention_mask (`torch.Tensor`, *optional*):
        Pre-generated attention mask for negative text embeddings.
    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_xl.StableDiffusionXLPipelineOutput`] instead
        of a plain tuple.
    attention_kwargs (`dict`, *optional*):
        A kwargs dictionary that if specified is passed along to the `AttentionProcessor` as defined under
        `self.processor` in
        [diffusers.models.attention_processor](https://github.com/huggingface/diffusers/blob/main/src/diffusers/models/attention_processor.py).
    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.
    max_sequence_length (`int` defaults to 256): Maximum sequence length to use with the `prompt`.

Examples:

Returns:
    [`~pipelines.ImagePipelineOutput`] or `tuple`:
        If `return_dict` is `True`, [`~pipelines.ImagePipelineOutput`] is returned, otherwise a `tuple` is
        returned where the first element is a list with the generated images.
)r\   Nr:   r   Úscaleg      ð?)rU   rX   r`   ra   r   r4   rY   rZ   r[   rb   rc   )ÚdimÚcpu)r   )Útotalr   iè  r“   F)Úencoder_hidden_statesÚtimestepr¦   r�   )r¦   r3   r4   Úlatent)r¥   )Úimages)2r8   rA   Úsample_sizer<   r]   r˜   rœ   rP   rQ   rR   r(   rT   rq   r�   Úgetr‰   rr   ÚcatÚXLA_AVAILABLEr.   r)   Úin_channelsr�   rn   ÚmaxÚorderr    Úprogress_barÚ	enumerateÚtensorrz   rx   r   ÚchunkÚstepÚlocalsÚpopÚupdateÚxmÚ	mark_stepr7   Úfloat16Úforce_upcastr’   ÚdecodeÚscaling_factorrC   ÚpostprocessÚmaybe_free_model_hooksr   )*rD   rU   rX   r   r   r™   ra   rV   rW   rŒ   r3   r4   rZ   rY   r[   rb   r¥   r¦   r�   r§   r\   r~   r   rc   r`   Útimestep_devicer   Úlatent_channelsÚnum_warmup_stepsr¹   ÚiÚtÚlatent_model_inputr¯   Ú
noise_predÚnoise_pred_uncondÚnoise_pred_textÚcallback_kwargsrL   Úcallback_outputsÚimageÚneeds_upcastings*                                             r-   Ú__call__ÚAuraFlowPipeline.__call__¬  sÂ  € ðJ ×V˜4×+Ñ+×2Ñ2×>Ñ>À×AVÑAVÑVˆØ×T˜×)Ñ)×0Ñ0×<Ñ<¸t×?TÑ?TÑTˆà×ÑØØØØØØ"Ø!Ø*Ø/Qð 	ñ 
	
ð  .ÔØ!1ˆÔð Ñ¤*¨V´S×"9Ñ"9Ø‰JØÑ¤J¨v´t×$<Ñ$<Ü˜V›‰Jà&×,Ñ,¨QÑ/ˆJà×'Ñ'ˆØAE×AVÑAVÑAb�T×*Ñ*×.Ñ.¨w¸Ô=Ðhlˆ
ð
 '5°sÑ&:Ð#ð ×ÑØØ+Ø(CØ"7ØØ'Ø#9Ø"7Ø+IØ 3Ø!ð ð 
ñ	
ØØ!Ø"Ø*ö 'Ü!ŸIšIÐ'=Ð&MÐSTÑUˆM÷
 Š=Ø#‰Oà$ˆOÜ);Ø�N‰NÐ/°Èñ*
Ñ&ˆ	Ð&ð
 ×*Ñ*×1Ñ1×=Ñ=ˆØ×&Ñ&ØÐ.Ñ.ØØØØ×ÑØØØó	
ˆô œs 9›~Ð0CÇnÁn×FZÑFZÑ0ZÑZÐ\]Ó^ÐÜ! )›nˆÔØ×ÑÐ%8ÐÑ9¸\Ü! )×,‘��1æA\¤U§Y¢Y°¨y¸1©}Ô%=ÐbiÐ"ô !Ÿ<š<¨¨T©¨
Ó3×:Ñ:Ð;M×;SÑ;SÐTUÑ;VÓW�Ø#Ÿ;™; w§~¡~¸W¿]¹]˜;ÐK�ð "×-Ñ-Ø&Ø*7Ø%Ø %Ø%)×%:Ñ%:ð .ð ð ñ�
ö /Ø9C×9IÑ9IÈ!Ó9LÑ6Ð% Ø!2°^ÀÐYjÑGjÑ5kÑ!k�Jð Ÿ.™.×-Ñ-¨j¸!¸WÐRWÐ-ÐXÐYZÑ[�à'Ñ3Ø&(�OÛ?˜Ü-3«X°a©[˜¨Ó*ñ @á';¸DÀ!ÀQÈÓ'XÐ$à.×2Ñ2°9¸gÓF�GØ$4×$8Ñ$8¸È-Ó$X�Mð œ˜I›¨Ñ*Ó*°°A±Ð9IÓ/IÈqÐSTÉuÐX\×XfÑXf×XlÑXlÑNlÐpqÓNqØ ×'Ñ'Ô)ç •=Ü—L’L—NñQ -÷ :ðV ˜(Ó"Ø‰Eð #Ÿh™hŸn™n´·±Ñ=×^À$Ç(Á(Ç/Á/×B^ÑB^ˆOÞØ—‘Ô!Ø—H‘H—O‘O G§J¡J¨t¯x©x¯~©~Ó$>ÀÇÁÇÁ×A_ÑA_Ñ$_Ðmr�OÐsÐtuÑvˆEØ×(Ñ(×4Ñ4°UÈÐ4ÐTˆEð 	×#Ñ#Ô%æØ�8ˆOä"¨%Ñ0Ð0÷w :Ö9ús   ÈFSÎ,SÓ
S))rœ   r˜   rp   r    rC   r<   )NNNNN)
NTr:   NNNNNr_   NrI   ),Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__Ú_optional_componentsÚmodel_cpu_offload_seqrJ   r   r   r   r   r   r>   r]   rQ   rR   Úboolr�   rr   r   ÚTensorÚfloatr‰   r�   r’   Úpropertyr™   r�   r¡   Úno_gradr   ÚEXAMPLE_DOC_STRINGÚ	GeneratorÚdictr   r   r	   r   r   ÚtuplerÖ   Ú__static_attributes__Ú__classcell__)r'   s   @r-   r1   r1   {   s›  ø† ñð" ÐØ<ÐàØðÐð
YàðYð 'ðYð ð	Yð
 0ðYð 3÷Yð. Ø#Ø"Ø'+Ø+/ôAðL ,0Ø,0Ø%&Ø&*Ø-1Ø6:Ø59Ø>BØ#&Ø#'ñMlà�d˜3‘i‘ðMlð ˜t C™y™ðMlð &*ð	Mlð
  #ðMlð —‘˜tÑ#ðMlð —|‘| dÑ*ðMlð !&§¡¨tÑ 3ðMlð  %Ÿ|™|¨dÑ2ðMlð ).¯©°tÑ(;ðMlð !ðMlð ˜D‘LõMlðr ôò@)ð ñ$ó ð$ð ñ&ó ð&ð ñ#ó ð#ð ‡]‚]ƒ_ÙÐ1Ó2ð #'Ø+/Ø#%Ø"Ø #Ø,-Ø!Ø ØDHØ'+Ø-1Ø59Ø6:Ø>BØ#&Ø"'Ø Ø26ØnrØ9B¸ñ+q1à�d˜3‘i‘ðq1ð ˜t C™y™ðq1ð !ð	q1ð
 �U‘ðq1ð ðq1ð  # T™zðq1ð �d‘
ðq1ð �T‰zðq1ð —?‘? T¨%¯/©/Ñ%:Ñ:¸TÑAðq1ð —‘ Ñ$ðq1ð —|‘| dÑ*ðq1ð  %Ÿ|™|¨dÑ2ðq1ð !&§¡¨tÑ 3ðq1ð ).¯©°tÑ(;ðq1ð  !ð!q1ð" ˜4‘Zð#q1ð$ ð%q1ð& ˜s C˜x™.¨4Ñ/ð'q1ð( '¨¨S z°4Ð'7Ñ8Ð;KÑKÐNdÑdÐgkÑkð)q1ð* -1°©Ið+q1ð, 
˜uÑ	$ô-q1ó 3ó öq1r/   r1   )NNNN)1r"   Útypingr   r   rr   Útransformersr   r   Ú	callbacksr   r	   rC   r
   Úloadersr   Úmodelsr   r   Ú
schedulersr   Úutilsr   r   r   r   r   r   r   Úutils.torch_utilsr   Úpipeline_utilsr   r   Útorch_xla.core.xla_modelÚcoreÚ	xla_modelrÁ   rµ   Ú
get_loggerrØ   ru   rä   r�   rQ   r   rR   rá   r.   r1   r   r/   r-   Ú<module>r÷      sÜ   ðó ß  ã ß 6ç AÝ 0Ý .ß ?Ý 9÷÷ ñ õ .ß Cñ ×Ñß)Ð)à�Mà€Mà	×	Ò	˜HÓ	%€ðÐ ð$ '+Ø(,Ø"&Ø!%ñ8*à˜t™ð8*ð �%—,‘,Ñ Ñ%ð8*ð �C‰y˜4Ñð	8*ð
 �‰K˜$Ñõ8*ôvd1Ð(Ð*Aõ d1r/   